]> www.infradead.org Git - users/hch/blktests.git/commitdiff
common/multipath-over-rdma: Log fio exit code
authorBart Van Assche <bvanassche@acm.org>
Wed, 26 Sep 2018 21:20:09 +0000 (14:20 -0700)
committerBart Van Assche <bvanassche@acm.org>
Thu, 27 Sep 2018 18:14:45 +0000 (11:14 -0700)
Log the fio exit code to make it easier to analyze test failures.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
common/multipath-over-rdma

index 50cc74db190b1d86cc960d02b621735aecc62a17..e2eaab5ed7083dfc18e8352ff400036c762a5ed1 100644 (file)
@@ -516,7 +516,7 @@ test_fio_opt() {
 }
 
 run_fio() {
-       local a args avail_kb="" bd="" d="" j opt output
+       local a args avail_kb="" bd="" d="" j opt output rc
 
        args=("$@")
        j=1
@@ -553,11 +553,15 @@ run_fio() {
        done
        mkdir -p "${fio_aux_path}"
        echo "fio ${args[*]}" >>"$FULL"
-       fio "${args[@]}" 2>&1 || return $?
-       if [ -n "$output" ]; then
+       fio "${args[@]}" 2>&1
+       rc=$?
+       if [ $rc = 0 ] && [ -n "$output" ]; then
                # Return exit code 1 if no I/O has been performed.
                grep -q ', io=[0-9].*, run=[0-9]' "$output"
+               rc=$?
        fi
+       echo "run_fio exit code: $rc" >>"$FULL"
+       return $rc
 }
 
 # Configure two null_blk instances.