Skip to content

Commit

Permalink
common/fio: Fix the _run_fio() return code
Browse files Browse the repository at this point in the history
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: 3891768 ("blktests: add fio data verification routine")
Signed-off-by: Bart Van Assche <[email protected]>
  • Loading branch information
bvanassche committed Mar 25, 2024
1 parent 607513e commit 30b3ae2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions common/fio
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30b3ae2

Please sign in to comment.