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.
Johannes Thumshirn [Fri, 19 May 2017 13:55:31 +0000 (15:55 +0200)]
sg/001: add regression test for syzcaller generated GPF in sg_read path
Add a regression test for commit 48ae8484e9fc ("scsi: sg: don't return
bogus Sg_requests"). This is a general protection fault triggered by
syzcaller via issuing bogus read(2)s on the /dev/sg devices.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Omar Sandoval <osandov@fb.com>
Johannes Thumshirn [Fri, 19 May 2017 13:17:10 +0000 (15:17 +0200)]
check: add ability to exclude a test or group
Add the ability to exclude a test or whole test group from a test
run. Thus a user can explicitly decide which tests to skip like in
this example where one wants all of the 'block' group but block/001.
block/002 (remove a device while running blktrace)
0.835s ...
runtime + test ...
[ 363.132053] run blktests block/002 at 2017-05-19 13:01:56
[ 363.136844] scsi host0: scsi_debug: version 1.86 [20160430]
[ 363.136844] dev_size_mb=8, opts=0x0, submit_queues=1, statistics=0
[ 363.138819] scsi 0:0:0:0: Direct-Access Linux scsi_debug 0186 PQ: 0 ANSI: 7
[ 363.199172] sd 0:0:0:0: [sda] 16384 512-byte logical blocks: (8.39 MB/8.00 MiB)
[ 363.207053] sd 0:0:0:0: [sda] Write Protect is off
block/002 (remove a device while running blktrace) [passed]
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: use associative array, make explicit run take precedence over -x] Signed-off-by: Omar Sandoval <osandov@fb.com>
Omar Sandoval [Thu, 11 May 2017 21:36:38 +0000 (14:36 -0700)]
Save and restore sysfs knobs modified during test
This adds two new helpers, _test_dev_queue_get and _test_dev_queue_set,
which wrap access to /sys/block/$dev/queue/*. _test_dev_queue_set saves
the sysfs variable before it overwrites it, to be restored in ./check.
Omar Sandoval [Thu, 11 May 2017 07:12:54 +0000 (00:12 -0700)]
Simplify test groups and overhaul test running
This gets rid of the concept of test groups as used by xfstests and
renames categories into groups. If it turns out we want it back, we can
reintroduce test tags later.
This rework also has a few other effects:
- The config file is now entirely optional, as is TEST_DEVS
- prepare() and prepare_device() are renamed to {group_,}requires() and
{group_,}device_requires()
- QUICK and TIMED are now test flags instead of groups
- Running test groups is now just `./check block`
Omar Sandoval [Wed, 10 May 2017 17:33:02 +0000 (10:33 -0700)]
Add support for test timeout
Add a configurable per-test timeout. By default, tests will run fully.
If $TIMEOUT is set, tests may restrict themselves to that timeout. So,
e.g., `TIMEOUT=30 ./check -g quick -g timed` can be used to do a quick
sanity test without doing the full run.