t/zbd: Add test case to check zonecapacity option
authorHans Holmberg <hans.holmberg@wdc.com>
Fri, 17 Jul 2020 09:36:37 +0000 (18:36 +0900)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Jul 2020 15:17:37 +0000 (09:17 -0600)
Add test case #49 which confirms the newly introduced zonecapacity
option is working as expected with regular block devices.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/zbd/test-zbd-support

index 31718c95b4e11915e7e984a00d7503d10c5e3279..e53a20c5cd5d3a1a7e81df22b7b7c0369c8d0d9b 100755 (executable)
@@ -839,6 +839,26 @@ test48() {
            >> "${logfile}.${test_number}" 2>&1 || return $?
 }
 
+# Check if fio handles --zonecapacity on a normal block device correctly
+test49() {
+
+    if [ -n "$is_zbd" ]; then
+       echo "$dev is not a regular block device" \
+            >>"${logfile}.${test_number}"
+       return 0
+    fi
+
+    size=$((2 * zone_size))
+    capacity=$((zone_size * 3 / 4))
+
+    run_one_fio_job "$(ioengine "psync")" --rw=write \
+                   --zonemode=zbd --zonesize="${zone_size}" \
+                   --zonecapacity=${capacity} \
+                   --verify=md5  --size=${size} >>"${logfile}.${test_number}" 2>&1 ||
+       return $?
+    check_read $((capacity * 2)) || return $?
+}
+
 tests=()
 dynamic_analyzer=()
 reset_all_zones=