]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
common/fio: Fix the _run_fio() return code
authorBart Van Assche <bvanassche@acm.org>
Mon, 25 Mar 2024 20:05:04 +0000 (13:05 -0700)
committerBart Van Assche <bvanassche@acm.org>
Mon, 8 Apr 2024 20:16:10 +0000 (13:16 -0700)
Make _run_fio() return the fio exit code such that tests can use that
exit code to verify whether or not a fio run completed successfully.

Fixes: 3891768d9d6b ("blktests: add fio data verification routine")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
common/fio

index 1db6128be63279af9910e1bf9bb626351dd5a299..79c01c6008a52b4f85643378621413ce08f634d4 100644 (file)
@@ -180,10 +180,13 @@ _run_fio() {
                args+=("--runtime=$TIMEOUT")
        fi
 
-       if ! fio "${args[@]}" "$@"; then
-               echo "fio exited with status $?"
+       fio "${args[@]}" "$@"
+       local rc=$?
+       if [ $rc != 0 ]; then
+               echo "fio exited with status $rc"
                cat "$TMPDIR"/fio_perf
        fi
+       return $rc
 }
 
 # Wrapper around _run_fio used if you need some I/O but don't really care much