]> www.infradead.org Git - users/hch/blktests.git/commitdiff
block/007: support fallback device
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 3 Jun 2022 08:31:15 +0000 (17:31 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 4 Jul 2022 07:29:55 +0000 (16:29 +0900)
The test case block/007 requires TEST_DEVS which support IO polling.
To allow test case executed without such devices, fallback to a null_blk
device when TEST_DEVS is empty.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/block/007

index a8fe9985ed004e296e3c7ea43fd7d14b079cc171..0cb0888c8fbcafa58e3af87c70bc1bbf709da896 100755 (executable)
@@ -6,6 +6,7 @@
 
 . tests/block/rc
 . common/iopoll
+. common/null_blk
 
 DESCRIPTION="test classic and hybrid IO polling"
 TIMED=1
@@ -19,6 +20,17 @@ device_requires() {
                _require_test_dev_supports_io_poll_delay
 }
 
+fallback_device() {
+       if ! _configure_null_blk nullb1 power=1; then
+               return 1
+       fi
+       echo /dev/nullb1
+}
+
+cleanup_fallback_device() {
+       _exit_null_blk
+}
+
 run_fio_job() {
        if _test_dev_is_rotational; then
                size="32m"