From 8da3481ca236ade0a0a801f18d82153d457a7948 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Fri, 17 Nov 2023 13:19:45 +0100 Subject: [PATCH] CI: Test SELinux configuration Change-Id: I06b0bd4634ebb8b78baa23656c891333fd96b88b --- .../tests/test_overcloud_host_configure.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/playbooks/kayobe-overcloud-host-configure-base/tests/test_overcloud_host_configure.py b/playbooks/kayobe-overcloud-host-configure-base/tests/test_overcloud_host_configure.py index 70c33ca7a..1a1965723 100644 --- a/playbooks/kayobe-overcloud-host-configure-base/tests/test_overcloud_host_configure.py +++ b/playbooks/kayobe-overcloud-host-configure-base/tests/test_overcloud_host_configure.py @@ -319,6 +319,19 @@ def test_firewalld_rules(host): assert expected_line in perm_info +@pytest.mark.skipif(not _is_dnf(), + reason="SELinux only supported on CentOS/Rocky") +def test_selinux(host): + selinux = host.check_output("sestatus") + selinux = selinux.splitlines() + # Remove duplicate whitespace characters in output + selinux = [" ".join(x.split()) for x in selinux] + + assert "SELinux status: enabled" in selinux + assert "Current mode: permissive" in selinux + assert "Mode from config file: permissive" in selinux + + def test_swap(host): swapon = host.check_output("swapon -s") swapon = swapon.splitlines()