]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
check: add zoned sysfs node checking in _test_dev_is_zoned
authorYi Zhang <yi.zhang@redhat.com>
Fri, 22 Mar 2019 08:12:28 +0000 (16:12 +0800)
committerOmar Sandoval <osandov@fb.com>
Mon, 25 Mar 2019 17:40:27 +0000 (10:40 -0700)
Some kernel may not have zoned sysfs node, e.g. RHEL7, checking if
it exists first in _test_dev_is_zoned.

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
[Omar: wrap line]
Signed-off-by: Omar Sandoval <osandov@fb.com>
check

diff --git a/check b/check
index f0ca3825ee62dfb2ce7cf4fd12035758520e1cd8..a623892319404ae6c32e8abb2c7e3adc14003e8b 100755 (executable)
--- a/check
+++ b/check
@@ -405,7 +405,8 @@ _call_test() {
 }
 
 _test_dev_is_zoned() {
-       if grep -qe "none" "${TEST_DEV_SYSFS}/queue/zoned" ; then
+       if [[ ! -f "${TEST_DEV_SYSFS}/queue/zoned" ]] ||
+             grep -q none "${TEST_DEV_SYSFS}/queue/zoned"; then
                SKIP_REASON="${TEST_DEV} is not a zoned block device"
                return 1
        fi