diff --git a/main.pm b/main.pm index 2bfcb0ca..0d19e884 100644 --- a/main.pm +++ b/main.pm @@ -204,6 +204,11 @@ sub load_postinstall_tests() { autotest::loadtest "tests/uefi_postinstall.pm"; } + # console avc / crash check (desktops have specific tests for this) + if (!get_var("DESKTOP")) { + autotest::loadtest "tests/_console_avc_crash.pm"; + } + # generic post-install test load if (get_var("POSTINSTALL")) { my @pis = split(/ /, get_var("POSTINSTALL")); diff --git a/tests/_console_avc_crash.pm b/tests/_console_avc_crash.pm new file mode 100644 index 00000000..b0b31634 --- /dev/null +++ b/tests/_console_avc_crash.pm @@ -0,0 +1,24 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + my $self = shift; + $self->root_console(tty=>3); + # 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/ }; +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return {}; +} + +1; + +# vim: set sw=4 et: