From 85868729f840aaebe04aba1d18e1262544fbd118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 21 Nov 2025 18:09:41 +0100 Subject: [PATCH] tests/sanity: add a rescue kernel boot entry Reinstalling the kernel-core rpm fails when there is just a single boot entry originaly which seems to be the case on cloud image. Workaround that by adding a rescue kernel image. --- tests/sanity/runtest.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh index ededecd..54c6ce6 100755 --- a/tests/sanity/runtest.sh +++ b/tests/sanity/runtest.sh @@ -97,12 +97,15 @@ rlJournalStart # check kernel installation, must not create /boot/ if [ $UID -eq 0 ]; then - rlLog "Apply machine-id workaround if running from a cloud image" - pushd /boot/loader/entries/ - [ -f ffffffffffffffffffffffffffffffff-$(uname -r).conf ] && \ - mv ffffffffffffffffffffffffffffffff-$(uname -r).conf $(cat /etc/machine-id)-$(uname -r).conf - popd if rlCheckRpm kernel-core; then + rlLog "Apply machine-id workaround if running from a cloud image" + pushd /boot/loader/entries/ + if [ -f ffffffffffffffffffffffffffffffff-$(uname -r).conf ]; then + mv ffffffffffffffffffffffffffffffff-$(uname -r).conf $(cat /etc/machine-id)-$(uname -r).conf + rlCheckRpm dracut-config-rescue || dnf install -y dracut-config-rescue + kernel-install add "$(uname -r)" "/lib/modules/$(uname -r)/vmlinuz" + fi + popd rlRun "dnf -y reinstall kernel-core" 0 "Reinstalling the kernel to verify BLS scripts function" rlAssertNotExists /boot/`cat /etc/machine-id` else