Merge pull request #25039 from mrc0mmand/test-tewaks

A couple of minor tweaks for recent CI fails
This commit is contained in:
Luca Boccassi
2022-10-17 21:52:00 +02:00
committed by GitHub
3 changed files with 18 additions and 13 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <<EOF
cat >/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