Xiao Yang [Sat, 21 May 2022 12:30:20 +0000 (20:30 +0800)]
nvmeof-mp/001: Set expected count properly
The number of block devices will increase according
to the number of RDMA-capable NICs.
For example, nvmeof-mp/001 with two RDMA-capable NICs
got the following error:
-------------------------------------
Configured NVMe target driver
-count_devices(): 1 <> 1
+count_devices(): 2 <> 1
Passed
-------------------------------------
Set expected count properly by calculating the number
of RDMA-capable NICs.
Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com> Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Xiao Yang [Wed, 18 May 2022 06:44:17 +0000 (14:44 +0800)]
srp/011: Avoid $dev becoming invalid during test
$dev will become invalid when log_out has been done
and fio doesn't run yet. In this case subsequent fio
throws the following error:
-------------------------------------
From diff -u 011.out 011.out.bad
Configured SRP target driver
-Passed
From 011.full:
fio: looks like your file system does not support direct=1/buffered=0
fio: destination does not support O_DIRECT
run_fio exit code: 1
-------------------------------------
This issue happens randomly.
Try to fix the issue by holding $dev before test.
Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com> Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Shin'ichiro Kawasaki [Wed, 25 May 2022 02:04:24 +0000 (11:04 +0900)]
CONTIRIBUTING, README: transfer maintainer role
To offload blktests maintenance overhead from Omar, I volunteer to take
the blktests maintainer role. Replace Omar's name and e-mail address in
CONTRIBUTING.md with mine. Also note his original authorship in
README.md.
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Alan Adamson [Mon, 16 May 2022 22:55:39 +0000 (15:55 -0700)]
tests/nvme: add tests for error logging
Test nvme error logging by injecting errors. Kernel must have FAULT_INJECTION
and FAULT_INJECTION_DEBUG_FS configured to use error injector. Tests can be
run with or without NVME_VERBOSE_ERRORS configured.
Test for commit bd83fe6f2cd2 ("nvme: add verbose error logging").
Li Zhijian [Tue, 17 May 2022 06:22:35 +0000 (14:22 +0800)]
tests/nvme/rc: Fix possible endless loop
A failed connection will cause the later endless loop, so we should return
directly in such case.
344 _nvmet_passthru_target_connect() {
345 local trtype=$1
346 local subsys_name=$2
347
348 _nvme_connect_subsys "${trtype}" "${subsys_name}" || return
349 nsdev=$(_find_nvme_passthru_loop_dev "${subsys_name}")
350
351 # The following tests can race with the creation
352 # of the device so ensure the block device exists
353 # before continuing
354 while [ ! -b "${nsdev}" ]; do sleep 1; done <<< endless loop
355
356 echo "${nsdev}"
357 }
Shin'ichiro Kawasaki [Wed, 30 Mar 2022 01:32:15 +0000 (10:32 +0900)]
scsi/003: remove unnecessary out file
The test case scsi/003 was removed with the commit 5e803ca0ae99 ("Remove
partition rereading tests for reverted fixes"), but its out file was
left. Remove it.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Shin'ichiro Kawasaki [Wed, 30 Mar 2022 01:32:14 +0000 (10:32 +0900)]
scsi/006: skip cache types which disable read cache for SATA drives
The test case scsi/006 sets four cache types to test target SCSI
devices. Two cache types out of the four, "none" and "write back, no
read (daft)" disable read cache. However, these two types do not work
for SATA drives since SAT specification requires Disable Read Cache is
always set to zero in the caching mode page. It results in invalid
argument error and the test case failure.
To avoid the failure, skip the cache types which disable read cache if
the test devices are SATA drives. To check the device, add a helper
function _test_dev_is_sata in scsi/rc.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Shin'ichiro Kawasaki [Wed, 30 Mar 2022 01:32:12 +0000 (10:32 +0900)]
block/027, scsi/004: whitelist scsi_debug test cases for zoned mode
Define CAN_BE_ZONED=1 in block/027 and scsi/004. These test cases can be
executed in zoned mode without problem against scsi_debug devices in
zoned mode.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Shin'ichiro Kawasaki [Wed, 30 Mar 2022 01:32:11 +0000 (10:32 +0900)]
common/scsi_debug: prepare scsi_debug in zoned mode
To allow running tests using scsi_debug device with the zoned mode
disabled (current setup) as well as enabled, modify the _init_scsi_debug
helper function. When RUN_FOR_ZONED is set, specify zbc=host-managed
parameter to scsi_debug module so that the scsi_debug devices are
prepared in zoned mode.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Shin'ichiro Kawasaki [Wed, 30 Mar 2022 01:32:10 +0000 (10:32 +0900)]
zbd/008: check no stale page cache after BLKRESETZONE ioctl
Run two processes which repeat data read and BLKRESETZONE ioctl, and
check that the race does not leave stale page cache. This allows to
catch the bug fixed with the commit e5113505904e ("block: Discard page
cache of # zone reset target range").
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Alan Adamson [Thu, 31 Mar 2022 21:45:26 +0000 (14:45 -0700)]
nvme tests should use nvme_trtype when setting up passthru target
No matter what was passed in with nvme_trtype, the target was being
set up with trtype as "loop". This caused several passthru tests
to fail when testing tcp or rdma.
Shin'ichiro Kawasaki [Fri, 28 Jan 2022 09:45:12 +0000 (18:45 +0900)]
block/008: check CPU offline failure due to many IRQs
When systems have more IRQs than a single CPU can handle, the test case
block/008 fails with kernel message such as,
"CPU 31 has 111 vectors, 90 available. Cannot disable CPU"
The failure cause is that the test case offlined too many CPUs and the
left online CPU can not hold all of the required IRQ vectors. To avoid
this failure, check error message of CPU offline. If CPU offline failure
cause is IRQ vector resource shortage, do not handle it as a failure.
Also keep the actual number of CPUs which can be offlined without the
failure and use this number for the test.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Bart Van Assche [Mon, 23 Aug 2021 18:10:31 +0000 (11:10 -0700)]
tests/srp/012: Fix the displayed test status
The _have_* scripts set the SKIP_REASON variable. That variable controls
whether the status [passed] or [not run] is displayed. This patch causes
the status [passed] to be displayed instead of [not run] if legacy dm
support is not available.
Fixes: 0a2cbbd1874d ("srp and nvmeof-mp: Check whether legacy dm is supported") Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Tue, 16 Nov 2021 18:22:49 +0000 (10:22 -0800)]
Fix multiple shellcheck warnings
The latest version of shellcheck reports the following warnings:
check:307:9: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
check:505:10: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
check:506:10: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
check:539:11: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
new:102:19: note: Expansions inside ${..} need to be quoted separately, otherwise they match as patterns. [SC2295]
common/rc:272:37: warning: -ne treats this as an arithmetic expression. Use != to compare as string (or expand explicitly with $((expr))). [SC2309]
tests/block/008:65:10: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
tests/block/008:71:10: warning: Quote arguments to unset so they're not glob expanded. [SC2184]
This patch fixes the above warnings.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Ming Lei [Mon, 30 Aug 2021 02:38:44 +0000 (10:38 +0800)]
block/001: don't exit test with pending async scan
We have to run scan and delete together, otherwise pending async
may prevent scsi_debug from being unloaded, and cause failure of
'modprobe: FATAL: Module scsi_debug is in use.'
Fix the issue by always running both scan and delete together.
Fixes: f3bcd8c ("block/001: wait until device is added") Reported-by: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Ming Lei <ming.lei@redhat.com>
Jon Derrick [Tue, 24 Aug 2021 18:46:42 +0000 (12:46 -0600)]
Create test name from most recently used test number
The 'new' script can inadvertently use a test name that was removed, ex
nvme/001, which may create confusion if identically-named tests exist
among different versions. Instead, generate a test name at the numerical
tail end of the test group.
Signed-off-by: Jon Derrick <jonathan.derrick@linux.dev>
Ming Lei [Tue, 24 Aug 2021 03:17:53 +0000 (11:17 +0800)]
block/001: wait until device is added
Writing to the scan attribute of scsi host is usually one sync scan, but
devices in this sync scan may be delay added if there is concurrent
asnyc scan.
So wait until the device is added in block/001 for avoiding to fail
the test.
Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: linux-scsi@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com>
[Omar: fix quoting and simplify logic] Signed-off-by: Omar Sandoval <osandov@fb.com>
The test case zbd/007 checks write pointer mapping between a logical
device and its container device. To do so, it moves write pointers of
the container device by writing data to the container device. When the
logical device is a dm-crypt device, this test case works as expected,
but the data written to the container device is not encrypted, then it
leaves broken data on the logical, dm-crypt device. This results in I/O
errors in the following operations to the dm-crypt device.
To avoid the I/O errors, reset the test target zones of the logical
device at the test case end to wipe out the broken data.
Linux kernel 5.9 added zoned block device support to dm-crypt. To test
dm-crypt devices, modify the function _get_dev_container_and_sector().
To handle device-mapper table format difference between dm-crypt and
dm-linear/flakey, add dev_idx and off_idx local variables.
Bart Van Assche [Sun, 28 Mar 2021 23:12:09 +0000 (16:12 -0700)]
tests/block/031: Add a test for sharing a tag set across hardware queues
Support for sharing a tag set across hardware queues has been added
recently to the Linux kernel. See also the BLK_MQ_F_TAG_HCTX_SHARED flag,
Linux kernel commit 32bc15afed04 ("blk-mq: Facilitate a shared sbitmap per
tagset"; v5.10) and commit 0905053bdb5b ("null_blk: Support shared tag
bitmap"; v5.10). Add a test that triggers the shared tag set code in the
block layer core.
Cc: John Garry <john.garry@huawei.com> Cc: Don Brace<don.brace@microsemi.com> Cc: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Shellcheck seems to think that [ -z "$debug" ] is setting the debug
variable and warns:
common/multipath-over-rdma:190:11: note: Modification of debug is local (to subshell caused by pipeline). [SC2030]
common/multipath-over-rdma:606:8: note: debug was modified in a subshell. That change might be lost. [SC2031]
Damien Le Moal [Thu, 8 Apr 2021 04:39:18 +0000 (13:39 +0900)]
tests/block/014: ignore dd error messages
The kernel commit de3510e52b0a ("null_blk: fix command timeout
completion handling") fixed null_blk driver to report ETIMEDOUT errors
for IO operations failed with a timeout. This change causes the dd call
in block/014 case to print the following error message:
dd: error reading '/dev/nullb0': Connection timed out
The presence of this message result in a failure of the test case even
without a kernel crash or hang, which is what the block/014 case is
testing. Avoid this failure by ignoring dd error messages using a
redirection of dd stderr to /dev/null.
Reported-by: kernel test robot <oliver.sang@intel.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Bart Van Assche [Sun, 28 Feb 2021 22:34:03 +0000 (14:34 -0800)]
rdma: Use rdma link instead of /sys/class/infiniband/*/parent
The approach of verifying whether or not an RDMA interface is associated
with the rdma_rxe interface by looking up its parent device is deprecated
and will be removed soon from the Linux kernel. Hence this patch that uses
the rdma link command instead.
Cc: Jason Gunthorpe <jgg@nvidia.com> Cc: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Tue, 26 Jan 2021 04:45:17 +0000 (20:45 -0800)]
tests/block/030: Make this test less noisy
Since test block/030 injects blk_mq_realloc_hw_ctxs() failures, it is
expected that writes into the 'submit_queues' attribute can fail. Send
the 'nproc: write error: Cannot allocate memory' failures to $FULL instead
of stderr. See also commit a668c61064f2 ("Add a test that triggers the
blk_mq_realloc_hw_ctxs() error path").
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Yi Zhang [Sun, 24 Jan 2021 05:26:44 +0000 (13:26 +0800)]
nvmeof-mp/rc: fix nvmeof-mp failure when NVME_TARGET_PASSTHRU enabled
$ ./check nvmeof-mp/001
nvmeof-mp/001 (Log in and log out) [passed]
runtime 0.400s ... 0.457s
rmdir: failed to remove 'subsystems/nvme-test/passthru/admin_timeout': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/device_path': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/enable': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/io_timeout': Not a directory
Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
Shin'ichiro Kawasaki [Tue, 29 Dec 2020 00:44:34 +0000 (09:44 +0900)]
zbd/005: Provide max_active/open_zones limit to fio command
When test target zoned block devices have max_open_zones or
max_active_zones limit, high queue depth sequential write in the test
case zbd/005 may result in parallel writes to number of zones beyond the
limit. This causes I/O errors.
To avoid the errors, specify the limit to fio command in the test case.
Shin'ichiro Kawasaki [Tue, 29 Dec 2020 00:44:33 +0000 (09:44 +0900)]
common/rc: Check both max_active_zones and max_open_zones
Linux kernel 5.9 introduced new sysfs attributes max_active_zones and
max_open_zones for zoned block devices. Max_open_zones is the limit of
number of zones in open status. Max_active_zones is the limit of number
of zones in open or closed status. Currently, the helper function
_test_dev_max_active_zones() checks only max_active_zones, but it is not
enough. When the device has max_open_zones, check for max_active_zones
can not avoid the errors for write operations.
To avoid the error, improve the function _test_dev_max_active_zones() to
check the limits both. Rename it to _test_dev_max_open_active_zones().
When one of the limits is available for the test target device, return
it. If both limits are available, return smaller limit.
Also modify block/004 and zbd/003 to call the renamed helper function
and update comment description.
Keith Busch [Wed, 25 Nov 2020 15:49:52 +0000 (07:49 -0800)]
common/rc: confirm pcie hotplug capabilities
It turns out some PCIe slots report hotplug surprise but are not hotplug
capable. Despite the contridiction, the spec seems to allow that.
The linux pciehp driver needs hotplug capable to bind to the slot, and
the block/019 test requires hotplug surprise to handle the unannounced
link-down. Verify both bits in the slot capabilities register are set.
Yi Zhang [Thu, 26 Nov 2020 08:35:28 +0000 (16:35 +0800)]
tests/srp/rc: update the ib_srpt module name
Fix the ib_srpt module insmod failure as the module in some distros are
end with .xz, like bellow on fedora:
/lib/modules/$(uname -r)/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko.xz
Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
Logan Gunthorpe [Thu, 8 Oct 2020 16:40:19 +0000 (10:40 -0600)]
nvme/033: Simple test to create and connect to a passthru target
This tests creates and connects to a passthru controller backed
by a test NVMe namespace. It then verifies that some common fields
in id-ctrl and id-ns are the same in the target and the orginial
device.
Shin'ichiro Kawasaki [Thu, 1 Oct 2020 10:15:31 +0000 (19:15 +0900)]
zbd/003: Reset zones when the test device has max_active_zones limit
When the test target device has the max_active_zones limit, write
operations by test case zbd/003 may open zones beyond the limit and
trigger write failures.
To avoid the failure, check max_active_zones limit of the test target
device. If the limit is valid, reset all zones of the device at test
start to ensure that number of open zones does not exceed the limit.
Shin'ichiro Kawasaki [Thu, 1 Oct 2020 10:15:30 +0000 (19:15 +0900)]
block/004: Provide max_active_zones to fio command
If the test target devices is a zoned block device with max_active_zones
limit, the fio command in block/004 opens zones beyond the limit and
fails with I/O errors.
To avoid the failure, pass the limit value to fio using --max_open_zones
option. This option, which was introduced to fio together with
zonemode=zbd, keeps the number of open zones within the specified value.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Shin'ichiro Kawasaki [Thu, 1 Oct 2020 10:15:29 +0000 (19:15 +0900)]
common/rc: Add _test_dev_max_active_zones() helper function
Linux kernel 5.9 introduced a new sysfs attribute "max_active_zones". It
is an attribute of zoned block devices which indicates the limit of zones
in open or close status. To refer the attribute from test cases,
introduce the helper function _test_dev_max_active_zones(). If the
attribute is available, the function returns the attribute value.
Otherwise, returns 0 to indicate that the device does not have the limit.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Protect against running tests with the wrong transport type. Most tests
cannot have nvme_trtype=nvme and discovery tests expect the $trtype to
be written and verified in the .out file. Adding a couple of helpers
to restrict the transport types in tests.
nvme: consolidate nvme requirements based on transport type
Right now, only pci and loop have tests, hence these are
the only ones that are allowed. The user can pass an env
variable nvme_trtype and check for the necessary modules.
This allows prepares us to support other transport types.
Note that test 031 is designed to run only with nvme, hence
it overrides the environment variable to nvme_trtype=pci.
Luis Chamberlain [Wed, 29 Jul 2020 15:21:13 +0000 (15:21 +0000)]
common/multipath-over-rdma: make block scheduler directory optional
We currently fail if the following tests if the directory
/lib/modules/$(uname -r)/kernel/block does not exist. Just make
this optional. Older distributions won't have this directory.
srp/001
srp/002
srp/013
srp/014
Reviewed-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
zbd/002: Check write pointers only when zones have valid conditions
Per ZBC, ZAC and ZNS specifications, when zones have condition "read
only", "full" or "offline", the zones may not have valid write pointers.
In such a case, do not check validity of write pointers.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
zbd/005: Enable zonemode=zbd when zone capacity is less than zone size
The test case zbd/005 runs fio to issue sequential write requests with
high queue depth. This workload does not require zonemode=zbd for zones
with zone capacity same as zone length. However, when the zone has
smaller zone capacity than zone size, it issues write beyond zone
capacity and triggers write errors.
To allow fio skipping the writes beyond zone capacity, specify the option
zonemode=zbd to fio when the test target zone has zone capacity smaller
than zone size.
Also remove unused sysfs access in the test case.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
zbd/004: Check zone boundary writes using zones without zone capacity gap
The test case zbd/004 checks zone boundary write handling by block layer
using two contiguous sequential write required zones. This test is valid
when the first zone has same zone capacity as zone size. However, if the
zone has zone capacity smaller than zone size, the write in the zone
beyond zone capacity limit causes write error and the test fails.
To avoid the write error, find the two zones with first zone that has
zone capacity same as zone size. If such zones are not found, skip the
test case.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Linux kernel 5.9 zone descriptor interface added the new zone capacity
field defining the range of sectors usable within a zone. Add a check to
ensure that the zone capacity is smaller than or equal to the zone size.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Linux kernel 5.9 zone descriptor interface added the new zone capacity
field defining the range of sectors usable within a zone. The blkzone
tool recently supported the zone capacity in its report zone feature.
Modify the helper function _get_blkzone_report() to support the zone
capacity field.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Omar Sandoval [Tue, 4 Aug 2020 19:29:01 +0000 (12:29 -0700)]
Remove partition rereading tests for reverted fixes
The change that block/013 tested for was reverted in Linux kernel commit 10c70d95c0f2 ("block: remove the bd_openers checks in
blk_drop_partitions"). To quote Christoph:
"That check only catches file systems that use a single block device
(e.g. not btrfs multi-device or XFS or ext4 with log devices) and also
doesn't catch non-filesystem users. I first tried to generalized it,
but that ran into a chain of other problems. And there really isn't
much of a problem re-reading partitions on a mounted file system - it is
pointless but not actually harmful."
So, we shouldn't expect that check to come back. Let's remove the
test.
Similarly, the change that scsi/003 tested for was reverted in Linux
kernel commit 8acf608e602f ("Revert "scsi: sd: Keep disk read-only when
re-reading partition""). According to that commit, this can be fixed, so
when that happens we can reintroduce the test.
Reported-by: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Omar Sandoval <osandov@fb.com>
Shin'ichiro Kawasaki [Mon, 8 Jun 2020 02:44:58 +0000 (11:44 +0900)]
zbd/007: Add --force option to blkzone reset
The test case zbd/007 utilizes blkzone command from util-linux project
to reset zones of test target devices. Recently, blkzone was modified to
report EBUSY error when it was called to change zone status of devices
used by the system. This avoids unintended zone status change by mistake
and good for most of use cases.
However this change triggered failure of the test case zbd/007 with the
EBUSY error. The test case executes blkzone to reset zones of block devices
which the system maps to container devices such as dm-linear.
To avoid this failure, modify zbd/007 to check if blkzone supports --force
option. And if it is supported, add it to blkzone command line. This option
was introduced to blkzone to allow zone status change of devices even when
the system use them.
Omar Sandoval [Mon, 15 Jun 2020 22:40:26 +0000 (15:40 -0700)]
Fix unquoted integer shellcheck errors
Shellcheck apparently got stricter about SC2086 ("Double quote to
prevent globbing and word splitting") because now it is warning about
unquoted integers.
Omar Sandoval [Mon, 15 Jun 2020 22:33:21 +0000 (15:33 -0700)]
travis: update shellcheck URL
The latest build failed with this error:
```
You are downloading ShellCheck from an outdated URL!
Please update to the new URL:
https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz
For more information, see:
https://github.com/koalaman/shellcheck/issues/1871
PS: Sorry for breaking your build :(
```
Bart Van Assche [Sat, 16 May 2020 00:00:45 +0000 (17:00 -0700)]
tests/srp/rc: Make the SRP tests pass against kernel v5.7
Linux kernel commit 569334014370 ("scsi: core: Delete scsi_use_blk_mq")
removed the use_blk_mq sysfs attribute. Hence only write into the
use_blk_mq sysfs attribute if it exists.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Klaus Jensen [Wed, 22 Apr 2020 07:44:36 +0000 (09:44 +0200)]
Fix unintentional skipping of tests
cd11d001fe86 ("Support skipping tests from test{,_device}()") breaks a
good handful of tests.
For example, block/005 uses _test_dev_is_rotational to check if the
device is rotational and uses the result to size up the fio run. As a
side-effect, _test_dev_is_rotational also sets SKIP_REASON, which (since
commit cd11d001fe86) causes the test to print out a "[not run]" even
through the test actually ran successfully.
Fix this by renaming the existing helpers to _require_foo (e.g. a
_require_test_dev_is_rotational) and add the non-_require variant where
needed.
Fixes: cd11d001fe86 ("Support skipping tests from test{,_device}()") Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
[Omar: simplify new _test_dev helpers] Signed-off-by: Omar Sandoval <osandov@fb.com>
Bart Van Assche [Sat, 28 Mar 2020 18:22:51 +0000 (11:22 -0700)]
Add a test that triggers the blk_mq_realloc_hw_ctxs() error path
Add a test that triggers the code touched by commit d0930bb8f46b ("blk-mq:
Fix a recently introduced regression in blk_mq_realloc_hw_ctxs()"). This
test only runs if a recently added fault injection feature is available,
namely commit 596444e75705 ("null_blk: Add support for init_hctx() fault
injection").
Cc: Ming Lei <ming.lei@redhat.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Sat, 28 Mar 2020 18:22:48 +0000 (11:22 -0700)]
Make _exit_null_blk remove all null_blk device instances
Instead of making every test remove null_blk device instances before calling
_exit_null_blk(), move the null_blk device instance removal code into
_exit_null_blk().
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Omar Sandoval [Thu, 5 Mar 2020 01:21:51 +0000 (17:21 -0800)]
Support skipping tests from test{,_device}()
Most of the time, test requirements can be checked without much setup.
However, in some cases, it's not possible to know if the test can be run
until we're halfway through the test. Allow setting SKIP_REASON from the
test function. This should only be used as a last resort.