Skip to content

Commit

Permalink
Merge pull request #20201 from pdostal/slem_basic
Browse files Browse the repository at this point in the history
PC: Fix the slem_basic ausearch
  • Loading branch information
asmorodskyi authored Sep 18, 2024
2 parents 89910da + f94b8fd commit 0a9f567
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/publiccloud/slem_basic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ sub check_avc {

my $instance = $self->{my_instance};
# Read the Access Vector Cache to check for SELinux denials
my $avc = $instance->ssh_script_output(cmd => 'sudo ausearch -ts boot -m avc --format raw | ( grep type=AVC || true )');
my $avc = $instance->ssh_script_output(cmd => 'sudo ausearch -ts boot -m avc --format raw', proceed_on_failure => 1, ssh_opts => '-t');
record_info("AVC at boot", $avc);
return if ($avc =~ "no matches");

## Gain better formatted logs and upload them for further investigation
$instance->ssh_assert_script_run(cmd => 'sudo ausearch -ts boot -m avc > ausearch.txt || true'); # ausearch fails if there are no matches
$instance->ssh_script_run(cmd => 'sudo ausearch -ts boot -m avc > ausearch.txt', ssh_opts => '-t'); # ausearch fails if there are no matches
assert_script_run("scp " . $instance->username() . "@" . $instance->public_ip . ":ausearch.txt ausearch.txt");
upload_logs("ausearch.txt");

Expand Down

0 comments on commit 0a9f567

Please sign in to comment.