Merge pull request #30492 from mrc0mmand/skip-TEST-08-without-systemd-in-initrd

test: skip TEST-08-INITRD if systemd didn't run in the initrd
This commit is contained in:
Luca Boccassi
2023-12-18 16:10:33 +01:00
committed by GitHub
3 changed files with 13 additions and 0 deletions

View File

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

View File

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