Skip to content
Snippets Groups Projects
Commit d12ee184 authored by Denis Pynkin's avatar Denis Pynkin
Browse files

Use `sudo journalctl` for non-privileged user in AA tests


Access to system journal is restricted for user after switching to
Debian. AppArmor tests need to check system log with journalctl but
without proper permissions they fail.
Adding sudo for non-root users allows to check the log entries and
compare the output with expected.

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
parent 159717ce
Branches apertis/v2021
No related tags found
1 merge request!3Update common subtree
......@@ -124,7 +124,14 @@ sleep 3
# Get audit information from journal
AUDIT_FILE=${TMP_DIR}/AUDIT
journalctl -S "${START_TIME}" -t audit -o cat > ${AUDIT_FILE}
uid=$(id -u)
JOURNALCTL="journalctl"
if [ "${UID}" != "0" ]
then
JOURNALCTL="sudo journalctl"
fi
${JOURNALCTL} -S "${START_TIME}" -t audit -o cat > ${AUDIT_FILE}
echo "#=== ${TEST_TITLE} ==="
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment