1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-24 14:53:09 +00:00
os-autoinst-distri-fedora/tests/base_services_start.pm
Adam Williamson 9eef80a85a base_services_start: convert mcelog exception to hcn-init
We've had this 'exception' for mcelog.service failing in here for
years. Looking into it, it seems to now be fixed:
https://bugzilla.redhat.com/show_bug.cgi?id=1526725
and hasn't happened in our official instances for years (I guess
because they're all Intel boxes). However, we have a similar case
on ppc64le with hcn-init.service failing spuriously:
https://bugzilla.redhat.com/show_bug.cgi?id=1894654
so I'm just converting it into a workaround for that instead. We
could wire this up to be more sophisticated, with some kind of
array or hash of services that are allowed to fail and more
complex checking code, but let's not bother unless/until it's
necessary.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-11-04 09:34:12 -08:00

40 lines
1.3 KiB
Perl

use base "installedtest";
use strict;
use testapi;
sub run {
my $self = shift;
# switch to TTY3 for both, graphical and console tests
$self->root_console(tty=>3);
# "Job foo.service/start deleted to break ordering cycle"-type
# message in the log indicates a service got taken out of the boot
# process to resolve some kind of dependency loop, see e.g.
# https://bugzilla.redhat.com/show_bug.cgi?id=1600823
assert_script_run "! journalctl -b | grep 'deleted to break ordering'";
# dump the systemctl output
assert_script_run "systemctl --failed | tee /tmp/failed.txt";
# if we have 0 failed services, we're good
my $ret = script_run "grep '0 loaded units' /tmp/failed.txt";
return if $ret == 0;
# if only hcn-init failed, that's a soft fail, see:
# https://bugzilla.redhat.com/show_bug.cgi?id=1894654
$ret = script_run "grep '1 loaded units' /tmp/failed.txt";
if ($ret != 0) {
die "More than one services failed to start";
}
else {
# fail if it's something other than hcn-init
assert_script_run "systemctl is-failed hcn-init.service";
record_soft_failure "hcn-init failed - https://bugzilla.redhat.com/show_bug.cgi?id=1894654";
}
}
sub test_flags {
return { fatal => 1 };
}
1;
# vim: set sw=4 et: