Simplify the services test fix
I forgot `script_run` actually returns the exit code. That makes it easier.
This commit is contained in:
parent
641b30ac09
commit
460a6e5439
@ -9,14 +9,15 @@ sub run {
|
||||
# dump the systemctl output
|
||||
assert_script_run "systemctl --failed | tee /tmp/failed.txt";
|
||||
# if we have 0 failed services, we're good
|
||||
eval "assert_script_run 'grep \"0 loaded units\" /tmp/failed.txt';";
|
||||
return unless $@;
|
||||
my $ret = script_run "grep '0 loaded units' /tmp/failed.txt";
|
||||
return if $ret == 0;
|
||||
# if only mcelog failed, that's a soft fail
|
||||
eval "assert_script_run 'grep \"1 loaded units\" /tmp/failed.txt';";
|
||||
if ($@) {
|
||||
$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 mcelog
|
||||
assert_script_run "systemctl is-failed mcelog.service";
|
||||
record_soft_failure;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user