t/zbd: fix max_open_zones determination in tests
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Sun, 16 Oct 2022 01:43:08 +0000 (10:43 +0900)
committerJens Axboe <axboe@kernel.dk>
Sun, 16 Oct 2022 23:05:03 +0000 (17:05 -0600)
The test script erroneously falls back to using libzbc for finding out
the max_open_zones setting if the device being tested is not a SCSI
device. This causes false positives if libzbc is not installed in the
test system. To fix, unless the option to use libzbc is explicitly set,
set this value to 0 for non-SCSI devices to let fio find the actual
max_open_zones value using the system block interface.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Link: https://lore.kernel.org/r/20221016014309.53682-1-dmitry.fomichev@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/zbd/functions

index 7cff18fd18c0b50ae7ccf961fa665402d258ca71..812320f529ed77acf11a46e921359aad75d8ebba 100644 (file)
@@ -230,9 +230,11 @@ max_open_zones() {
                    echo ${max_nr_open_zones}
                }
        fi
-    else
+    elif [ -n "${use_libzbc}" ]; then
        ${zbc_report_zones} "$dev" |
            sed -n 's/^[[:blank:]]*Maximum number of open sequential write required zones:[[:blank:]]*//p'
+    else
+       echo 0
     fi
 }