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>
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")