From 52545806a3b883698fa3bee89998c0c389c17486 Mon Sep 17 00:00:00 2001 From: rfan1 Date: Sun, 23 Feb 2025 18:31:15 -0500 Subject: [PATCH] Add register to proxy scc support for Agama https://progress.opensuse.org/issues/177729 --- lib/bootloader_pvm.pm | 4 ++-- lib/bootloader_setup.pm | 8 ++++---- lib/registration.pm | 4 ++-- tests/console/system_prepare.pm | 24 ------------------------ tests/installation/bootloader_zkvm.pm | 4 ++-- tests/installation/ipxe_install.pm | 10 +++++++--- 6 files changed, 17 insertions(+), 37 deletions(-) diff --git a/lib/bootloader_pvm.pm b/lib/bootloader_pvm.pm index 40b84ce1165b..fb581dc58ce0 100644 --- a/lib/bootloader_pvm.pm +++ b/lib/bootloader_pvm.pm @@ -125,7 +125,7 @@ sub enter_netboot_parameters { my $ntlm_p = get_var('NTLM_AUTH_INSTALL') ? $ntlm_auth::ntlm_proxy : ''; 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 + # inst.auto and inst.install_url are defined in below function specific_bootmenu_params; type_string_slow " " . get_var('EXTRABOOTPARAMS') if (get_var('EXTRABOOTPARAMS')); } @@ -137,10 +137,10 @@ sub enter_netboot_parameters { 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; } + registration_bootloader_params(utils::VERY_SLOW_TYPING_SPEED) unless get_var('NTLM_AUTH_INSTALL'); type_string_slow " fips=1" if (get_var('FIPS_INSTALLATION')); type_string_slow " UPGRADE=1" if (get_var('UPGRADE')); diff --git a/lib/bootloader_setup.pm b/lib/bootloader_setup.pm index b3e69b041c6b..3ca5489ee0fe 100644 --- a/lib/bootloader_setup.pm +++ b/lib/bootloader_setup.pm @@ -630,8 +630,8 @@ sub bootmenu_default_params { if (get_var('REPO_0')) { my $host = get_var('OPENQA_HOST', 'https://openqa.opensuse.org'); my $repo = get_var('REPO_0'); - # agama.install_url supports comma separated list if more repos are needed ... - push @params, "agama.install_url=$host/assets/repo/$repo"; + # inst.install_url supports comma separated list if more repos are needed ... + push @params, "inst.install_url=$host/assets/repo/$repo"; } push @params, "live.password=$testapi::password"; } @@ -888,11 +888,11 @@ sub specific_bootmenu_params { if (my $agama_auto = get_var('AGAMA_AUTO')) { my $url = autoyast::expand_agama_profile($agama_auto); $url = shorten_url($url) if (is_backend_s390x && !is_opensuse); - push @params, "agama.auto=$url"; + push @params, "inst.auto=$url inst.finish=stop"; } if (my $agama_install_url = get_var('AGAMA_INSTALL_URL')) { - push @params, "agama.install_url=$agama_install_url"; + push @params, "inst.install_url=$agama_install_url"; } # Boot the system with the debug options if shutdown takes suspiciously long time. diff --git a/lib/registration.pm b/lib/registration.pm index e3d43feafc2f..3236dd9be65c 100644 --- a/lib/registration.pm +++ b/lib/registration.pm @@ -12,7 +12,7 @@ use Utils::Architectures; use Utils::Backends qw(is_qemu); use serial_terminal 'select_serial_terminal'; use utils qw(addon_decline_license assert_screen_with_soft_timeout zypper_call systemctl handle_untrusted_gpg_key quit_packagekit script_retry script_output_retry wait_for_purge_kernels); -use version_utils qw(is_sle is_sles4sap is_upgrade is_leap_migration is_sle_micro is_hpc is_jeos is_transactional is_staging); +use version_utils qw(is_sle is_sles4sap is_upgrade is_leap_migration is_sle_micro is_hpc is_jeos is_transactional is_staging is_agama); use transactional qw(trup_call process_reboot); use constant ADDONS_COUNT => 50; use y2_module_consoletest; @@ -750,7 +750,7 @@ sub registration_bootloader_cmdline { set_var('SCC_URL', 'https://scc.suse.com') unless get_var('SCC_URL'); my $cmdline = ''; if (my $url = get_var('SMT_URL') || get_var('SCC_URL')) { - $cmdline .= " regurl=$url"; + $cmdline .= is_agama ? " inst.register_url=$url" : " regurl=$url"; $cmdline .= " regcert=$url" if get_var('SCC_CERT'); } return $cmdline; diff --git a/tests/console/system_prepare.pm b/tests/console/system_prepare.pm index 763a3d0592aa..099d3dbe6adf 100644 --- a/tests/console/system_prepare.pm +++ b/tests/console/system_prepare.pm @@ -123,30 +123,6 @@ sub run { # stop and disable PackageKit quit_packagekit; - ######## - # Workaround to install sle16 in beta1 - # Don't register the system during the installation and use daily build as install url - # Register the system once installation done - if (is_agama && is_sle) { - zypper_call('in suseconnect-ng'); - record_info "agama pscc register"; - my $regcode = (get_var('AGAMA_PRODUCT_ID') =~ /SAP/) ? get_var('SCC_REGCODE_SLES4SAP') : get_var('SCC_REGCODE'); - my $regurl = get_var('SCC_URL'); - assert_script_run("suseconnect -r $regcode --url $regurl"); - - # Register HA extension and output some debug info for reference - if (get_var('SCC_ADDONS', '') eq 'ha') { - record_info('Register HA extension'); - command_register(get_required_var('VERSION'), 'ha', get_required_var('SCC_REGCODE_HA')); - # Just for debug purpose - zypper_call('up', timeout => 600); - record_info('REPOS', script_output('zypper lr -u')); - record_info('PKGs', script_output('zypper se ha | grep -i high')); - record_info('PATTERNS', script_output('zypper patterns')); - } - } - ######## - } sub test_flags { diff --git a/tests/installation/bootloader_zkvm.pm b/tests/installation/bootloader_zkvm.pm index dde98e5b6c08..cfdbfab29e2b 100644 --- a/tests/installation/bootloader_zkvm.pm +++ b/tests/installation/bootloader_zkvm.pm @@ -48,9 +48,9 @@ sub set_svirt_domain_elements { } $cmdline .= ' ' . get_var("EXTRABOOTPARAMS") if get_var("EXTRABOOTPARAMS"); - # agama.auto and agama.install_url are defined in 'specific_bootmenu_params' + # inst.auto and inst.install_url are defined in 'specific_bootmenu_params' $cmdline .= specific_bootmenu_params; - $cmdline .= registration_bootloader_cmdline if check_var('SCC_REGISTER', 'installation') && !get_var('NTLM_AUTH_INSTALL') && !(is_agama); + $cmdline .= registration_bootloader_cmdline if check_var('SCC_REGISTER', 'installation') && !get_var('NTLM_AUTH_INSTALL'); $svirt->change_domain_element(os => initrd => "$zkvm_img_path/$name.initrd"); $svirt->change_domain_element(os => kernel => "$zkvm_img_path/$name.kernel"); diff --git a/tests/installation/ipxe_install.pm b/tests/installation/ipxe_install.pm index 5af0f59d5a5f..ef725a85fe46 100644 --- a/tests/installation/ipxe_install.pm +++ b/tests/installation/ipxe_install.pm @@ -185,14 +185,18 @@ sub set_bootscript_agama_cmdline_extra { my $cmdline_extra = " "; if (my $agama_auto = get_var('AGAMA_AUTO')) { my $agama_auto_url = autoyast::expand_agama_profile($agama_auto); - $cmdline_extra .= "agama.auto=$agama_auto_url "; + $cmdline_extra .= "inst.auto=$agama_auto_url inst.finish=stop "; } # Agama Installation repository URL # By default Agama installs the packages from the repositories specified in the product configuration. - # From now Agama supports using the agama.install_url boot parameter for overriding the default installation repositories. + # From now Agama supports using the inst.install_url boot parameter for overriding the default installation repositories. if (my $agama_install_url = get_var('AGAMA_INSTALL_URL')) { $agama_install_url =~ s/^\s+|\s+$//g; - $cmdline_extra .= "agama.install_url=$agama_install_url "; + $cmdline_extra .= "inst.install_url=$agama_install_url "; + } + # Add register URL + if (my $register_url = get_var('SCC_URL')) { + $cmdline_extra .= "inst.register_url=$register_url "; } if (is_ipmi) { my $ipxe_console = get_required_var('IPXE_CONSOLE');