diff --git a/lib/bootloader_pvm.pm b/lib/bootloader_pvm.pm index a498e236d661..1d097cda2a98 100644 --- a/lib/bootloader_pvm.pm +++ b/lib/bootloader_pvm.pm @@ -20,7 +20,7 @@ use testapi; use bootloader_setup; use registration 'registration_bootloader_params'; use utils qw(get_netboot_mirror type_string_slow enter_cmd_slow); -use version_utils 'is_upgrade'; +use version_utils qw(is_agama is_upgrade); use Utils::Backends; use YuiRestClient; use ntlm_auth; @@ -123,19 +123,24 @@ sub enter_netboot_parameters { record_info("Updated boot path for PPC64LE_GRUB_HTTP defined", $mntpoint); } my $ntlm_p = get_var('NTLM_AUTH_INSTALL') ? $ntlm_auth::ntlm_proxy : ''; - if (get_var('AGAMA')) { - type_string_slow "linux $mntpoint/linux vga=normal root=live:http://" . get_var('OPENQA_HOSTNAME') . "/assets/iso/" . get_var('ISO'); - type_string_slow " " . get_var('EXTRABOOTPARAMS'); + if (is_agama) { + type_string_slow "linux $mntpoint/linux root=live:http://" . get_var('OPENQA_HOSTNAME') . "/assets/iso/" . get_var('ISO') . " live.password=$testapi::password"; + # agama.auto and agama.install_url are defined in below function + specific_bootmenu_params; + type_string_slow " " . get_var('EXTRABOOTPARAMS') if (get_var('EXTRABOOTPARAMS')); } else { type_string_slow "linux $mntpoint/linux vga=normal $ntlm_p install=$mirror "; } # Skipping this setup due to it triggers general code for openSUSE that breaks powerVM scenario - bootmenu_default_params unless get_var('AGAMA'); - bootmenu_network_source; - specific_bootmenu_params; - registration_bootloader_params(utils::VERY_SLOW_TYPING_SPEED) unless get_var('NTLM_AUTH_INSTALL'); - type_string_slow remote_install_bootmenu_params; + unless (is_agama) { + bootmenu_default_params; + bootmenu_network_source; + specific_bootmenu_params; + registration_bootloader_params(utils::VERY_SLOW_TYPING_SPEED) unless get_var('NTLM_AUTH_INSTALL'); + type_string_slow remote_install_bootmenu_params; + } + type_string_slow " fips=1" if (get_var('FIPS_INSTALLATION')); type_string_slow " UPGRADE=1" if (get_var('UPGRADE')); @@ -159,7 +164,6 @@ sub prepare_pvm_installation { enter_netboot_parameters; enter_cmd "boot"; save_screenshot; - return if get_var('AGAMA'); # pvm has sometimes extrem performance issue, increase timeout for booting up after enter_netboot_parameters assert_screen(["pvm-grub-menu", "novalink-successful-first-boot"], 300); @@ -171,6 +175,12 @@ sub prepare_pvm_installation { return (bootloader_pvm::prepare_pvm_installation $boot_attempt); } + if (is_agama) { + record_info("Installing", "Please check the expected product is being installed"); + assert_screen('agama-installer-live-root', 400); + return; + } + assert_screen("run-yast-ssh", 300); if (!is_upgrade && !get_var('KEEP_DISKS')) { diff --git a/lib/bootloader_setup.pm b/lib/bootloader_setup.pm index e46310e5f404..476f6b0ddf1b 100644 --- a/lib/bootloader_setup.pm +++ b/lib/bootloader_setup.pm @@ -887,6 +887,10 @@ sub specific_bootmenu_params { push @params, "agama.auto=$url"; } + if (my $agama_install_url = get_var('AGAMA_INSTALL_URL')) { + push @params, "agama.install_url=$agama_install_url"; + } + # Boot the system with the debug options if shutdown takes suspiciously long time. # Please, see https://freedesktop.org/wiki/Software/systemd/Debugging/#index2h1 for the details. # Further actions for saving debug logs are done in 'shutdown/cleanup_before_shutdown' module. diff --git a/tests/installation/agama_reboot.pm b/tests/installation/agama_reboot.pm index d58e4982d18f..b56adc0dd052 100644 --- a/tests/installation/agama_reboot.pm +++ b/tests/installation/agama_reboot.pm @@ -14,7 +14,7 @@ # 3) workaround for no ability to disable grub timeout in agama # https://github.com/openSUSE/agama/issues/1594 # grub_test() is too slow to catch boot screen for us -# 4) for ipmi backend, vnc access during the installation is not available now, +# 4) for ipmi/pvm backend, vnc access during the installation is not available now, # we need to access to live root system to monitor installation process # Maintainer: Lubos Kocman , @@ -26,7 +26,7 @@ use version_utils qw(is_leap is_sle); use utils; use Utils::Logging qw(export_healthcheck_basic); use x11utils 'ensure_unlocked_desktop'; -use Utils::Backends qw(is_ipmi); +use Utils::Backends qw(is_ipmi is_pvm); use Utils::Architectures qw(is_aarch64); sub upload_agama_logs { @@ -57,7 +57,7 @@ sub verify_agama_auto_install_done_cmdline { die "Install phase is not done, please check agama logs"; } -sub agama_system_prepare_ipmi { +sub agama_system_prepare { # Mount the root disk after installation, and do some prepare tasks: # Configure serial console, enable root ssh access, etc @@ -71,13 +71,19 @@ sub agama_system_prepare_ipmi { assert_script_run("mount ${root_partition} /mnt"); # Set correct serial console to be able to see login in first boot record_info("Set serial console"); - my $sol_console = (is_aarch64) ? get_var('SERIALCONSOLE', 'ttyAMA0') : get_var('SERIALCONSOLE', 'ttyS1'); - assert_script_run("sed -i 's/quiet/console=$sol_console,115200/g' /mnt/boot/grub2/grub.cfg"); - # Upload original grub configuration + if (is_ipmi) { + my $sol_console = (is_aarch64) ? get_var('SERIALCONSOLE', 'ttyAMA0') : get_var('SERIALCONSOLE', 'ttyS1'); + assert_script_run("sed -i 's/quiet/console=$sol_console,115200/g' /mnt/boot/grub2/grub.cfg"); + # Set permanent grub configuration + assert_script_run("sed -i 's/quiet/console=$sol_console,115200/g' /mnt/etc/default/grub"); + } + if (is_pvm) { + assert_script_run("sed -i 's/quiet/console=hvc0/g' /mnt/boot/grub2/grub.cfg"); + assert_script_run("sed -i 's/quiet/console=hvc0/g' /mnt/etc/default/grub"); + } + # Upload grub configuration files upload_logs("/mnt/etc/default/grub", failok => 1); upload_logs("/mnt/boot/grub2/grub.cfg", failok => 1); - # Set permanent grub configuration - assert_script_run("sed -i 's/quiet/console=$sol_console,115200/g' /mnt/etc/default/grub"); # Enable root ssh access record_info("Enable root ssh login"); assert_script_run("echo 'PermitRootLogin yes' > /mnt/etc/ssh/sshd_config.d/root.conf"); @@ -87,18 +93,19 @@ sub agama_system_prepare_ipmi { sub run { my ($self) = @_; - if (is_ipmi && get_var('AGAMA_AUTO')) { + if ((is_ipmi || is_pvm) && get_var('AGAMA_AUTO')) { select_console('root-console'); record_info 'Wait for installation phase done'; verify_agama_auto_install_done_cmdline(); script_run('agama logs store -d /tmp'); upload_logs('/tmp/agama-logs.tar.gz'); record_info 'Prepare system before rebooting'; - agama_system_prepare_ipmi(); + agama_system_prepare(); record_info 'Reboot system to disk boot'; enter_cmd 'reboot'; # Swith back to sol console, then user can monitor the boot log - select_console 'sol', await_console => 0; + select_console 'sol', await_console => 0 if is_ipmi; + reconnect_mgmt_console if is_pvm; wait_still_screen 10; save_screenshot; return;