diff mbox series

[blktests,04/14] block/004: Adjust fio conditions for zoned block device

Message ID 20190109013542.23686-5-damien.lemoal@wdc.com (mailing list archive)
State New, archived
Headers show
Series Implement zoned block device support | expand

Commit Message

Damien Le Moal Jan. 9, 2019, 1:35 a.m. UTC
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

For a random write pattern to a zoned block device, fio requires --direct=1
and --zonemode=zbd options as well as deadline I/O scheduler to be
specified. Specify these options and set the I/O scheduler if the target
device is a zoned block device.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 tests/block/004 | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/block/004 b/tests/block/004
index 4c14c4b..d9b8209 100755
--- a/tests/block/004
+++ b/tests/block/004
@@ -16,10 +16,20 @@  requires() {
 test_device() {
 	echo "Running ${TEST_NAME}"
 
+	local directio=""
+	local zbdmode=""
+
+	if _test_dev_is_zoned; then
+		directio="--direct=1"
+		zbdmode="--zonemode=zbd"
+		set_scheduler "$(basename "$(readlink -f "${TEST_DEV}")")" \
+			      deadline
+	fi
+
 	FIO_PERF_FIELDS=("write iops")
 	_fio_perf --bs=4k --rw=randwrite --norandommap --fsync=1 \
 		--number_ios=256 --numjobs=64 --name=flushes \
-		--filename="$TEST_DEV"
+		${directio} ${zbdmode} --filename="$TEST_DEV"
 
 	echo "Test complete"
 }