From: Shin'ichiro Kawasaki Date: Tue, 5 Mar 2019 05:24:46 +0000 (+0900) Subject: common: Add _test_dev_is_partition() helper function X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f35b631c62d345367d93dc3256d89ccf887025f6;p=users%2Fsagi%2Fblktests.git common: Add _test_dev_is_partition() helper function To control test conditions unique for partition devices, introduce the _test_dev_is_partition() helper function. Refer TEST_DEV_PART_SYSFS variable to tell if the TEST_DEV is a partition device or not. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Omar Sandoval --- diff --git a/common/rc b/common/rc index 153a323..0c354a2 100644 --- a/common/rc +++ b/common/rc @@ -208,6 +208,14 @@ _test_dev_in_hotplug_slot() { return 0 } +_test_dev_is_partition() { + if [[ -z ${TEST_DEV_PART_SYSFS} ]]; then + SKIP_REASON="${TEST_DEV} is not a partition device" + return 1 + fi + return 0 +} + # Older versions of xfs_io use pwrite64 and such, so the error messages won't # match current versions of xfs_io. See c52086226bc6 ("filter: xfs_io output # has dropped "64" from error messages") in xfstests.