diff --git a/test/TEST-34-DYNAMICUSERMIGRATE/test.sh b/test/TEST-34-DYNAMICUSERMIGRATE/test.sh index 5acc57363e..4e8836648a 100755 --- a/test/TEST-34-DYNAMICUSERMIGRATE/test.sh +++ b/test/TEST-34-DYNAMICUSERMIGRATE/test.sh @@ -3,6 +3,11 @@ set -e TEST_DESCRIPTION="test migrating state directory from DynamicUser=1 to DynamicUser=0 and back" +# Certain subtests run with DynamicUser=true which makes writing the gcov +# artifacts impossible. As $GCOV_PREFIX and friends seem to be ineffective +# in this situation, let's simply ignore all gcov complaints for the whole +# test to make it happy. +IGNORE_MISSING_COVERAGE=yes # shellcheck source=test/test-functions . "${TEST_BASE_DIR:?}/test-functions" diff --git a/test/test-shutdown.py b/test/test-shutdown.py index 52207a4656..e181f976be 100755 --- a/test/test-shutdown.py +++ b/test/test-shutdown.py @@ -90,7 +90,7 @@ def run(args): except Exception as e: logger.error(e) logger.info("killing child pid %d", console.pid) - console.terminate() + console.terminate(force=True) return ret diff --git a/test/units/testsuite-34.sh b/test/units/testsuite-34.sh index beaf3ba31e..2172f7434b 100755 --- a/test/units/testsuite-34.sh +++ b/test/units/testsuite-34.sh @@ -116,7 +116,7 @@ test_check_writable() { rm -rf "/var/lib/$i" "/var/lib/private/$i" done - cat >/run/systemd/system/testservice-34-check-writable.service </run/systemd/system/testservice-34-check-writable.service <<\EOF [Unit] Description=Check writable directories when DynamicUser= with StateDirectory= @@ -133,18 +133,18 @@ ExecStart=bash -c ' \ set -eux; \ set -o pipefail; \ declare -a writable_dirs; \ - readarray -t writable_dirs < <(find / \\( -path /var/tmp -o -path /tmp -o -path /proc -o -path /dev/mqueue -o -path /dev/shm -o \ - -path /sys/fs/bpf -o -path /dev/.lxc -o -path /sys/devices/system/cpu \\) \ + readarray -t writable_dirs < <(find / \( -path /var/tmp -o -path /tmp -o -path /proc -o -path /dev/mqueue -o -path /dev/shm -o \ + -path /sys/fs/bpf -o -path /dev/.lxc -o -path /sys/devices/system/cpu \) \ -prune -o -type d -writable -print 2>/dev/null | sort -u); \ - [[ "\$\${#writable_dirs[@]}" == "8" ]]; \ - [[ "\$\${writable_dirs[0]}" == "/var/lib/private/aaa" ]]; \ - [[ "\$\${writable_dirs[1]}" == "/var/lib/private/aaa/bbb" ]]; \ - [[ "\$\${writable_dirs[2]}" == "/var/lib/private/aaa/ccc" ]]; \ - [[ "\$\${writable_dirs[3]}" == "/var/lib/private/quux/pief" ]]; \ - [[ "\$\${writable_dirs[4]}" == "/var/lib/private/waldo" ]]; \ - [[ "\$\${writable_dirs[5]}" == "/var/lib/private/xxx" ]]; \ - [[ "\$\${writable_dirs[6]}" == "/var/lib/private/xxx/yyy" ]]; \ - [[ "\$\${writable_dirs[7]}" == "/var/lib/private/xxx/zzz" ]]; \ + [[ "$${#writable_dirs[@]}" == "8" ]]; \ + [[ "$${writable_dirs[0]}" == "/var/lib/private/aaa" ]]; \ + [[ "$${writable_dirs[1]}" == "/var/lib/private/aaa/bbb" ]]; \ + [[ "$${writable_dirs[2]}" == "/var/lib/private/aaa/ccc" ]]; \ + [[ "$${writable_dirs[3]}" == "/var/lib/private/quux/pief" ]]; \ + [[ "$${writable_dirs[4]}" == "/var/lib/private/waldo" ]]; \ + [[ "$${writable_dirs[5]}" == "/var/lib/private/xxx" ]]; \ + [[ "$${writable_dirs[6]}" == "/var/lib/private/xxx/yyy" ]]; \ + [[ "$${writable_dirs[7]}" == "/var/lib/private/xxx/zzz" ]]; \ ' EOF systemctl daemon-reload