Linux kernel commit ca4b2a011948 ("null_blk: add zone support") broke
null_blk queue_mode=0. None of the existing tests use bio mode, so add a
test which does a very basic test of all modes.
Omar Sandoval [Fri, 10 Aug 2018 18:07:59 +0000 (11:07 -0700)]
Delete nvme/001
Johannes pointed out that the format of this tracepoint is going to
change in 4.19, which will make this test fail. Now that we have a slew
of real NVMe tests, we can do without this one. We can always add it
back if we decide it's useful later.
Bart Van Assche [Tue, 19 Jun 2018 20:39:23 +0000 (13:39 -0700)]
Add tests for the SRP initiator and target drivers
This patch adds the following tests:
001: Create and remove LUNs
002: File I/O on top of multipath concurrently with logout and login (mq)
003: File I/O on top of multipath concurrently with logout and login (sq)
004: File I/O on top of multipath concurrently with logout and login (sq-on-mq)
005: Direct I/O with large transfer sizes, cmd_sg_entries=255 and bs=4M
006: Direct I/O with large transfer sizes, cmd_sg_entries=255 and bs=8M
007: Direct I/O with large transfer sizes, cmd_sg_entries=1 and bs=4M
008: Direct I/O with large transfer sizes, cmd_sg_entries=1 and bs=8M
009: Buffered I/O with large transfer sizes, cmd_sg_entries=255 and bs=4M
010: Buffered I/O with large transfer sizes, cmd_sg_entries=255 and bs=8M
011: Block I/O on top of multipath concurrently with logout and login
012: dm-mpath on top of multiple I/O schedulers
013: Direct I/O using a discontiguous buffer
Other changes in this patch are:
- Add function _have_kernel_option to common/rc.
- Add file tests/srp/rc with shell functions that are used by multiple SRP
tests.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Add c-mode settings for the files in the src directory. Additionally,
make indent-tabs-mode global such that it also applies to the
.dir-locals.el file itself.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
block/008: fix race between CPU offline and fio startup
If fio is still setting up when we start hotplugging CPUs, fio can fail
with "clock setaffinity failed: Invalid argument". That comes from
calling sched_setaffinity() on an offline CPU. We can make this much
less likely to happen by sleeping before we start hotplugging.
Hannes Reinecke [Wed, 9 Aug 2017 10:50:06 +0000 (12:50 +0200)]
scsi: regression test for SCSI device blacklisting
SCSI device blacklisting seems to be a tricky subject, with lots of
potential for messing up the selection algorithm. This adds a test for
catching regressions here.
Signed-off-by: Hannes Reinecke <hare@suse.com>
[Omar: updated to use improved scsi_debug helpers] Signed-off-by: Omar Sandoval <osandov@fb.com>
Omar Sandoval [Tue, 26 Jun 2018 18:27:11 +0000 (11:27 -0700)]
Make group/rc and common/rc sources explicit and reenable SC2034
SC2034 (unused variable) is a useful warning, but we disabled it because
we set a bunch of global variables as test metadata. However, this is
easy to work around: as Bart demonstrated, an echo "$VAR" > /dev/null
does the trick.
However, we don't want to copy-and-paste this everywhere, so we need to
source something everywhere. Bart's idea was to put this in
common/shellcheck and source that everywhere. Sourcing a file just to
appease the linter is silly, though, so instead, this adds explicit
sources of tests/*/rc to each test, which in turn sources common/rc,
which in turn sources common/shellcheck.
Johannes Thumshirn [Tue, 12 Jun 2018 09:57:06 +0000 (11:57 +0200)]
check: add command line switch to test device drivers only
Sometimes it's useful to only run tests which exercise a device special
driver to verify a patch for the driver doesn't introduce a regression.
Running the whole test-suite is just a waste of time in this case, so
provide a way to only run tests which have a test_device() function set
and not a test() function.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: fix argument parsing, move check to found_test(), add documentation] Signed-off-by: Omar Sandoval <osandov@fb.com>
Omar Sandoval [Mon, 11 Jun 2018 20:34:40 +0000 (13:34 -0700)]
block/008: fix shellcheck warnings
tests/block/008:68:10: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
tests/block/008:74:10: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
Josef Bacik [Wed, 16 May 2018 16:04:50 +0000 (12:04 -0400)]
nbd/002: add a partition table test
Partition tables are hard, add a test to make sure we create/delete them
properly.
Signed-off-by: Josef Bacik <jbacik@fb.com>
[Omar: clean up helpers, use udevadm settle instead of stat, etc.] Signed-off-by: Omar Sandoval <osandov@fb.com>
Omar Sandoval [Mon, 11 Jun 2018 20:15:11 +0000 (13:15 -0700)]
nbd/001: use -L for nbd-client
Newer versions of nbd-client always use netlink, which makes the
nbdsetsize test program fail. Use the -L (-nonetlink) option to force
the ioctl interface. This means that this test can't be run with older
versions of nbd-client anymore, but, eh.
Omar Sandoval [Mon, 11 Jun 2018 18:31:57 +0000 (11:31 -0700)]
block/008: don't try to offline all CPUs if all CPUs are hotpluggable
Chen Rong reported that if CPU0 is hotpluggable (because we booted with
cpu0_hotplug or CONFIG_BOOTPARAM_HOTPLUG_CPU0 was enabled), block/008
can try to offline all CPUs at once, which isn't allowed. Fix it by
repeatedly offlining as many CPUs as is allowed and onlining all CPUs,
instead of the previous approach of randomly onlining/offlining. This is
better than the previous approach because we won't try to online already
online CPUs and offline already offline CPUs. Closes #23.
Reported-by: Chen Rong <chenr.fnst@cn.fujitsu.com> Signed-off-by: Omar Sandoval <osandov@fb.com>
Keith Busch [Mon, 4 Jun 2018 22:51:41 +0000 (16:51 -0600)]
block/011: don't use sysfs for device disabling
The PCI sysfs interface may not be a dependable method for toggling the
PCI device state to trigger the timeouts. This patch goes directly to
the config space to make device failure occur.
Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Keith Busch <keith.busch@intel.com>
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.