summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-10-03 17:55:49 +0200
committerDavid Sterba <dsterba@suse.com>2016-10-05 12:39:01 +0200
commitb6bf79eb962247ecabdd079cf266ec7173a6345a (patch)
treedeebea67a2b15f636d9da9ca4320cda72d3f3a96 /tests
parenta5ac95415366113462ff68cdff9ac9047159c3c7 (diff)
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 <dsterba@suse.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/common12
1 files changed, 9 insertions, 3 deletions
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
}