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>
# 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
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
}