diff --git a/lib/utils.pm b/lib/utils.pm index e6ae304d..efaabe10 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -1922,13 +1922,20 @@ sub reboot_system { # Grub to manually the installed system (Fedora does not provide # any pre-configured Grub entries on its Live media. sub manual_boot { + # The commands are linux and initrd on BIOS, but they differ + # on UEFI, so we will choose the correct set. my $linux = "linux"; my $initrd = "initrd"; - # On UEFI, the commands are different if (get_var("UEFI")) { $linux = "linuxefi"; $initrd = "initrdefi"; } + # There is no solid way how we could identify the kernel version + # from the Grub screen, but with new installations we know + # that there will only be one kernel present, which we can tabcomplete + # if we know at least the first number. We are aware that the test + # will fail is kernel upgrades to newer major number, but this is + # not as frequent so the cost of this operation is reasonable. my $kernel = get_var("KERNEL_VERSION", "6"); # Wait until Grub menu appears assert_screen("bootloader", 1800); @@ -1943,7 +1950,7 @@ sub manual_boot { type_string("$linux /vmlinuz-$kernel\t root=/dev/vda3 ro rootflags=subvol=root\n"); sleep(1); # Load initrd - type_string("$initrd /initrd-$kernel\t"); + type_string("$initrd /initramfs-$kernel\t"); sleep(1); send_key("ret"); # Boot diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 76a4da08..63a01393 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -176,6 +176,12 @@ sub run { unless (@actions) { unless (get_var("MEMCHECK")) { assert_and_click "anaconda_install_done"; + # If we have the USBBOOT variable set up, the boot process will + # always end up in booting the USB iso and never the hard drive, + # therefore we need to boot manually. + if (get_var("USBBOOT")) { + manual_boot(); + } if (get_var("TEST") eq 'install_default_update_netinst') { wait_still_screen 10; if (check_screen "anaconda_grey_stuck") { @@ -251,6 +257,8 @@ sub run { } } type_string "reboot\n" if (grep { $_ eq 'reboot' } @actions); + # If we are here to restart the system, we need to boot the system manually, + # because the USBBOOT variable prevents the system from booting from the hard drive. if (get_var("USBBOOT")) { manual_boot(); }