From ee283b14112fde5318dc5d19269558b795d0a6e0 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 10 Apr 2017 15:44:13 -0700 Subject: [PATCH] Tweak _console_avc_crash so we get soft failures We do want soft failures (but not hard) when _console_avc_crash fails. So let's tweak it to ensure that's what happens. --- tests/_console_avc_crash.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/_console_avc_crash.pm b/tests/_console_avc_crash.pm index 62cb1f4f..5eacbd29 100644 --- a/tests/_console_avc_crash.pm +++ b/tests/_console_avc_crash.pm @@ -13,14 +13,15 @@ sub run { # anything at a console. the more advanced upstream 'console' # handling may help us here if we switch to it console_loadkeys_us; - # check there are no AVCs. We use ! because this returns 1 - validate_script_output '! ausearch -m avc -ts yesterday 2>&1', sub { $_ =~ m// }; - # check there are no crashes - validate_script_output '! coredumpctl list 2>&1', sub { $_ =~ m/No coredumps found/ }; + # check there are no AVCs. We expect an error here: if we don't + # get an error, it means there *are* AVCs. + record_soft_failure "AVC(s) found" unless (script_run 'ausearch -m avc -ts yesterday 2>&1'); + # check there are no crashes. Similarly expect an error here + record_soft_failure "Crash(es) found" unless (script_run 'coredumpctl list 2>&1'); } sub test_flags { - return { 'ignore_failure' => 1 }; + return {}; } 1;