[PATCH blktests] block/007: support fallback device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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.36.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux