From: Daan De Meyer Date: Tue, 2 Apr 2024 18:37:30 +0000 (+0200) Subject: test: Always exit with 77 if we skip a test X-Git-Tag: v256-rc1~336 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=c89b3e1dfda482d4ba657f26ebb46534c8512b09;p=systemd%2F.git test: Always exit with 77 if we skip a test Prep work for running the integration tests with meson, which requires tests to exit with 77 to indicate they are skipped. Note this only deals with the easy cases where there's only tests. The hard ones where there's subtests of which only some are skipped are left for another PR. --- diff --git a/test/units/testsuite-08.sh b/test/units/testsuite-08.sh index 5c6b4cee79..58d9bea195 100755 --- a/test/units/testsuite-08.sh +++ b/test/units/testsuite-08.sh @@ -13,7 +13,7 @@ fi if [[ "$(systemctl show -P InitRDTimestampMonotonic)" -eq 0 ]]; then echo "systemd didn't run in the initrd, skipping the test" touch /skipped - exit 0 + exit 77 fi # We should've created a mount under /run in initrd (see the other half of the test) diff --git a/test/units/testsuite-43.sh b/test/units/testsuite-43.sh index 4f31a33c34..c120468593 100755 --- a/test/units/testsuite-43.sh +++ b/test/units/testsuite-43.sh @@ -8,7 +8,7 @@ set -o pipefail if [[ "$(sysctl -ne kernel.apparmor_restrict_unprivileged_userns)" -eq 1 ]]; then echo "Cannot create unprivileged user namespaces" >/skipped - exit 0 + exit 77 fi systemd-analyze log-level debug diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh index 7a2bee8179..d9ba83aa82 100755 --- a/test/units/testsuite-46.sh +++ b/test/units/testsuite-46.sh @@ -6,7 +6,7 @@ set -o pipefail # Check if homectl is installed, and if it isn't bail out early instead of failing if ! test -x /usr/bin/homectl ; then echo "no homed" >/skipped - exit 0 + exit 77 fi inspect() { diff --git a/test/units/testsuite-55.sh b/test/units/testsuite-55.sh index 3e549dd7db..e5d930175f 100755 --- a/test/units/testsuite-55.sh +++ b/test/units/testsuite-55.sh @@ -16,7 +16,7 @@ test "$(cat /sys/fs/cgroup/init.scope/memory.high)" != "max" [[ "$(get_cgroup_hierarchy)" == "unified" ]] || echo "no cgroupsv2" >>/skipped [[ -x /usr/lib/systemd/systemd-oomd ]] || echo "no oomd" >>/skipped if [[ -s /skipped ]]; then - exit 0 + exit 77 fi rm -rf /run/systemd/system/testsuite-55-testbloat.service.d diff --git a/test/units/testsuite-58.sh b/test/units/testsuite-58.sh index c64b2039f3..bebe7b727b 100755 --- a/test/units/testsuite-58.sh +++ b/test/units/testsuite-58.sh @@ -9,7 +9,7 @@ set -o pipefail if ! command -v systemd-repart >/dev/null; then echo "no systemd-repart" >/skipped - exit 0 + exit 77 fi # shellcheck source=test/units/test-control.sh diff --git a/test/units/testsuite-62.sh b/test/units/testsuite-62.sh index 0dbedc4c86..84c92247b8 100755 --- a/test/units/testsuite-62.sh +++ b/test/units/testsuite-62.sh @@ -44,12 +44,12 @@ MINOR_REQUIRED=7 if [[ "$KERNEL_MAJOR" -lt $MAJOR_REQUIRED || ("$KERNEL_MAJOR" -eq $MAJOR_REQUIRED && "$KERNEL_MINOR" -lt $MINOR_REQUIRED) ]]; then echo "kernel is not 5.7+" >>/skipped - exit 0 + exit 77 fi if systemctl --version | grep -q -F -- "-BPF_FRAMEWORK"; then echo "bpf-framework is disabled" >>/skipped - exit 0 + exit 77 fi trap teardown EXIT diff --git a/test/units/testsuite-72.sh b/test/units/testsuite-72.sh index 587eb69540..5e658e0485 100755 --- a/test/units/testsuite-72.sh +++ b/test/units/testsuite-72.sh @@ -16,7 +16,7 @@ export SYSTEMD_LOG_LEVEL=debug if [[ ! -x "$SYSUPDATE" ]]; then echo "no systemd-sysupdate" >/skipped - exit 0 + exit 77 fi # Loopback devices may not be supported. They are used because sfdisk cannot