From: Frantisek Sumsal Date: Fri, 15 Dec 2023 10:04:39 +0000 (+0100) Subject: test: skip TEST-08-INITRD if systemd didn't run in the initrd X-Git-Tag: v256-rc1~1468^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=57d61ff319ec217294d9e0c4646010322b8be5e5;p=thirdparty%2Fsystemd.git test: skip TEST-08-INITRD if systemd didn't run in the initrd This test requires systemd in the initrd, which is not the case in mkinitrd-based initrds (Ubuntu/Debian). Resolves: #30481 --- diff --git a/test/TEST-08-INITRD/test.sh b/test/TEST-08-INITRD/test.sh index 29fd1f78998..caa27f69fdf 100755 --- a/test/TEST-08-INITRD/test.sh +++ b/test/TEST-08-INITRD/test.sh @@ -44,8 +44,13 @@ EOF } check_result_qemu_hook() { + local workspace="${1:?}" local console_log="${TESTDIR:?}/console.log" + if [[ -e "$workspace/skipped" ]]; then + return 0 + fi + if [[ ! -e "$console_log" ]]; then dfatal "Missing console log - this shouldn't happen" return 1 diff --git a/test/units/testsuite-08.sh b/test/units/testsuite-08.sh index 9598c8ea0c2..5c6b4cee790 100755 --- a/test/units/testsuite-08.sh +++ b/test/units/testsuite-08.sh @@ -8,6 +8,14 @@ if systemd-detect-virt -qc; then exit 1 fi +# This test requires systemd to run in the initrd as well, which is not the case +# for mkinitrd-based initrd (Ubuntu/Debian) +if [[ "$(systemctl show -P InitRDTimestampMonotonic)" -eq 0 ]]; then + echo "systemd didn't run in the initrd, skipping the test" + touch /skipped + exit 0 +fi + # We should've created a mount under /run in initrd (see the other half of the test) # that should've survived the transition from initrd to the real system test -d /run/initrd-mount-target