From a3e8730ce42f9488c777f25c259c4d8226314b9a Mon Sep 17 00:00:00 2001 From: Shin'ichiro Kawasaki Date: Fri, 3 Jun 2022 17:31:15 +0900 Subject: [PATCH] block/007: support fallback device 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 --- tests/block/007 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/block/007 b/tests/block/007 index a8fe998..0cb0888 100755 --- a/tests/block/007 +++ b/tests/block/007 @@ -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" -- 2.49.0