]> www.infradead.org Git - users/hch/blktests.git/log
users/hch/blktests.git
6 years agoConvert license headers to SPDX tags
Omar Sandoval [Fri, 5 Oct 2018 21:12:47 +0000 (14:12 -0700)]
Convert license headers to SPDX tags

This gets rid of the noisy boilerplate at the beginning of every file.

Signed-off-by: Omar Sandoval <osandov@fb.com>
6 years agoAdd NVMeOF dm-mpath tests
Bart Van Assche [Mon, 17 Sep 2018 16:59:46 +0000 (09:59 -0700)]
Add NVMeOF dm-mpath tests

Add a series of tests for the NVMeOF drivers on top of the dm-mpath
driver. These tests are similar to the tests under tests/srp. Both
tests use the dm-mpath driver for multipath and the loopback
functionality of the rdma_rxe driver. The only difference is that the
nvmeof-mp tests use the NVMeOF initiator and target drivers instead
of the SRP initiator and target drivers.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agocommon/multipath-over-rdma: Log fio exit code
Bart Van Assche [Wed, 26 Sep 2018 21:20:09 +0000 (14:20 -0700)]
common/multipath-over-rdma: Log fio exit code

Log the fio exit code to make it easier to analyze test failures.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agocommon/multipath-over-rdma: Improve robustness
Bart Van Assche [Tue, 25 Sep 2018 23:35:58 +0000 (16:35 -0700)]
common/multipath-over-rdma: Improve robustness

Detect all test setup failures and report any failures.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agocommon/multipath-over-rdma: Make teardown() shut down the client
Bart Van Assche [Tue, 25 Sep 2018 23:43:09 +0000 (16:43 -0700)]
common/multipath-over-rdma: Make teardown() shut down the client

This ensures that no multipath definitions created during a test remain
after a test has finished.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agocommon/multipath-over-rdma: Fix is_qinp_def()
Bart Van Assche [Tue, 25 Sep 2018 23:42:11 +0000 (16:42 -0700)]
common/multipath-over-rdma: Fix is_qinp_def()

Make is_qinp_def() recognize the queue_if_no_path keyword correctly.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agotests/srp/rc, common/multipath-over-rdma: Introduce setup_rdma()
Bart Van Assche [Tue, 25 Sep 2018 23:57:16 +0000 (16:57 -0700)]
tests/srp/rc, common/multipath-over-rdma: Introduce setup_rdma()

Move the code that will be reused by the NVMeOF tests into a new
function. This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agotests/srp: Move reusable code into common/multipath-over-rdma
Bart Van Assche [Thu, 27 Sep 2018 17:48:58 +0000 (10:48 -0700)]
tests/srp: Move reusable code into common/multipath-over-rdma

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agotests/srp/rc: Move the multipathd reconfiguration command into the get_bdev() loop
Bart Van Assche [Thu, 27 Sep 2018 17:50:44 +0000 (10:50 -0700)]
tests/srp/rc: Move the multipathd reconfiguration command into the get_bdev() loop

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agotests/srp/rc: Rework get_bdev()
Bart Van Assche [Wed, 26 Sep 2018 21:27:45 +0000 (14:27 -0700)]
tests/srp/rc: Rework get_bdev()

Replace the function get_bdev_uid() by the function get_bdev_path().
Call that new function every iteration instead of only once.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agotests/srp: Remove /etc/multipath.conf after a test has finished
Bart Van Assche [Mon, 17 Sep 2018 16:59:38 +0000 (09:59 -0700)]
tests/srp: Remove /etc/multipath.conf after a test has finished

Instead of removing /etc/multipath.conf before a test starts, remove it
after a test has finished. This change is needed to let the nvmeof-mp
tests run after the srp tests have been run.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agotests/srp: Remove unused code
Bart Van Assche [Mon, 17 Sep 2018 16:59:18 +0000 (09:59 -0700)]
tests/srp: Remove unused code

Remove all code that depends on $nvme != "" and also the $nvme variable
itself.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agotests/srp/012: Do not fail if not all schedulers are available
Bart Van Assche [Tue, 25 Sep 2018 23:34:43 +0000 (16:34 -0700)]
tests/srp/012: Do not fail if not all schedulers are available

Avoid that test 012 returns exit code 1 (failure) even if fio succeeded
due to an I/O scheduler not being available.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
6 years agoblock: add a test for iostats time with fast I/Os
Omar Sandoval [Sat, 22 Sep 2018 00:09:41 +0000 (17:09 -0700)]
block: add a test for iostats time with fast I/Os

This is similar to block/018, but all of the I/Os take less than a
jiffy, which tests b57e99b4b8b0 ("block: use nanosecond resolution for
iostat").

Signed-off-by: Omar Sandoval <osandov@fb.com>
6 years agoblock/018: use _init_null_blk
Omar Sandoval [Mon, 24 Sep 2018 17:24:42 +0000 (10:24 -0700)]
block/018: use _init_null_blk

Signed-off-by: Omar Sandoval <osandov@fb.com>
6 years agonvme: add NVMeOF list-subsys test for file-ns
Chaitanya Kulkarni [Tue, 18 Sep 2018 02:24:27 +0000 (19:24 -0700)]
nvme: add NVMeOF list-subsys test for file-ns

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

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

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

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

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>