From d1f6c3857ef4ade140cfa575c6132fa109b88564 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 2 Sep 2022 12:43:02 +0200 Subject: [PATCH 1/2] test: forward nspawn logs to journal Dumping everything to console slows the test quite considerably on slower machines, so let's forward nspawn logs to the journal to still have them available in case something goes south. This should, hopefully, help with TEST-13 timeouts in Ubuntu CI and maybe with CPU soft lockups in CentOS CI. --- test/units/testsuite-13.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/units/testsuite-13.sh b/test/units/testsuite-13.sh index 1fc3d8bee3..487cc549f4 100755 --- a/test/units/testsuite-13.sh +++ b/test/units/testsuite-13.sh @@ -5,6 +5,7 @@ set -eux set -o pipefail export SYSTEMD_LOG_LEVEL=debug +export SYSTEMD_LOG_TARGET=journal # check cgroup-v2 is_v2_supported=no From 729292d9ddc2ac390749af5deb232c5e749aef6f Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Fri, 2 Sep 2022 19:39:30 +0200 Subject: [PATCH 2/2] test: suppress not-found errors for `selinuxenabled` if the binary is not available. --- test/TEST-13-NSPAWN-SMOKE/test.sh | 2 +- test/units/testsuite-13.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/TEST-13-NSPAWN-SMOKE/test.sh b/test/TEST-13-NSPAWN-SMOKE/test.sh index 3d1e50447c..65c1e9be3d 100755 --- a/test/TEST-13-NSPAWN-SMOKE/test.sh +++ b/test/TEST-13-NSPAWN-SMOKE/test.sh @@ -17,7 +17,7 @@ test_append_files() { busybox="$(type -P busybox-static || type -P busybox)" inst_simple "$busybox" "$(dirname "$busybox")/busybox" - if selinuxenabled >/dev/null; then + if command -v selinuxenabled >/dev/null && selinuxenabled; then image_install selinuxenabled cp -ar /etc/selinux "$workspace/etc/selinux" fi diff --git a/test/units/testsuite-13.sh b/test/units/testsuite-13.sh index 487cc549f4..fb0b3cda16 100755 --- a/test/units/testsuite-13.sh +++ b/test/units/testsuite-13.sh @@ -112,7 +112,7 @@ EOF } function check_selinux { - if ! selinuxenabled; then + if ! command -v selinuxenabled >/dev/null || ! selinuxenabled; then echo >&2 "SELinux is not enabled, skipping SELinux-related tests" return 0 fi