From d5ab23aa54229e9e89427e7d20883bd8c93fd976 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 5 Jun 2023 22:41:46 +0200 Subject: [PATCH] test: a couple of assorted cleanups - sort binaries - send stdout/stderr of the autorelabel service to console as well --- test/TEST-06-SELINUX/test.sh | 3 +-- test/test-functions | 2 +- test/units/autorelabel.service | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/TEST-06-SELINUX/test.sh b/test/TEST-06-SELINUX/test.sh index 85be3bed9b6..340c74ef163 100755 --- a/test/TEST-06-SELINUX/test.sh +++ b/test/TEST-06-SELINUX/test.sh @@ -43,9 +43,8 @@ test_append_files() { mkdir "$workspace/systemd-test-module" cp -v systemd_test.* "$workspace/systemd-test-module/" + image_install checkmodule load_policy m4 make sefcontext_compile semodule semodule_package runcon image_install -o sesearch - image_install runcon - image_install checkmodule semodule semodule_package m4 make load_policy sefcontext_compile image_install -o /usr/libexec/selinux/hll/pp # Fedora/RHEL/... image_install -o /usr/lib/selinux/hll/pp # Debian/Ubuntu/... diff --git a/test/test-functions b/test/test-functions index c7f9f2f4404..8e26910bcd8 100644 --- a/test/test-functions +++ b/test/test-functions @@ -798,7 +798,7 @@ setup_selinux() { fi local conf_dir=/etc/selinux - local fixfiles_tools=(awk bash cat chcon expr find grep head secon setfiles rm sort uname uniq) + local fixfiles_tools=(awk bash cat chcon expr egrep find grep head secon setfiles rm sort uname uniq) # Make sure the following statement can't expand to "/" to prevent # a potential where-are-my-backups situation diff --git a/test/units/autorelabel.service b/test/units/autorelabel.service index 1da1002cde8..aad7d111d5a 100644 --- a/test/units/autorelabel.service +++ b/test/units/autorelabel.service @@ -10,10 +10,11 @@ ConditionSecurity=selinux ConditionPathExists=|/.autorelabel [Service] -ExecStart=sh -x -c 'echo 0 >/sys/fs/selinux/enforce && fixfiles -f -F relabel && rm /.autorelabel && systemctl --force reboot' +ExecStart=sh -xec 'echo 0 >/sys/fs/selinux/enforce; fixfiles -f -F relabel; rm /.autorelabel; systemctl --force reboot' Type=oneshot TimeoutSec=0 RemainAfterExit=yes +StandardOutput=journal+console [Install] WantedBy=basic.target -- 2.47.3