diff mbox series

[blktests,3/3] zbd/003: Reset zones when the test device has max_active_zones limit

Message ID 20201001101531.333879-4-shinichiro.kawasaki@wdc.com (mailing list archive)
State New, archived
Headers show
Series Support max_active_zones | expand

Commit Message

Shinichiro Kawasaki Oct. 1, 2020, 10:15 a.m. UTC
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 | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/tests/zbd/003 b/tests/zbd/003
index 079be02..1e92e81 100755
--- a/tests/zbd/003
+++ b/tests/zbd/003
@@ -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 $?