Thread (24 messages) 24 messages, 3 authors, 2019-01-17
STALE2731d
Revisions (3)
  1. v2 current
  2. v3 [diff vs current]
  3. v4 [diff vs current]

[PATCH blktests v2 02/16] common: Introduce _test_dev_is_zoned() helper function

From: Shin'ichiro Kawasaki <hidden>
Date: 2019-01-10 09:37:40
Subsystem: the rest · Maintainer: Linus Torvalds

Introduce the helper function _test_dev_is_zoned() to check if a test
device is a zoned block device. Using this function, test scripts can
adjust test conditions based on the device zone model.
This function can also be used within test scripts implementation of the
device_requires() function to ensure that the test is run only for zoned
block device or only for non-zoned block device.

Signed-off-by: Shin'ichiro Kawasaki <redacted>
---
 common/rc | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/common/rc b/common/rc
index 153a323..e628f96 100644
--- a/common/rc
+++ b/common/rc
@@ -214,3 +214,11 @@ _test_dev_in_hotplug_slot() {
 _filter_xfs_io_error() {
 	sed -e 's/^\(.*\)64\(: .*$\)/\1\2/'
 }
+
+_test_dev_is_zoned() {
+	if grep -qe "none" "${TEST_DEV_SYSFS}/queue/zoned" ; then
+		SKIP_REASON="${TEST_DEV} is not a zoned block device"
+		return 1
+	fi
+	return 0
+}
-- 
2.20.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help