t/zbd: test write zone accounting of almost full zones
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 8 Jun 2023 07:06:07 +0000 (16:06 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 8 Jun 2023 18:39:07 +0000 (14:39 -0400)
Recent commit fixed the bug of the write zone accounting for almost full
zones. Add a test case which confirms the fix.

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

index 865779522675aa5ab7cfb919d3878298b17e12b7..cdaa0574820917469cc53598d3c288d977e62610 100755 (executable)
@@ -1368,6 +1368,27 @@ test63() {
        check_reset_count -eq 3 || return $?
 }
 
+# Test write zone accounting handles almost full zones correctly. Prepare an
+# almost full, but not full zone. Write to the zone with verify using larger
+# block size. Then confirm fio does not report write zone accounting failure.
+test64() {
+       local bs cap
+
+       [ -n "$is_zbd" ] && reset_zone "$dev" -1
+
+       bs=$((zone_size / 8))
+       cap=$(total_zone_capacity 1 $((first_sequential_zone_sector*512)) $dev)
+       run_fio_on_seq "$(ioengine "psync")" --rw=write --bs="$bs" \
+                      --size=$((zone_size)) \
+                      --io_size=$((cap - bs)) \
+                      >> "${logfile}.${test_number}" 2>&1 || return $?
+
+       bs=$((zone_size / 2))
+       run_fio_on_seq "$(ioengine "psync")" --rw=write --bs="$bs" \
+                      --size=$((zone_size)) --do_verify=1 --verify=md5 \
+                      >> "${logfile}.${test_number}" 2>&1 || return $?
+}
+
 SECONDS=0
 tests=()
 dynamic_analyzer=()