Add a non-fatal console AVC / crash post-install check

Summary:
This has all console tests check for AVCs (with ausearch) and
crashes (with coredumpctl) at post-install stage. It's non-
fatal as this doesn't really mean the test failed, but we want
to spot when there are unexpected AVCs or crashes.

Test Plan:
Run some console tests, check it works right. I only
tested with one test, since so many are broken on Rawhide ATM

Reviewers: jskladan, garretraziel

Reviewed By: garretraziel

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D1066
This commit is contained in:
Adam Williamson 2016-12-08 08:58:29 -08:00
parent 85d9fa4bf6
commit 7687a3aa34
2 changed files with 29 additions and 0 deletions

View File

@ -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"));

View File

@ -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/<no matches>/ };
# 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: