From 0313545cc53b3d06438215bd8a1b537cfadacd0a Mon Sep 17 00:00:00 2001 From: Alvaro Carvajal Date: Thu, 14 Nov 2024 12:10:08 +0100 Subject: [PATCH] Add setting to force install from MIRROR_HTTP on PXE boot This commit introduces the setting *FORCE_INSTALL_FROM_MIRROR_HTTP*, which when set to true forces `boot/boot_from_pxe` to install the SUT from the URL contained in *MIRROR_HTTP* (grub boot `install=` argument) even when running in workers with a closer mirror. Idea behind this is to allow workers to specify a combination of *PXE_PRODUCT_NAME* and *MIRROR_HTTP* settings which will lead to a proper installation of a product/build under test. --- tests/boot/boot_from_pxe.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/boot/boot_from_pxe.pm b/tests/boot/boot_from_pxe.pm index ef5fc10a5263..259285c9255c 100644 --- a/tests/boot/boot_from_pxe.pm +++ b/tests/boot/boot_from_pxe.pm @@ -126,7 +126,9 @@ sub run { $image_name = get_var('PXE_PRODUCT_NAME') if get_var('PXE_PRODUCT_NAME'); $image_path = "/mounts/dist/install/SLP/${image_name}/${arch}/DVD1/boot/${arch}/loader/linux "; $image_path .= "initrd=/mounts/dist/install/SLP/${image_name}/${arch}/DVD1/boot/${arch}/loader/initrd "; - $image_path .= "install=http://mirror.suse.cz/install/SLP/${image_name}/${arch}/DVD1$device "; + my $install_path = "install=http://mirror.suse.cz/install/SLP/${image_name}/${arch}/DVD1$device "; + $install_path = 'install=' . get_required_var('MIRROR_HTTP') . "$device " if (get_var('FORCE_INSTALL_FROM_MIRROR_HTTP')); + $image_path .= $install_path; } } elsif (match_has_tag('pxe-menu')) { @@ -185,6 +187,11 @@ sub run { die 'PXE boot failed, installation repository likely does not exist' if (check_screen('pxe-kernel-not-found', timeout => 5)); + # Click 'Yes' if prompted to download a matching boot image + if (get_var('PXE_PRODUCT_NAME') && get_var('FORCE_INSTALL_FROM_MIRROR_HTTP')) { + send_key 'ret' if (check_screen('download-matching-boot-image', 420)); + } + if (is_ipmi && !get_var('AUTOYAST')) { my $ssh_vnc_wait_time = 420; my $ssh_vnc_tag = eval { check_var('VIDEOMODE', 'text') ? 'sshd' : 'vnc' } . '-server-started';