test: check for enabled AppArmor
@@ -371,9 +371,10 @@ def test_aws_ena_driver(client, aws):
def test_apparmor(client, non_chroot):
(exit_code, output, error) = client.execute_command("grep apparmor /sys/kernel/security/lsm")
- assert exit_code == 1, f"expected apparmor to be disabled"
+ assert exit_code == 0, f"no {error=} expected"
+ assert "apparmor" in output.rstrip(), "expected AppArmor to be in ist of lsms"
def test_selinux(client, non_chroot):
(exit_code, output, error) = client.execute_command("grep selinux /sys/kernel/security/lsm")
- assert exit_code == 0, f"no {error=} expected"
- assert "selinux" in output.rstrip(), "Expected SELinux to be enabled."
+ assert exit_code == 1, f"expected selinux not in list of lsms"
+ assert "selinux" not in output.rstrip(), "Expected SELinux not to be enabled."
