-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: check for avc denials around daemon-reload
- Loading branch information
1 parent
96241ae
commit 0b4762c
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# kola: { "exclusive": true } | ||
# Verify there are no AVC denial before and after reloading the systemd manager configuration | ||
# | ||
# https://bugzilla.redhat.com/show_bug.cgi?id=1924869 | ||
set -xeuo pipefail | ||
|
||
. $KOLA_EXT_DATA/commonlib.sh | ||
|
||
check_avc_denials() { | ||
if test -f /var/log/audit/audit.log; then | ||
if grep 'avc.*denied' /var/log/audit/audit.log; then | ||
fatal "Found AVC denials" | ||
fi | ||
else | ||
if journalctl -q --no-pager --grep='avc.*denied' _TRANSPORT=audit; then | ||
fatal "Found AVC denials" | ||
fi | ||
fi | ||
} | ||
|
||
check_avc_denials | ||
systemctl daemon-reload | ||
check_avc_denials |