Omar Sandoval [Mon, 9 Oct 2017 19:10:46 +0000 (12:10 -0700)]
src: port fsstress
Nishita needs this for the integrity tests. Pull in fsstress from
xfstests as of commit 64b90915304c0cc1bf60c567d46ad88728e74b42. I really
don't want the xfstests build system, so I modified fsstress.c to
include its dependencies directly instead of the xfstests "global.h"
file and added the macro necessary definitions to the Makefile
invokation.
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.
Omar Sandoval [Thu, 4 May 2017 22:21:35 +0000 (15:21 -0700)]
check: export sysfs directory for test device
E.g., if TEST_DEV=/dev/sda, then TEST_DEV_SYSFS=/sys/block/sda, and if
TEST_DEV=/dev/nvme0n1p1, then TEST_DEV_SYSFS=/sys/block/nvme0n1 (i.e.,
we get the sysfs directory for the full device, not the partition).
blktests is heavily inspired by xfstests, with a few important
differences:
- It can run tests on multiple devices at once (serialized for now, but
this can be changed).
- It has a notion of per-device tests (e.g., for testing specific I/O
workloads that have been known to cause problems) and no-device tests
(e.g., for tests that set up pseudo-devices).
- It has documentation.
- It's not ancient, so the framework is much cleaner.
Also included is a set of "meta" tests, i.e., tests that test the
testing framework itself.