Omar Sandoval [Wed, 23 May 2018 00:11:11 +0000 (17:11 -0700)]
Documentation: document custom config setup
To quote Johannes Thumshirn's patch which inspired this one: "The config
file is bash and it gets sourced, so all bash magic is doable in there
as well. Document it so others don't have to re-discover this gem as
well."
Chaitanya Kulkarni [Tue, 8 May 2018 05:45:32 +0000 (01:45 -0400)]
blktests: use global configfs variable
This patch introduces a global variable to hold the
configfs nvmet path. Now we don't need repetitive
local variables to hold the path and testcases
can use the newly introduced variable if needed.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Apparently tracefs is lazily mounted, so try to stat
/sys/kernel/debug/tracing/trace before we check if it's mounted in order
to avoid false negatives.
Keith Busch [Thu, 26 Apr 2018 22:52:24 +0000 (16:52 -0600)]
Add surprise removal block test
This test is for PCI devices in a surprise remove capable slot and tests
how well the drivers and kernel handle losing the link to that device.
The test finds the PCI Express Capability register of the pci slot a block
device is in, then at offset 0x10 (the Link Control Register) writes a 1
to bit 4 (Link Disable). This occurs unbeknownst to any of the drivers,
just like a surprise removal. Drivers will find out about this through
the pcie hotplug handler, at which point it's too late to communicate
with the device, therfore testing how well we cope with the condition.
The link is reenabled at the end of the test.
Note, this is currently incompatible with NVMe Subsystems when
CONFIG_NVME_MULTIPATH since the /dev/nvme*n* names don't have a pci
parent in sysfs.
Signed-off-by: Keith Busch <keith.busch@intel.com>
common/nvme:32:18: note: Use find instead of ls to better handle
non-alphanumeric filenames. [SC2012]
Secondly, it's not _technically_ correct to just count the number of
ports, since there could be just one port numbered 1. Instead, find the
first free port.
scsi/004: set delay in nanoseconds instead of jiffies
Steffen pointed out that "the timeout should be sufficiently larger than
scsi_debug/delay, in order not to run into the command timeout". The
delay parameter is in jiffies, so on s390 with the default HZ=100, 1000
jiffies are 10 seconds, more than the blk-mq timeout. Just use ndelay
instead.
Josef Bacik [Fri, 13 Apr 2018 16:07:48 +0000 (12:07 -0400)]
blktests: add nbd test for online resize
This tests resizing a connected nbd device. We connect to the existing
10gig device, and resize it online to 1gig, and make sure lsblk and
parted (which use different size determination methods) both report the
correctly updated size.
Signed-off-by: Josef Bacik <jbacik@fb.com>
[Omar: squash commits, add note on required patches] Signed-off-by: Omar Sandoval <osandov@fb.com>
Johannes Thumshirn [Tue, 27 Mar 2018 09:21:09 +0000 (11:21 +0200)]
test/nvme/003: add test case for patch "nvme: don't send keep-alives to the discovery controller"
Add a regression test for the patch titled "nvme: don't send
keep-alives to the discovery controller".
This patch creates a local loopback nvme target and then connects to
it. If the patch is not applied we see two error messages in dmesg:
"failed nvme_keep_alive_end_io error=" from the nvme host and "nvmet:
unsupported cmd 24" from the nvme target. If the patch is applied
dmesg is quiet.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
This pull adds a new test-case to the nvme test group for testing big
discovery log pages.
It is inspired by a bug triggered in the user-space 'nvme discover' with
a non Linux target which set's an non 0 MDTS (Maximum Data Transfer
Size) value causing nvme cli to fail the discovery.
There isn't a userspace fix yet, but it's still a nice scalability test.
Jeremy Cline [Tue, 6 Mar 2018 19:22:33 +0000 (14:22 -0500)]
sg: test for patch "Keep disk read-only when re-reading partition"
Add a regression test for the patch "scsi: sd: Keep disk read-only when
re-reading partition" which ensures re-reading a disk's partition table
doesn't change its read-only flag.
Jon Derrick [Mon, 27 Nov 2017 21:49:05 +0000 (14:49 -0700)]
common/rc: allow 5-digit domains in _get_pci_dev_from_blkdev
At least one driver (VMD) uses 32-bit pci domains, but is effectively
limited to 5-digit domains. Allow tests to access devices with 4-5 digit
domains.
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Omar Sandoval [Fri, 10 Nov 2017 19:07:13 +0000 (11:07 -0800)]
block/012: fix xfs_io error mismatch
Old versions of xfs_io (like David must be using) use pwrite64() instead
of pwrite(), which was causing an output mismatch on my newer version.
Pull in _filter_xfs_io_error from xfstests to fix it. While we're here,
add a slightly more descriptive description.
Fixes: 3aeec46f048b ("block/012: add test for BLKROSET/BLKROGET ioctls") Signed-off-by: Omar Sandoval <osandov@fb.com>
Omar Sandoval [Wed, 16 Aug 2017 05:36:43 +0000 (22:36 -0700)]
common/scsi_debug: make helpers more useful
Generalize the helpers to make them more useful: instead of always
setting up one device, it now takes arbitrary module parameters and sets
up as many devices as requested.
Johannes Thumshirn [Thu, 6 Jul 2017 12:09:21 +0000 (14:09 +0200)]
sg: add regression test for patch scsi: sg: fix SG_DXFER_FROM_DEV transfers
Add a regression test for the patch titled "scsi: sg: fix
SG_DXFER_FROM_DEV transfers" which reassembles the syscalls done by Nero
Burning ROM to discover CD and DVD burners.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: rename _get_sg_from_blockdev to _get_test_dev_sg and fix sg/001] Signed-off-by: Omar Sandoval <osandov@fb.com>
Johannes Thumshirn [Fri, 30 Jun 2017 09:07:35 +0000 (11:07 +0200)]
tests: use nproc to get number of CPUs for fio jobs
Use nproc to get number of CPUs for fio jobs and introduce
_run_fio_rand_io helper for parallel IO which we don't really care about
the details and just want some IO.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Jens Axboe [Thu, 22 Jun 2017 14:02:29 +0000 (08:02 -0600)]
block/010: add test case for shared/unshared tags
Loads null_blk with and without shared_tags, and with 32 devices
and 16 queues each. Run a fio perf job in both modes, and output
the achieved IOPS. They should be pretty close to each other.