From: Frantisek Sumsal Date: Mon, 5 Jun 2023 20:41:46 +0000 (+0200) Subject: test: a couple of assorted cleanups X-Git-Tag: v254-rc1~277^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F27933%2Fhead;p=thirdparty%2Fsystemd.git test: a couple of assorted cleanups - sort binaries - send stdout/stderr of the autorelabel service to console as well --- 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