Skip to content

Commit

Permalink
PC: Fix the slem_basic ausearch
Browse files Browse the repository at this point in the history
  • Loading branch information
pdostal committed Sep 18, 2024
1 parent 83afc42 commit f94b8fd
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 f94b8fd

Please sign in to comment.