]> www.infradead.org Git - users/sagi/blktests.git/log
users/sagi/blktests.git
7 years agonvme: add NVMeOF smart-log test for bdev-ns
Chaitanya Kulkarni [Tue, 18 Sep 2018 02:24:22 +0000 (19:24 -0700)]
nvme: add NVMeOF smart-log test for bdev-ns

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agonvme: add NVMeOF reset test for file-ns
Chaitanya Kulkarni [Tue, 18 Sep 2018 02:24:21 +0000 (19:24 -0700)]
nvme: add NVMeOF reset test for file-ns

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agonvme: add NVMeOF list test for file-ns
Chaitanya Kulkarni [Tue, 18 Sep 2018 02:24:20 +0000 (19:24 -0700)]
nvme: add NVMeOF list test for file-ns

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agonvme: add NVMeOF DSM discard test for file-ns
Chaitanya Kulkarni [Tue, 18 Sep 2018 02:24:19 +0000 (19:24 -0700)]
nvme: add NVMeOF DSM discard test for file-ns

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agonvme: add NVMeOF DSM discard test for bdev-ns
Chaitanya Kulkarni [Tue, 18 Sep 2018 02:24:18 +0000 (19:24 -0700)]
nvme: add NVMeOF DSM discard test for bdev-ns

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblock: add smoke test for queue_mode=0
Omar Sandoval [Wed, 12 Sep 2018 23:55:00 +0000 (16:55 -0700)]
block: add smoke test for queue_mode=0

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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoscsi: add test that toggles cache_type
Omar Sandoval [Tue, 28 Aug 2018 22:10:06 +0000 (15:10 -0700)]
scsi: add test that toggles cache_type

This is Jens' easy reproducer for
https://www.spinics.net/lists/linux-block/msg29942.html.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblktests: remove unused null_blk parameter for _init_null_blk in block/016
Yi Zhang [Sat, 25 Aug 2018 10:06:19 +0000 (18:06 +0800)]
blktests: remove unused null_blk parameter for _init_null_blk in block/016

Reviewed-by: Gioh Kim <gi-oh.kim@profitbricks.com>
Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
7 years agoDelete nvme/001
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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblktests: add NVMeOF many file-ns creation test
Chaitanya Kulkarni [Wed, 27 Jun 2018 22:40:53 +0000 (18:40 -0400)]
blktests: add NVMeOF many file-ns creation test

This patch adds a new testcase to exercise a large number of ns
creation and deletion along with discovery command.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF many bdev-ns creation test
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:53 +0000 (05:15 -0400)]
blktests: add NVMeOF many bdev-ns creation test

This patch adds a new testcase to exercise a large number of ns
creation and deletion along with discovery command.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF flush test for file-ns
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:52 +0000 (05:15 -0400)]
blktests: add NVMeOF flush test for file-ns

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF flush test for bdev-ns
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:51 +0000 (05:15 -0400)]
blktests: add NVMeOF flush test for bdev-ns

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agocheck: add --output parameter
Omar Sandoval [Wed, 25 Jul 2018 21:18:37 +0000 (14:18 -0700)]
check: add --output parameter

In case we want to store the results somewhere other than ./results.
Based on a patch from Hannes Reinecke.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agosrc: add -std=c++11 to C++ build flags
Omar Sandoval [Wed, 25 Jul 2018 21:25:03 +0000 (14:25 -0700)]
src: add -std=c++11 to C++ build flags

Certain distributions like to ship ancient relics for compilers.
Fixes #31.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocommon/rc: search harder for pci device
Johannes Thumshirn [Wed, 4 Jul 2018 11:40:12 +0000 (13:40 +0200)]
common/rc: search harder for pci device

Some multipathed NVMe devices have a bit of a different sysfs layout
then we've expoected them to have in the first place.

Try harder searching for a pci device if we encounter such a device.

This fixes issue #26.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agoAdd tests for the SRP initiator and target drivers
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>
7 years agoAdd the discontiguous-io test program
Bart Van Assche [Wed, 20 Jun 2018 22:58:17 +0000 (15:58 -0700)]
Add the discontiguous-io test program

This test program will be used by one of the srp tests.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agosrc/Makefile: Move -Wall from the C compilation rule to the $(CFLAGS) variable
Bart Van Assche [Thu, 5 Jul 2018 18:25:59 +0000 (11:25 -0700)]
src/Makefile: Move -Wall from the C compilation rule to the $(CFLAGS) variable

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agosrc/Makefile: Introduce the C_TARGETS variable
Bart Van Assche [Wed, 27 Jun 2018 21:02:39 +0000 (14:02 -0700)]
src/Makefile: Introduce the C_TARGETS variable

This patch does not change any functionality but will make it easier
to add support for building C++ code.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agocheck: Make $FULL an absolute path
Bart Van Assche [Fri, 29 Jun 2018 21:03:35 +0000 (14:03 -0700)]
check: Make $FULL an absolute path

This makes it safe to use $FULL in shell code that modifies (and
restores) the working directory.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agodir-locals.el: Add c-mode settings
Bart Van Assche [Thu, 5 Jul 2018 18:04:45 +0000 (11:04 -0700)]
dir-locals.el: Add c-mode settings

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>
7 years agoblock/008: fix race between CPU offline and fio startup
Omar Sandoval [Fri, 6 Jul 2018 21:42:23 +0000 (14:42 -0700)]
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.

Fixes #28.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMerge pull request #27 from gurugio/master
Omar Sandoval [Fri, 6 Jul 2018 21:33:28 +0000 (14:33 -0700)]
Merge pull request #27 from gurugio/master

Add null_blk helpers and settle udev before unloading null_blk

7 years agodir-locals.el: fix indenation with Emacs
Johannes Thumshirn [Fri, 6 Jul 2018 08:21:28 +0000 (10:21 +0200)]
dir-locals.el: fix indenation with Emacs

A recent update of Emacs broke .dir-locals.el's shell indentation
setting.

Also set 'sh-indentation' not just 'sh-basic-offset' for this.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agoblock: apply null_blk helpers
Gioh Kim [Wed, 4 Jul 2018 10:53:30 +0000 (12:53 +0200)]
block: apply null_blk helpers

use null_blk helpers to load/unload null_blk module

Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
7 years agocommon: make helpers for null_blk module
Gioh Kim [Wed, 4 Jul 2018 10:51:20 +0000 (12:51 +0200)]
common: make helpers for null_blk module

Common helpers for loading/unloading null_blk module.
It settles udev before loading/unloading.

Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
7 years agoblock: settle udev before removing null_blk module
Gioh Kim [Wed, 4 Jul 2018 10:30:14 +0000 (12:30 +0200)]
block: settle udev before removing null_blk module

prevent "modprobe: FATAL: Module null_blk is in use." errors.

Signed-off-by: Gioh Kim <gi-oh.kim@profitbricks.com>
7 years agoblktests: add timeout smoketest for !mq
Jens Axboe [Tue, 19 Jun 2018 17:21:13 +0000 (11:21 -0600)]
blktests: add timeout smoketest for !mq

Identical to block/014, except we test the legacy IO path instead
of blk-mq.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 years agoblock/014: make it explicit that we're testing blk-mq timeouts
Jens Axboe [Tue, 19 Jun 2018 18:07:38 +0000 (12:07 -0600)]
block/014: make it explicit that we're testing blk-mq timeouts

Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 years agoscsi: regression test for SCSI device blacklisting
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>
7 years agocheck: fix TEST_DEVS being overwritten
Omar Sandoval [Tue, 26 Jun 2018 20:09:43 +0000 (13:09 -0700)]
check: fix TEST_DEVS being overwritten

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocheck: allow setting config options as environment variables
Omar Sandoval [Tue, 26 Jun 2018 20:07:43 +0000 (13:07 -0700)]
check: allow setting config options as environment variables

Closes #25.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonew: sort group names
Omar Sandoval [Tue, 26 Jun 2018 18:49:59 +0000 (11:49 -0700)]
new: sort group names

And replace the unnecessary bash loop with more find flags.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMake group/rc and common/rc sources explicit and reenable SC2034
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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoRename tests/*/group to tests/*/rc
Omar Sandoval [Tue, 26 Jun 2018 18:00:35 +0000 (11:00 -0700)]
Rename tests/*/group to tests/*/rc

The following change is going to add an explicit source of these to the
tests themselves, and this naming makes more sense in that context.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocheck: Make TMPDIR absolute
Bart Van Assche [Fri, 22 Jun 2018 22:19:43 +0000 (15:19 -0700)]
check: Make TMPDIR absolute

This avoids that ${TMPDIR} gets misinterpreted if a test script
modifies the working directory.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agomake check: Also check tests/*/group files
Bart Van Assche [Fri, 22 Jun 2018 22:19:42 +0000 (15:19 -0700)]
make check: Also check tests/*/group files

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agotests/meta/group: Fix shellcheck complaints
Bart Van Assche [Fri, 22 Jun 2018 22:19:41 +0000 (15:19 -0700)]
tests/meta/group: Fix shellcheck complaints

Avoid that shellcheck complains about unused global variables.
Avoid that shellcheck complains about using cat instead of
redirection.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agoMakefile: reenable some shellcheck warnings
Omar Sandoval [Mon, 25 Jun 2018 19:21:23 +0000 (12:21 -0700)]
Makefile: reenable some shellcheck warnings

Bart's patches fixed several shellcheck warnings which we previously
disabled. Reenable them.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocheck: Suppress a shellcheck warning about the DMESG_FILTER initialization
Bart Van Assche [Tue, 19 Jun 2018 20:23:52 +0000 (13:23 -0700)]
check: Suppress a shellcheck warning about the DMESG_FILTER initialization

Avoid that shellcheck reports the following:

check:396:2: warning: Use var=$(command) to assign output (or quote to assign string). [SC2209]

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agoMultiple tests: remove unused and undefined variables
Bart Van Assche [Tue, 19 Jun 2018 20:23:50 +0000 (13:23 -0700)]
Multiple tests: remove unused and undefined variables

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agocheck, tests/meta/012: Use array["index"] instead of array[index]
Bart Van Assche [Tue, 19 Jun 2018 20:23:47 +0000 (13:23 -0700)]
check, tests/meta/012: Use array["index"] instead of array[index]

This causes shellcheck to stop complaining about these array element
accesses.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agoAnnotate include statements in shell scripts where the source file is a variable
Bart Van Assche [Tue, 19 Jun 2018 20:23:46 +0000 (13:23 -0700)]
Annotate include statements in shell scripts where the source file is a variable

This causes shellcheck to stop complaining about these include statements.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agocommon/rc: Fix _have_tracepoint()
Bart Van Assche [Tue, 19 Jun 2018 20:23:45 +0000 (13:23 -0700)]
common/rc: Fix _have_tracepoint()

Make sure that _have_tracepoint() uses the argument passed to that
function instead of using an undefined variable.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
7 years agocheck: add command line switch to test device drivers only
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>
7 years agocheck: fix QUICK_RUN && ! TIMEOUT check
Omar Sandoval [Mon, 25 Jun 2018 18:09:18 +0000 (11:09 -0700)]
check: fix QUICK_RUN && ! TIMEOUT check

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblktests: add NVMeOF mkfs test for file-ns
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:50 +0000 (05:15 -0400)]
blktests: add NVMeOF mkfs test for file-ns

This adds a new test which formats the ns with file system on the host side
and runs fio data verification workload.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF mkfs test for bdev-ns
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:49 +0000 (05:15 -0400)]
blktests: add NVMeOF mkfs test for bdev-ns

This adds a new test which formats the ns with file system on the host side
and runs fio data verification workload.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF data verification test for file-ns
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:48 +0000 (05:15 -0400)]
blktests: add NVMeOF data verification test for file-ns

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeoF data verification test for bdev-ns
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:47 +0000 (05:15 -0400)]
blktests: add NVMeoF data verification test for bdev-ns

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add fio data verification routine
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:46 +0000 (05:15 -0400)]
blktests: add fio data verification routine

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF file-ns host creation
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:45 +0000 (05:15 -0400)]
blktests: add NVMeOF file-ns host creation

This adds a new unit test to create NVMeOF target and host.
In the test we create one file backed namespace on target.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF bdev-ns host creation
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:44 +0000 (05:15 -0400)]
blktests: add NVMeOF bdev-ns host creation

This adds a new unit test to create NVMeOF target and host.
In the test we create one block device backed namespace on target.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF file-ns target creation test
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:43 +0000 (05:15 -0400)]
blktests: add NVMeOF file-ns target creation test

This adds a new unit test to create NVMeOF target with file
backed namespace.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: add NVMeOF bdev-ns target creation test
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:42 +0000 (05:15 -0400)]
blktests: add NVMeOF bdev-ns target creation test

This adds a new unit test to create NVMeOF target with block-device
backed namespace.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblktests: common/nvme export ns-mgmt interfaces
Chaitanya Kulkarni [Mon, 11 Jun 2018 09:15:41 +0000 (05:15 -0400)]
blktests: common/nvme export ns-mgmt interfaces

This patch modifies and exports the interfaces to create and delete ns
which can be consumed by future testcases like creation/deletion of ns.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agocheck: move TMPDIR to repo directory
Omar Sandoval [Mon, 11 Jun 2018 21:54:42 +0000 (14:54 -0700)]
check: move TMPDIR to repo directory

The new NVMeOF tests require direct I/O in TMPDIR, which obviously
doesn't work on tmpfs.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonbd/002: fix shellcheck warning
Omar Sandoval [Mon, 11 Jun 2018 20:35:49 +0000 (13:35 -0700)]
nbd/002: fix shellcheck warning

tests/nbd/002:37:2: note: Consider using { cmd1; cmd2; } >> file instead of individual redirects. [SC2129]

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/008: fix shellcheck warnings
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]

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/021: test setting 'nr_requests'
Ming Lei [Sat, 2 Jun 2018 05:02:04 +0000 (13:02 +0800)]
block/021: test setting 'nr_requests'

'nr_requests' can be a bit different for 'none' scheduler,
and especially current blk-mq can only decrease this value
for 'none.'

The patch of 'blk-mq: fix read/write 'nr_requests' in case of 'none' scheduler'
has been sent out for fixing this issue.

Cc: Marco Patalano <mpatalan@redhat.com>
Cc: "Ewan D. Milne" <emilne@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
[Omar: fix description comment, clean up]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonbd/002: add a partition table test
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>
7 years agonbd: kill the nbd.pid file on cleanup
Josef Bacik [Wed, 16 May 2018 16:03:57 +0000 (12:03 -0400)]
nbd: kill the nbd.pid file on cleanup

Just in case, we don't want this to be left laying around.

Signed-off-by: Josef Bacik <jbacik@fb.com>
7 years agonbd/001: use -L for nbd-client
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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonbd: clean up common and nbd/001
Omar Sandoval [Mon, 11 Jun 2018 18:51:37 +0000 (11:51 -0700)]
nbd: clean up common and nbd/001

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/008: don't try to offline all CPUs if all CPUs are hotpluggable
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>
7 years agonvme/00[234]: clean up modules after running
Chaitanya Kulkarni [Sun, 3 Jun 2018 19:01:26 +0000 (15:01 -0400)]
nvme/00[234]: clean up modules after running

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoblock/011: don't use sysfs for device disabling
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>
7 years agonvme/001: fix filter and golden output
Johannes Thumshirn [Wed, 30 May 2018 08:22:26 +0000 (10:22 +0200)]
nvme/001: fix filter and golden output

Adjust filter and golden output to consider the following:
* Normalize white space between PID and CPU#
* Nomalize flags
* Normalize slba

Fixes #21.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: normalize spaces after PID and timestamp differently]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/020: don't pass shared_tags to null_blk
Ming Lei [Wed, 30 May 2018 05:10:38 +0000 (13:10 +0800)]
block/020: don't pass shared_tags to null_blk

The issue isn't related to shared tags, and it can be triggered if
'shared_tags' is set to 0.

Remove this so that this test can run on older kernels, and to avoid
misunderstandings.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
7 years agoblock/020: test IO req allocation
Ming Lei [Tue, 22 May 2018 11:12:49 +0000 (19:12 +0800)]
block/020: test IO req allocation

IO request allocation may hang for ever if the allocation process
migrages. This test covers the request allocation code path.

The following patch can fix this issue on linus kernel:

https://marc.info/?l=linux-block&m=152671586923185&w=2

Signed-off-by: Ming Lei <ming.lei@redhat.com>
[Omar: clarify comment and description]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoscsi_debug: settle udev before removing scsi_debug
Omar Sandoval [Thu, 24 May 2018 00:18:57 +0000 (17:18 -0700)]
scsi_debug: settle udev before removing scsi_debug

I'm still seeing "modprobe: FATAL: Module scsi_debug is in use." errors.
At least on v4.17-rc6, this gets rid of them. Fixes GitHub issue #17.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoDocumentation: document custom config setup
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."

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblktests: use consistent helper returns
Chaitanya Kulkarni [Tue, 22 May 2018 07:36:11 +0000 (03:36 -0400)]
blktests: use consistent helper returns

This is a cleanup patch which uses consistent return values for helper
functions.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoMerge pull request #20 from dublio/master
Omar Sandoval [Mon, 21 May 2018 17:20:30 +0000 (10:20 -0700)]
Merge pull request #20 from dublio/master

remove null_blk module after test finished

7 years agoblock/010: remove null_blk module after test finished
weiping zhang [Mon, 21 May 2018 14:56:38 +0000 (22:56 +0800)]
block/010: remove null_blk module after test finished

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
7 years agoblktests: use global configfs variable
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>
7 years agonvme: add test for resetting the loopback controller
Johannes Thumshirn [Thu, 3 May 2018 15:00:54 +0000 (17:00 +0200)]
nvme: add test for resetting the loopback controller

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agonvme: fix counting the target port
Johannes Thumshirn [Thu, 3 May 2018 15:00:53 +0000 (17:00 +0200)]
nvme: fix counting the target port

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agonvme: move _find_nvme_loop_dev to common code
Johannes Thumshirn [Thu, 3 May 2018 15:00:52 +0000 (17:00 +0200)]
nvme: move _find_nvme_loop_dev to common code

_find_nvme_loop_dev is quite useful for all nvme test, so move it over
to common code.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
[Omar: make variables local while we're here]
Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonvme/004: fix _find_nvme_loop_dev and cat
Omar Sandoval [Mon, 14 May 2018 19:52:38 +0000 (12:52 -0700)]
nvme/004: fix _find_nvme_loop_dev and cat

We were looking at the wrong paths. Based on a patch from Johannes
Thumshirn.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/017: update comment now that patch is upstream
Omar Sandoval [Mon, 7 May 2018 22:01:43 +0000 (15:01 -0700)]
block/017: update comment now that patch is upstream

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocommon/rc: fix _have_tracefs
Omar Sandoval [Fri, 27 Apr 2018 00:22:59 +0000 (17:22 -0700)]
common/rc: fix _have_tracefs

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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoClarify difference between QUICK and TIMED
Omar Sandoval [Fri, 27 Apr 2018 00:12:55 +0000 (17:12 -0700)]
Clarify difference between QUICK and TIMED

Add more documentation for TIMED, make sure QUICK and TIMED can't be
combined, and fix a bug where QUICK and TIMED would leak between tests.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/019: use explicit --runtime instead of overriding TIMEOUT
Omar Sandoval [Thu, 26 Apr 2018 23:47:47 +0000 (16:47 -0700)]
block/019: use explicit --runtime instead of overriding TIMEOUT

This is really a QUICK test, not a TIMED test. Use --runtime and
document that _run_fio can handle that.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoAdd surprise removal block test
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>
7 years agoblock: add a test for iostats time spent doing I/O
Omar Sandoval [Thu, 26 Apr 2018 22:36:57 +0000 (15:36 -0700)]
block: add a test for iostats time spent doing I/O

This is to test my request timestamp rework patch series.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock/017: also check /sys/block/$dev/stat
Omar Sandoval [Thu, 26 Apr 2018 22:06:08 +0000 (15:06 -0700)]
block/017: also check /sys/block/$dev/stat

This should have the same value as /proc/diskstats.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoblock: add regression test for inflight counter
Omar Sandoval [Thu, 26 Apr 2018 07:18:22 +0000 (00:18 -0700)]
block: add regression test for inflight counter

This is a basic sanity check for the inflight counter, which already
turned up a bug.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoDocument that contributors should run `make check`
Omar Sandoval [Wed, 25 Apr 2018 23:09:55 +0000 (16:09 -0700)]
Document that contributors should run `make check`

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMakefile: check for leftover TODO comments in new tests
Omar Sandoval [Wed, 25 Apr 2018 22:59:16 +0000 (15:59 -0700)]
Makefile: check for leftover TODO comments in new tests

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoMakefile: rename shellcheck target to check
Omar Sandoval [Wed, 25 Apr 2018 22:57:10 +0000 (15:57 -0700)]
Makefile: rename shellcheck target to check

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoIgnore some shellcheck warnings
Omar Sandoval [Wed, 25 Apr 2018 22:35:45 +0000 (15:35 -0700)]
Ignore some shellcheck warnings

This is the simplest way to get schedulers, and it'll always work, so
ignore the recommendation to do something fancier.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonvme: fix _create_nvmet_port
Omar Sandoval [Wed, 25 Apr 2018 22:15:43 +0000 (15:15 -0700)]
nvme: fix _create_nvmet_port

First of all, we get a shellcheck warning:

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.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agocheck: fix shellcheck warning on missing config
Omar Sandoval [Wed, 25 Apr 2018 22:08:43 +0000 (15:08 -0700)]
check: fix shellcheck warning on missing config

The config is optional, and shellcheck isn't smart enough to notice that
it's guarded by a readable test.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agoUpdate comments referring to upstreamed patches
Omar Sandoval [Wed, 25 Apr 2018 16:10:23 +0000 (09:10 -0700)]
Update comments referring to upstreamed patches

We can refer to the commit ids now that they're in mainline.

Signed-off-by: Omar Sandoval <osandov@fb.com>
7 years agonvme: add a regression test for UUID ns descriptops
Johannes Thumshirn [Tue, 24 Apr 2018 16:12:51 +0000 (10:12 -0600)]
nvme: add a regression test for UUID ns descriptops

Add a regression test for NVMe 1.3's UUID Namespace Descriptors.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agonvme: add uuid parameter to _create_nvmet_subsystem
Johannes Thumshirn [Tue, 24 Apr 2018 16:12:50 +0000 (10:12 -0600)]
nvme: add uuid parameter to _create_nvmet_subsystem

Add an optional UUID parameter to _create_nvmet_subsystem().

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agonvme: fix counting available ports
Johannes Thumshirn [Tue, 24 Apr 2018 16:12:49 +0000 (10:12 -0600)]
nvme: fix counting available ports

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
7 years agoscsi/004: set delay in nanoseconds instead of jiffies
Omar Sandoval [Tue, 24 Apr 2018 23:09:13 +0000 (16:09 -0700)]
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.

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