From b6bf79eb962247ecabdd079cf266ec7173a6345a Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 3 Oct 2016 17:55:49 +0200 Subject: btrfs-progs: tests: don't treat segfault as ignorable error Some fuzzed images cause various tools to crash but the mayfail helper would not recognize that. We don't mind if the utility failes but it must not crash. Signed-off-by: David Sterba --- tests/common | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/common b/tests/common index c50b661f..d965c12c 100644 --- a/tests/common +++ b/tests/common @@ -48,6 +48,8 @@ run_check_stdout() # same as run_check but does not fail the test, output is logged run_mayfail() { + local ret + echo "############### $@" >> $RESULTS 2>&1 if [ "$TEST_LOG" = 'tty' ]; then echo "CMD(mayfail): $@" > /dev/tty; fi if [ "$1" = 'root_helper' ]; then @@ -55,9 +57,13 @@ run_mayfail() else $INSTRUMENT "$@" >> $RESULTS 2>&1 fi - if [ $? != 0 ]; then - echo "failed (ignored): $@" >> $RESULTS - return 1 + ret=$? + if [ $ret != 0 ]; then + echo "failed (ignored, ret=$ret): $@" >> $RESULTS + if [ $ret == 139 ]; then + _fail "mayfail: returned code 139 (SEGFAULT), not ignored" + fi + return $ret fi } -- cgit v1.2.3