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

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

 



From: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>

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 <shinichiro.kawasaki@xxxxxxx>
---
 common/rc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/common/rc b/common/rc
index 153a323..999590d 100644
--- a/common/rc
+++ b/common/rc
@@ -214,3 +214,12 @@ _test_dev_in_hotplug_slot() {
 _filter_xfs_io_error() {
 	sed -e 's/^\(.*\)64\(: .*$\)/\1\2/'
 }
+
+_test_dev_is_zoned() {
+	local zoned_file="${TEST_DEV_SYSFS}/queue/zoned"
+	if grep -q -e "none" "${zoned_file}" ; then
+		SKIP_REASON="${TEST_DEV} is not a zoned block device"
+		return 1
+	fi
+	return 0
+}
-- 
2.20.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