]> www.infradead.org Git - users/hch/blktests.git/commit
config: Introduce RUN_ZONED_TESTS variable and CAN_BE_ZONED flag
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 28 Jan 2019 13:14:44 +0000 (22:14 +0900)
committerOmar Sandoval <osandov@fb.com>
Tue, 5 Feb 2019 18:40:34 +0000 (10:40 -0800)
commite840e1537dc62dabfe9d59e5288b9318a2d7c50b
tree37870267e08de634ec5ea614bc44b3c2051ae70c
parenta58b9745fa4604b6aa9c2694dd25ddb39f46d0d8
config: Introduce RUN_ZONED_TESTS variable and CAN_BE_ZONED flag

To allow running tests using a null_blk device with the zoned mode
disabled (current setup) as well as enabled, introduce the config
the RUN_ZONED_TESTS config variable and the per-test flag CAN_BE_ZONED.

RUN_ZONED_TESTS=1 indicates that tests run against null_blk will be
executed twice, first with null_blk as a regular block device
(RUN_FOR_ZONED=0) and a second time with null_blk set as a zoned block
device (RUN_FOR_ZONED=1). This applies only to tests cases that have the
variable CAN_BE_ZONED set to 1, indicating that the test case applies to
zoned block devices. If CAN_BE_ZONED is not defined by a test case, the
test is executed only with the regular null_blk device.

_init_null_blk is modified to prepare null_blk as a zoned blocked device
if RUN_FOR_ZONED is set and as a regular block device otherwise. To avoid
"modprobe -r null_blk" failures, rmdir calls on all sysfs nullbX
directories is added.

When a zoned block device is specified in TEST_DEVS, failures of test
cases that do not set CAN_BE_ZONED are avoided by automatically skipping
the test. The new helper function _test_dev_is_zoned() is introduced to
implement this.

The use of the RUN_ZONED_TESTS variable requires that the kernel be
compiled with CONFIG_BLK_DEV_ZONED enabled.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Documentation/running-tests.md
check
common/null_blk
common/shellcheck
new