]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
test(KERNEL-INSTALL): check kernel-install result
authorBenjamin Drung <benjamin.drung@canonical.com>
Tue, 13 Jan 2026 14:36:22 +0000 (15:36 +0100)
committerLaszlo <laszlo.gombos@gmail.com>
Wed, 14 Jan 2026 00:56:23 +0000 (19:56 -0500)
The kernel-install call should create an `initrd` file that the test
will use later in `test_run`. Check that this file has been created to
ease debugging in case of a failure.

test/TEST-43-KERNEL-INSTALL/test.sh

index d7cd2209611f0b865c41cd4abb0fa870e687d9f8..70cbd20c77d067a7a06d29c7136dfd2331155350 100755 (executable)
@@ -61,6 +61,10 @@ test_setup() {
     # using kernell-install to invoke dracut
     mkdir -p "$BOOT_ROOT/$TOKEN/$KVERSION" "$BOOT_ROOT/loader/entries" "$BOOT_ROOT/$TOKEN/0-rescue/loader/entries"
     kernel-install add "$KVERSION" "$KIMAGE"
+    if [[ ! -e "$BOOT_ROOT/$TOKEN/$KVERSION"/initrd ]]; then
+        echo "Error: kernel-install failed to create $BOOT_ROOT/$TOKEN/$KVERSION/initrd" >&2
+        return 1
+    fi
 }
 
 # shellcheck disable=SC1090