From: Bart Van Assche Date: Mon, 25 Mar 2024 20:05:04 +0000 (-0700) Subject: common/fio: Fix the _run_fio() return code X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4dc1b81d7539ffa89fd462a0ec9b9bdf206b0bb3;p=users%2Fsagi%2Fblktests.git common/fio: Fix the _run_fio() return code 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 --- diff --git a/common/fio b/common/fio index 1db6128..79c01c6 100644 --- a/common/fio +++ b/common/fio @@ -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