]> www.infradead.org Git - users/hch/blktests.git/commitdiff
zbd/003: Reset zones when the test device has max_active_zones limit
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 1 Oct 2020 10:15:31 +0000 (19:15 +0900)
committerOmar Sandoval <osandov@fb.com>
Thu, 22 Oct 2020 21:36:31 +0000 (14:36 -0700)
When the test target device has the max_active_zones limit, write
operations by test case zbd/003 may open zones beyond the limit and
trigger write failures.

To avoid the failure, check max_active_zones limit of the test target
device. If the limit is valid, reset all zones of the device at test
start to ensure that number of open zones does not exceed the limit.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/zbd/003

index 079be025147b2b792a9a645c1621bf03d1395a7b..1e92e8134186768425d11d3a9fe0fb50ffaedf45 100755 (executable)
@@ -30,6 +30,11 @@ test_device() {
 
        echo "Running ${TEST_NAME}"
 
+       # When the test device has max_active_zone limit, reset all zones. This
+       # ensures the write operations in this test case do not open zones
+       # beyond the limit.
+       (($(_test_dev_max_active_zones))) && blkzone reset "${TEST_DEV}"
+
        # Get physical block size as dd block size to meet zoned block device
        # requirement
        _get_sysfs_variable "${TEST_DEV}" || return $?