Add test that no AppArmor denied events are produced (#3912)

As discussed in #3885, now that fixed Supervisor is in stable, we can test that
no AppArmor denied events are logged during CI tests.

(cherry picked from commit 610ced0162aa1c76915a0cc2adf16d93c858358e)
This commit is contained in:
Jan Čermák 2025-03-05 19:04:15 +01:00 committed by Jan Čermák
parent f7bfd161ad
commit 16e6599832
No known key found for this signature in database
GPG Key ID: A78C897AA3AF012B

View File

@ -192,6 +192,13 @@ def test_restore_ssl_directory(shell_json, stash):
logger.info("Backup restore result: %s", result)
@pytest.mark.dependency(depends=["test_start_supervisor"])
def test_no_apparmor_denies(shell):
"""Check there are no AppArmor denies in the logs raised during Supervisor tests."""
output = shell.run_check("journalctl -t audit | grep DENIED || true")
assert not output, f"AppArmor denies found: {output}"
@pytest.mark.dependency(depends=["test_start_supervisor"])
def test_kernel_not_tainted(shell):
"""Check if the kernel is not tainted - do it at the end of the