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>
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 $?