diff mbox series

[blktests,v4,02/12] common: Introduce _have_fio_zbd_zonemode() helper function

Message ID 20190128131455.31997-3-shinichiro.kawasaki@wdc.com (mailing list archive)
State New, archived
Headers show
Series Implement zoned block device support | expand

Commit Message

Shinichiro Kawasaki Jan. 28, 2019, 1:14 p.m. UTC
Fio zbd zone mode is necessary for zoned block devices. Introduce the
helper function _have_fio_zbd_zonemode() to check that the installed
fio version supports the option --zonemode=zbd.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 common/fio | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/common/fio b/common/fio
index e407088..4c771fc 100644
--- a/common/fio
+++ b/common/fio
@@ -17,6 +17,15 @@  _have_fio() {
 	return 0
 }
 
+_have_fio_zbd_zonemode() {
+	_have_fio || return $?
+	if ! fio --cmdhelp=zonemode 2>&1 | grep -q zbd ; then
+		SKIP_REASON="Fio version too old (does not support --zonemode=zbd)"
+		return 1
+	fi
+	return 0
+}
+
 declare -A FIO_TERSE_FIELDS
 FIO_TERSE_FIELDS=(
 	# Read status