]> www.infradead.org Git - users/sagi/blktests.git/log
users/sagi/blktests.git
7 years agosrc: port fsstress nishita
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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop: update block size tests for new ioctl
Omar Sandoval [Thu, 7 Sep 2017 17:58:21 +0000 (10:58 -0700)]
loop: update block size tests for new ioctl

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop: test direct I/O mode + custom block size
Omar Sandoval [Fri, 18 Aug 2017 19:22:58 +0000 (12:22 -0700)]
loop: test direct I/O mode + custom block size

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop/002: check that we can read and write
Omar Sandoval [Fri, 18 Aug 2017 19:18:07 +0000 (12:18 -0700)]
loop/002: check that we can read and write

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop/002: check physical block size and minimum io size as well
Omar Sandoval [Fri, 18 Aug 2017 18:38:28 +0000 (11:38 -0700)]
loop/002: check physical block size and minimum io size as well

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoMerge pull request #3 from liangxiao1/master
Omar Sandoval [Tue, 22 Aug 2017 03:51:54 +0000 (20:51 -0700)]
Merge pull request #3 from liangxiao1/master

Check if null_block supports blocking in block/006

8 years agoblock/006: added checking if null_blk has blocking flag
Xiao Liang [Tue, 22 Aug 2017 02:51:21 +0000 (10:51 +0800)]
block/006: added checking if null_blk has blocking flag

There is no 'blocking' parameter on some branches, eg. RHEL7.

Signed-off-by: Xiao Liang <xiliang@redhat.com>
8 years agoloop: test if closing an unbound device is too slow
Omar Sandoval [Fri, 18 Aug 2017 08:01:11 +0000 (01:01 -0700)]
loop: test if closing an unbound device is too slow

Based on a patch from James Wang.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop: test LO_FLAGS_BLOCKSIZE
Omar Sandoval [Fri, 18 Aug 2017 06:22:22 +0000 (23:22 -0700)]
loop: test LO_FLAGS_BLOCKSIZE

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agosrc: compile with -Wall
Omar Sandoval [Fri, 18 Aug 2017 05:37:33 +0000 (22:37 -0700)]
src: compile with -Wall

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agonew: clarify what CHECK_DMESG does
Omar Sandoval [Wed, 16 Aug 2017 06:00:55 +0000 (23:00 -0700)]
new: clarify what CHECK_DMESG does

It only checks for scary messages in dmesg, not random messages.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocommon/scsi_debug: make helpers more useful
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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agosg/001: remove unused scsi_debug dependency
Omar Sandoval [Wed, 16 Aug 2017 05:36:03 +0000 (22:36 -0700)]
sg/001: remove unused scsi_debug dependency

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/001: require sd_mod and sr_mod
Omar Sandoval [Wed, 16 Aug 2017 05:34:30 +0000 (22:34 -0700)]
block/001: require sd_mod and sr_mod

This test doesn't do anything interesting without those.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agosg: add regression test for patch scsi: sg: fix SG_DXFER_FROM_DEV transfers
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>
8 years agotests: use nproc to get number of CPUs for fio jobs
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>
8 years agoblock/011: Perform PCI reset while doing IO
Johannes Thumshirn [Tue, 27 Jun 2017 13:42:57 +0000 (15:42 +0200)]
block/011: Perform PCI reset while doing IO

This test-case performs I/O with fio while doing PCI disable/enable
cycles.

In the results we don't care for I/O errors but for hiccups in dmesg only.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
8 years agorc: add helpers to handle PCI test devices
Johannes Thumshirn [Tue, 27 Jun 2017 13:42:56 +0000 (15:42 +0200)]
rc: add helpers to handle PCI test devices

Add two helpers to check whether a device is attached via PCI and to get the
PCI device from a TEST_DEV

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
8 years agorc: use grep -q instead of redirecting to /dev/null
Omar Sandoval [Mon, 26 Jun 2017 21:25:44 +0000 (14:25 -0700)]
rc: use grep -q instead of redirecting to /dev/null

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/010: only run if null_blk supports shared_tags
Omar Sandoval [Mon, 26 Jun 2017 21:13:21 +0000 (14:13 -0700)]
block/010: only run if null_blk supports shared_tags

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/010: add test case for shared/unshared tags
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.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 years agoblock/006: use _fio_perf to get perf results
Jens Axboe [Wed, 21 Jun 2017 15:16:51 +0000 (09:16 -0600)]
block/006: use _fio_perf to get perf results

The tests flags us as being interested in seeing the read iops,
but it needs to use _fio_perf to get that, instead of _run_fio.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 years agosg/001: don't require scsi_debug
Johannes Thumshirn [Fri, 23 Jun 2017 08:14:48 +0000 (10:14 +0200)]
sg/001: don't require scsi_debug

Don't require scsi_debug but check if TEST_DEV is a SCSI device and use it
instead.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
8 years agocheck: define TEST_DEV_SYSFS for group_device_requires
Omar Sandoval [Mon, 26 Jun 2017 20:18:07 +0000 (13:18 -0700)]
check: define TEST_DEV_SYSFS for group_device_requires

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoHandle filters with repeated slashes
Omar Sandoval [Wed, 7 Jun 2017 21:40:14 +0000 (14:40 -0700)]
Handle filters with repeated slashes

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoFix all shellcheck warnings
Omar Sandoval [Fri, 19 May 2017 17:26:45 +0000 (10:26 -0700)]
Fix all shellcheck warnings

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocommon/scsi_debug: add udevadm settle after modprobe
Omar Sandoval [Wed, 7 Jun 2017 06:36:03 +0000 (23:36 -0700)]
common/scsi_debug: add udevadm settle after modprobe

This makes sure the device is available before we start looking for it
in sysfs.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agosg/001: put syzkaller temporary crap in $TMPDIR
Omar Sandoval [Wed, 7 Jun 2017 06:32:07 +0000 (23:32 -0700)]
sg/001: put syzkaller temporary crap in $TMPDIR

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocommon/rc: use --quiet when calling modprobe for _have_module
Omar Sandoval [Wed, 7 Jun 2017 06:18:44 +0000 (23:18 -0700)]
common/rc: use --quiet when calling modprobe for _have_module

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agosg/001: add regression test for syzcaller generated GPF in sg_read path
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>
8 years agotests/sg: add SCSI generic test group
Johannes Thumshirn [Fri, 19 May 2017 13:55:30 +0000 (15:55 +0200)]
tests/sg: add SCSI generic test group

Add a test group for tests of the SCSI generic driver and and functions
common to the SCSI generic driver and its test cases.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoAdd ability to build test-cases
Johannes Thumshirn [Thu, 18 May 2017 12:13:06 +0000 (14:13 +0200)]
Add ability to build test-cases

Add the ability to build test cases from C files. This is handy for
things like syzcaller reproducers and all other kinds of test binaries.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: trimmed down Makefiles, renamed syzkaller binary]
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: support QUICK_RUN, TIMEOUT, and EXCLUDED in config
Omar Sandoval [Fri, 19 May 2017 18:35:34 +0000 (11:35 -0700)]
check: support QUICK_RUN, TIMEOUT, and EXCLUDED in config

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: add ability to exclude a test or group
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>
8 years agoDon't skip all devices if device_requires fails on one
Omar Sandoval [Fri, 19 May 2017 17:28:48 +0000 (10:28 -0700)]
Don't skip all devices if device_requires fails on one

Fixes #2.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoMerge pull request #1 from bvanassche/master
Omar Sandoval [Fri, 12 May 2017 20:30:49 +0000 (13:30 -0700)]
Merge pull request #1 from bvanassche/master

Make it easy to verify the shell scripts with shellcheck

8 years agocommon/rc: Do not mix strings and arrays
Bart Van Assche [Fri, 12 May 2017 19:50:18 +0000 (12:50 -0700)]
common/rc: Do not mix strings and arrays

Expansion of $@ results in multiple strings. Since that is not intended
in this context, change $@ into $*. Detected by shellcheck.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
8 years agoAdd a Makefile that makes it easy to run shellcheck
Bart Van Assche [Fri, 12 May 2017 19:49:21 +0000 (12:49 -0700)]
Add a Makefile that makes it easy to run shellcheck

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
8 years agoREADME: document that bash 4 is required
Omar Sandoval [Fri, 12 May 2017 18:32:58 +0000 (11:32 -0700)]
README: document that bash 4 is required

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoAdd CONTRIBUTING.md
Omar Sandoval [Fri, 12 May 2017 18:22:11 +0000 (11:22 -0700)]
Add CONTRIBUTING.md

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock: add CPU hotplug test
Omar Sandoval [Thu, 11 May 2017 22:39:16 +0000 (15:39 -0700)]
block: add CPU hotplug test

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoSave and restore sysfs knobs modified during test
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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: align test run metrics nicely
Omar Sandoval [Thu, 11 May 2017 19:56:47 +0000 (12:56 -0700)]
check: align test run metrics nicely

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: fix tests getting run twice
Omar Sandoval [Thu, 11 May 2017 19:50:04 +0000 (12:50 -0700)]
check: fix tests getting run twice

Another dumb mistake.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: fix braino
Omar Sandoval [Thu, 11 May 2017 19:29:35 +0000 (12:29 -0700)]
check: fix braino

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: add support for quick runs
Omar Sandoval [Thu, 11 May 2017 18:54:50 +0000 (11:54 -0700)]
check: add support for quick runs

Easy way to do a quick sanity run: `./check -q`.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoSimplify test groups and overhaul test running
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`

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoAdd support for test timeout
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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/007: include mean lat in poll output
Jens Axboe [Wed, 10 May 2017 15:37:15 +0000 (09:37 -0600)]
block/007: include mean lat in poll output

Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoblock/003: change from time based to doing 200k trims
Jens Axboe [Wed, 10 May 2017 15:37:02 +0000 (09:37 -0600)]
block/003: change from time based to doing 200k trims

Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agoAdd mandatory test description variable to tests
Omar Sandoval [Wed, 10 May 2017 07:22:20 +0000 (00:22 -0700)]
Add mandatory test description variable to tests

With this, we can have more meaningful output in the test logs without
having to consult the test script itself.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoAdd fio performance measurement helper
Omar Sandoval [Wed, 10 May 2017 06:36:12 +0000 (23:36 -0700)]
Add fio performance measurement helper

Abstract all of the terse format parsing into a single helper and use
that everywhere.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/006: add regression test fix for blocking blk-mq driver
Jens Axboe [Wed, 10 May 2017 03:27:27 +0000 (21:27 -0600)]
block/006: add regression test fix for blocking blk-mq driver

Signed-off-by: Jens Axboe <axboe@fb.com>
8 years agocommon: require a fio version that supports terse format 4
Jens Axboe [Wed, 10 May 2017 02:37:50 +0000 (20:37 -0600)]
common: require a fio version that supports terse format 4

We need this for trim output. Has been supported since 2012 or so, hence
the requirement should be fair.

Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoAdd performance numbers to appropriate block tests
Jens Axboe [Tue, 9 May 2017 20:35:13 +0000 (14:35 -0600)]
Add performance numbers to appropriate block tests

Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/007: test variants of IO polling
Jens Axboe [Tue, 9 May 2017 19:52:00 +0000 (13:52 -0600)]
block/007: test variants of IO polling

Signed-off-by: Jens Axboe <axboe@fb.com>
[Omar: move I/O polling helpers into their own file]
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: relax root requirement
Omar Sandoval [Tue, 9 May 2017 19:17:33 +0000 (12:17 -0700)]
check: relax root requirement

Almost all tests need root, but the meta tests don't. Turn it into a
prepare() helper which is set by default on new categories.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: less dots
Omar Sandoval [Tue, 9 May 2017 19:06:56 +0000 (12:06 -0700)]
check: less dots

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: align passed/failed/notrun
Omar Sandoval [Tue, 9 May 2017 18:28:41 +0000 (11:28 -0700)]
check: align passed/failed/notrun

Part 2 of improving output readability.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: colorize passed/failed/not run
Omar Sandoval [Tue, 9 May 2017 17:52:01 +0000 (10:52 -0700)]
check: colorize passed/failed/not run

Part 1 of making it easier to scan and visually verify the test
progress.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocommon: fix _test_dev_is_rotational
Omar Sandoval [Tue, 9 May 2017 17:19:15 +0000 (10:19 -0700)]
common: fix _test_dev_is_rotational

Reported-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop/001: used parted instead of sfdisk
Omar Sandoval [Tue, 9 May 2017 17:04:18 +0000 (10:04 -0700)]
loop/001: used parted instead of sfdisk

sfdisk from util-linux < 2.26 doesn't support regular files or the syntax this
test was using, so just use parted instead.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock: add test case that runs a workload while switching schedulers
Jens Axboe [Fri, 5 May 2017 19:39:22 +0000 (13:39 -0600)]
block: add test case that runs a workload while switching schedulers

Signed-off-by: Jens Axboe <axboe@fb.com>
[Omar: add _test_dev_is_rotational helper, misc cleanup]
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: check if stdout is a tty before using terminal commands
Omar Sandoval [Fri, 5 May 2017 18:40:54 +0000 (11:40 -0700)]
check: check if stdout is a tty before using terminal commands

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: make sure $TMPDIR is deleted if interrupted
Omar Sandoval [Fri, 5 May 2017 18:36:27 +0000 (11:36 -0700)]
check: make sure $TMPDIR is deleted if interrupted

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: move _find_sysfs_dir definition closer to where it is used
Omar Sandoval [Fri, 5 May 2017 18:31:50 +0000 (11:31 -0700)]
check: move _find_sysfs_dir definition closer to where it is used

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: exit with non-zero status if tests fail
Omar Sandoval [Fri, 5 May 2017 18:30:44 +0000 (11:30 -0700)]
check: exit with non-zero status if tests fail

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agogitignore: remove results.last
Omar Sandoval [Fri, 5 May 2017 18:22:06 +0000 (11:22 -0700)]
gitignore: remove results.last

This isn't used anymore.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoREADME: update information on writing tests
Omar Sandoval [Fri, 5 May 2017 06:38:25 +0000 (23:38 -0700)]
README: update information on writing tests

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: don't interleave definitions and execution
Omar Sandoval [Fri, 5 May 2017 06:33:01 +0000 (23:33 -0700)]
check: don't interleave definitions and execution

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: fix test group inclusion vs. exclusion
Omar Sandoval [Fri, 5 May 2017 06:30:49 +0000 (23:30 -0700)]
check: fix test group inclusion vs. exclusion

If a test belongs to a group which is included and also a group which is
excluded, the exclusion should take precedence.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/00{3,4}: add to more groups
Omar Sandoval [Fri, 5 May 2017 06:29:10 +0000 (23:29 -0700)]
block/00{3,4}: add to more groups

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agonew: move test writing documentation directly into templates
Omar Sandoval [Fri, 5 May 2017 06:24:05 +0000 (23:24 -0700)]
new: move test writing documentation directly into templates

It's more accesible here, and certain people won't look at the
documentation even when you tell them to.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/003: check if the test device supports discard
Omar Sandoval [Thu, 4 May 2017 22:24:57 +0000 (15:24 -0700)]
block/003: check if the test device supports discard

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: export sysfs directory for test device
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).

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/00{3,4}: log fio output to $FULL
Omar Sandoval [Thu, 4 May 2017 21:49:02 +0000 (14:49 -0700)]
block/00{3,4}: log fio output to $FULL

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: clean up $FULL from previous test runs
Omar Sandoval [Thu, 4 May 2017 21:48:07 +0000 (14:48 -0700)]
check: clean up $FULL from previous test runs

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoAdd flush intensive test case
Jens Axboe [Thu, 4 May 2017 20:44:38 +0000 (14:44 -0600)]
Add flush intensive test case

Signed-off-by: Jens Axboe <axboe@fb.com>
[Omar: used new _have_fio helper, quoted $TEST_DEV]
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock: add random offset/size discard test case
Jens Axboe [Wed, 3 May 2017 19:09:24 +0000 (13:09 -0600)]
block: add random offset/size discard test case

Signed-off-by: Jens Axboe <axboe@fb.com>
[Omar: created _have_fio helper, quoted $TEST_DEV]
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: allow tests to record arbitrary metrics
Omar Sandoval [Thu, 4 May 2017 20:39:29 +0000 (13:39 -0700)]
check: allow tests to record arbitrary metrics

Don't run the test function in a subshell so tests can set
TEST_RUN[foo]=bar and it will be shown along with the runtime.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: change how results are recorded
Omar Sandoval [Thu, 4 May 2017 20:17:04 +0000 (13:17 -0700)]
check: change how results are recorded

Preparation for allowing tests to record arbitrary metrics.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agocheck: stricter test matching
Omar Sandoval [Thu, 4 May 2017 07:40:45 +0000 (00:40 -0700)]
check: stricter test matching

Jens noticed that check tried to execute his undo file:

./check: line 219: .: tests/block/.003.un~: cannot execute binary file

Fix it by explicitly matching '[0-9]{3}'.

Reported-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agometa/00{7,8}: fix skip reason formatting
Omar Sandoval [Thu, 4 May 2017 19:54:51 +0000 (12:54 -0700)]
meta/00{7,8}: fix skip reason formatting

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoREADME: document dependency on GNU awk
Omar Sandoval [Thu, 4 May 2017 20:17:51 +0000 (13:17 -0700)]
README: document dependency on GNU awk

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock/001: remove from quick group
Omar Sandoval [Wed, 3 May 2017 18:50:18 +0000 (11:50 -0700)]
block/001: remove from quick group

This takes almost 30 seconds on my VM and longer than 30 seconds on a
different machine.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock: test debugfs interaction with blktrace
Omar Sandoval [Wed, 3 May 2017 18:49:39 +0000 (11:49 -0700)]
block: test debugfs interaction with blktrace

The lifetimes in the kernel are tricky, let's make sure we get it right.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoblock: stress test device hotplugging
Omar Sandoval [Mon, 1 May 2017 19:31:16 +0000 (12:31 -0700)]
block: stress test device hotplugging

Based on my old stress_test_scsi_debug.sh script.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop/001: add to quick group
Omar Sandoval [Mon, 1 May 2017 17:25:52 +0000 (10:25 -0700)]
loop/001: add to quick group

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoFix README links
Omar Sandoval [Fri, 28 Apr 2017 23:24:07 +0000 (16:24 -0700)]
Fix README links

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoloop: test partition scanning
Omar Sandoval [Fri, 28 Apr 2017 23:15:21 +0000 (16:15 -0700)]
loop: test partition scanning

First real test case.

Signed-off-by: Omar Sandoval <osandov@fb.com>
8 years agoInitial commit
Omar Sandoval [Fri, 28 Apr 2017 23:00:25 +0000 (16:00 -0700)]
Initial commit

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.

Signed-off-by: Omar Sandoval <osandov@fb.com>