btrfs-progs: tests: do not log output of run_mayfail to terminal
authorDavid Sterba <dsterba@suse.com>
Mon, 26 Oct 2015 18:51:10 +0000 (19:51 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 2 Nov 2015 08:35:08 +0000 (09:35 +0100)
No need to log expected failures to the terminal, the results file is
fine; pass the return value of the command.

Signed-off-by: David Sterba <dsterba@suse.com>
tests/common

index ea9a569..6178048 100644 (file)
@@ -51,9 +51,13 @@ run_mayfail()
        echo "############### $@" >> $RESULTS 2>&1
        if [ "$TEST_LOG" = 'tty' ]; then echo "CMD(mayfail): $@" > /dev/tty; fi
        if [ "$1" = 'root_helper' ]; then
-               "$@" >> $RESULTS 2>&1 || _log "failed (ignored): $@"
+               "$@" >> $RESULTS 2>&1
        else
-               $INSTRUMENT "$@" >> $RESULTS 2>&1 || _log "failed (ignored): $@"
+               $INSTRUMENT "$@" >> $RESULTS 2>&1
+       fi
+       if [ $? != 0 ]; then
+               echo "failed (ignored): $@" >> $RESULTS
+               return 1
        fi
 }