]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Skip TEST-06-SELINUX early if not on fedora/centos
authorRichard Maw <richard.maw@codethink.co.uk>
Tue, 30 Apr 2024 17:02:51 +0000 (18:02 +0100)
committerRichard Maw <richard.maw@codethink.co.uk>
Fri, 3 May 2024 11:57:11 +0000 (12:57 +0100)
Other distributions may be able to install selinux
but they are not expected to use it.

The distribution is tested rather than whether selinux is enabled
because it is expected to work on CentOS and Fedora
and we want it to fail noisily.

test/units/testsuite-06.sh

index 7fc3c379e57c749b96cef81eaccdf318381d37ae..937a04005ad8d82f571ec33627b44dbcbeee6550 100755 (executable)
@@ -3,6 +3,12 @@
 set -eux
 set -o pipefail
 
+. /etc/os-release
+if ! [[ "$ID" =~ centos|fedora ]]; then
+    echo "Skipping because only CentOS and Fedora support SELinux tests" >>/skipped
+    exit 77
+fi
+
 # Note: ATTOW the following checks should work with both Fedora and upstream reference policy
 #       (with or without MCS/MLS)