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
This commit is contained in:
Frantisek Sumsal 2023-12-15 11:04:39 +01:00
parent 1905d621db
commit 57d61ff319
2 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