test: generate a custom initrd for TEST-24 if $INITRD is unset

Co-Authored-By: Yu Watanabe <watanabe.yu+github@gmail.com>
This commit is contained in:
Frantisek Sumsal
2022-05-26 15:04:56 +02:00
co-authored by Yu Watanabe
parent 1fb7f8e15e
commit b22d90e594
2 changed files with 29 additions and 0 deletions
+5
View File
@@ -337,6 +337,11 @@ qemu_min_version() {
# Return 0 if qemu did run (then you must check the result state/logs for actual
# success), or 1 if qemu is not available.
run_qemu() {
# If the test provided its own initrd, use it (e.g. TEST-24)
if [[ -z "$INITRD" && -f "${TESTDIR:?}/initrd.img" ]]; then
INITRD="$TESTDIR/initrd.img"
fi
if [ -f /etc/machine-id ]; then
read -r MACHINE_ID </etc/machine-id
[ -z "$INITRD" ] && [ -e "$EFI_MOUNT/$MACHINE_ID/$KERNEL_VER/initrd" ] \