Skip to content

Commit

Permalink
tests: check for avc denials around daemon-reload
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-nguyen committed Apr 28, 2022
1 parent 96241ae commit 0b4762c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/kola/systemd/systemd-daemon-reload-avc
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

0 comments on commit 0b4762c

Please sign in to comment.