t/zbd: fix test case #33 for block size unaligned to zone size
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 14 Nov 2022 02:13:04 +0000 (11:13 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Fri, 18 Nov 2022 14:55:16 +0000 (09:55 -0500)
commit268b19c666a477fcca7088ff5564c7a23fc2180b
tree57391ee1e8ef98d615ac6712581b5f5ba224524e
parent6e2da06ae86f4ef32a75ddcfe1087fc41c56d2f6
t/zbd: fix test case #33 for block size unaligned to zone size

Recent fix of zonemode=zbd support for block size unaligned to zone size
unveiled that the test case #33 has two issues.

First issue is test preparation. Before the fix, write was done to only
to the first zone due to a bug in zone selection which happens when
block size is not a divisor of zone size. Then, status of second zone
did not affect. After the fix, write count to the zones may vary if the
second zone has almost full status since the zone is skipped from write
target. Fix this by resetting the write target zones.

Second issue is expected written data size. The test case checks that
the written data size is larger than the io_size option value. This
expectation was fine before the fix because data write was repeated in
do_io() and the limit was checked with io_issue_bytes_exceeded(),
which triggers loop break when written data is larger than io_size.
However, after the fix, the limit is checked with keep_running() in
thread_main(). According to code and block comment in keep_running(),
fio job terminates even when written data size is smaller than io_size
if the gap is smaller than maximum IO size. Then the expected written
data size is the largest multiple of block size smaller than or equal to
the io_size. This io_size check change resulted in the test case
failure. Avoid the failure by fixing the expected written data size
calculation.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
t/zbd/test-zbd-support