[PATCH blktests 4/6] common/rc: introduce _require_test_dev_sysfs

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

 



The test case block/005 requires TEST_DEV to have the queue/scheduler
sysfs attribute. However, kernel no longer provides the attribute since
version 6.5. Add the helper function _require_test_dev_sysfs to check
the requirement.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
---
 common/rc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/rc b/common/rc
index 52d1602..caaa49c 100644
--- a/common/rc
+++ b/common/rc
@@ -256,6 +256,14 @@ _test_dev_is_rotational() {
 	[[ $(cat "${TEST_DEV_SYSFS}/queue/rotational") -ne 0 ]]
 }
 
+_require_test_dev_sysfs() {
+	if [[ ! -e "${TEST_DEV_SYSFS}/$1" ]]; then
+		SKIP_REASONS+=("${TEST_DEV} does not have sysfs attribute $1")
+		return 1
+	fi
+	return 0
+}
+
 _require_test_dev_is_rotational() {
 	if ! _test_dev_is_rotational; then
 		SKIP_REASONS+=("$TEST_DEV is not rotational")
-- 
2.40.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