mirror of
https://github.com/kdave/btrfs-progs
synced 2025-03-11 05:07:51 +00:00
btrfs-progs: test: fix run_check_stdout() call _fail()
run_check_stdout() uses "... | tee ... || _fail". However, since tee won't fail, _fail() is not called even if first command fails. Fix this by checking PIPESTATUS in the end. Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
dbe96ecd3f
commit
02e9bb9f23
@ -154,9 +154,12 @@ run_check_stdout()
|
||||
echo "############### $@" >> "$RESULTS" 2>&1
|
||||
if [[ $TEST_LOG =~ tty ]]; then echo "CMD(stdout): $@" > /dev/tty; fi
|
||||
if [ "$1" = 'root_helper' ]; then
|
||||
"$@" 2>&1 | tee -a "$RESULTS" || _fail "failed: $@"
|
||||
"$@" 2>&1 | tee -a "$RESULTS"
|
||||
else
|
||||
$INSTRUMENT "$@" 2>&1 | tee -a "$RESULTS" || _fail "failed: $@"
|
||||
$INSTRUMENT "$@" 2>&1 | tee -a "$RESULTS"
|
||||
fi
|
||||
if [ ${PIPESTATUS[0]} -ne 0 ]; then
|
||||
_fail "failed: $@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user