t/zbd: fix fio failure check and SG node failure in test case 31
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 19 Jul 2023 10:57:53 +0000 (19:57 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 20 Jul 2023 13:52:37 +0000 (09:52 -0400)
The test case 31 runs fio twice but the failure of the first fio run was
not checked. This allowed the test case pass even with wrong
max_open_zones value. To fix this, check exit code of the fio run.

Also, the first fio run fails when the test target devices are SG nodes,
since libzbc I/O engine is not used. To fix this, call the ioengine()
helper function which adjusts I/O engine for each device.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20230719105756.553146-11-shinichiro.kawasaki@wdc.com
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
t/zbd/test-zbd-support

index 1d1d389baf093efb1fe1fa4c867d4f01a607c25d..71cb18bb0026f3019ea15ae124dc908391610fb3 100755 (executable)
@@ -794,9 +794,10 @@ test31() {
     opts=("--name=$dev" "--filename=$dev" "--rw=write" "--bs=${bs}")
     opts+=("--offset=$off" "--size=$((inc * nz))" "--io_size=$((bs * nz))")
     opts+=("--zonemode=strided" "--zonesize=${bs}" "--zonerange=${inc}")
-    opts+=("--direct=1")
+    opts+=("--direct=1" "$(ioengine "psync")")
     echo "fio ${opts[@]}" >> "${logfile}.${test_number}"
-    "$(dirname "$0")/../../fio" "${opts[@]}" >> "${logfile}.${test_number}" 2>&1
+    "$(dirname "$0")/../../fio" "${opts[@]}" >> "${logfile}.${test_number}" \
+                               2>&1 || return $?
 
     # Next, run the test.
     opts=("--name=$dev" "--filename=$dev" "--offset=$off" "--size=$size")