From 049b456d9adc4af1290feb15cc8224526fe0dcec Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Tue, 30 Apr 2024 18:02:51 +0100 Subject: [PATCH] test: Skip TEST-06-SELINUX early if not on fedora/centos 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/units/testsuite-06.sh b/test/units/testsuite-06.sh index 7fc3c379e57..937a04005ad 100755 --- a/test/units/testsuite-06.sh +++ b/test/units/testsuite-06.sh @@ -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)