The config file has (unfortunately) precedence over the kernel command
line, so let's tweak the config file if necessary.
. "${TEST_BASE_DIR:?}/test-functions"
SETUP_SELINUX=yes
-KERNEL_APPEND="${KERNEL_APPEND:=} selinux=1 security=selinux"
+KERNEL_APPEND="${KERNEL_APPEND:=} selinux=1 security=selinux enforcing=0"
test_append_files() {
local workspace="${1:?}"
image_install -o /usr/libexec/selinux/hll/pp # Fedora/RHEL/...
image_install -o /usr/lib/selinux/hll/pp # Debian/Ubuntu/...
+ # Config file has (unfortunately) always precedence, so let's switch it there as well
+ sed -i '/^SELINUX=disabled$/s/disabled/permissive/' "$workspace/etc/selinux/config"
+
if ! chroot "$workspace" make -C /systemd-test-module -f /usr/share/selinux/devel/Makefile clean load systemd_test.pp QUIET=n; then
dfatal "Failed to build the systemd test module"
exit 1
set -eux
set -o pipefail
-echo 1 >/sys/fs/selinux/enforce || {
- echo "Can't make selinux enforcing, skipping test"
- touch /testok
- exit
-}
-
runcon -t systemd_test_start_t systemctl start hola
runcon -t systemd_test_reload_t systemctl reload hola
runcon -t systemd_test_stop_t systemctl stop hola