t/zbd: Reset all zones before test when max open zones is specified
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 1 Sep 2020 08:20:05 +0000 (17:20 +0900)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Sep 2020 14:37:43 +0000 (08:37 -0600)
commitb34eb155e4a6a05dbe43b0f7342a8118d09fdc7c
tree582aa5008c657f27209b272354d636d6621d0c9f
parent7ce7422af80205fece68de44abfdda3fae360d70
t/zbd: Reset all zones before test when max open zones is specified

When the test target device has maximum open zones limit, the zones in
test target region may not be opened up to the limit, because the zones
out of the test target region may have open zones. To ensure that the
test target zones can be opened up to the limit, reset all zones of the
test target device before the test cases with write work load starts.
Introduce the helper function prep_write() to check if all zone reset is
required and do the reset.

Also remove unnecessary reset_zone calls for test case #29 and #48. These
are no longer required by virtue of the improvement in zbd_setup_files()
to set up zones to meet max_open_zones limit.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/zbd/test-zbd-support