From c3becfea464e18a49912eb70f2923ef310d21fa6 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 5 Oct 2026 20:50:09 +0200 Subject: smoketest: T9402: extend timeout for "install image" to finish After the last installer question the QEMU smoketest waits for the operational mode prompt with the default timeout of 60 seconds. Installing GRUB and unmounting the target, which flushes the copied image to disk, can take longer on large images, slow storage or loaded CI hosts. A working install was then reported as failed. Raise this wait to 300 seconds. --- scripts/check-qemu-install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index cbb2c964..08e36142 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -1120,7 +1120,9 @@ try: c.expect('\nWhich file would you like as boot config?.*') c.sendline('') - c.expect(op_mode_prompt) + # GRUB installation and unmounting (flushing the copied squashfs to disk) + # can take longer than the default pexpect timeout on large images + c.expect(op_mode_prompt, timeout=300) if args.sbtest: c.sendline('install mok') -- cgit v1.2.3 From 1abdc8757e997bb2487b463fc3964267c1bc3de0 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 5 Oct 2026 20:50:14 +0200 Subject: smoketest: T9402: stop navigating the installed system's GRUB menu The QEMU smoketest selected the serial console on the installed system by sending timed arrow keys and Enter through the GRUB menus. Under host load those keys raced the five second auto-boot countdown or got lost, so tests failed at random. Earlier fixes only treated symptoms. T8147 doubled the menu timeout. T9099 added checks after each submenu to fail fast. T9214 first sent the first key earlier and then ignored a lost race on the top menu. The installer already makes the serial console the default, and raw images take it from the build flavor, so the default entry boots the right console. The harness now only waits for GRUB and lets it boot. The existing console checks still verify the setting. Live ISO menus are unchanged. --- scripts/check-qemu-install | 70 +++++++++------------------------------------- 1 file changed, 13 insertions(+), 57 deletions(-) (limited to 'scripts') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 08e36142..7a66e5a9 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -567,9 +567,10 @@ def toggleUEFISecureBoot(c): UEFIKeyPress(c, KEY_DOWN) UEFIKeyPress(c, KEY_RETURN) -def BOOTLOADERchooseSerialConsole(child, live: bool, log=None) -> None: - """ Select GRUB boot entry that uses the serial console. This differs - between a LIVE ISO image and an already installed system. """ +def BOOTLOADERchooseSerialConsole(child, live: bool) -> None: + """ Select the boot entry that uses the serial console on a LIVE ISO image. + An already installed system boots its default entry, which already + uses the serial console. """ BOOTLOADER_TMO = 40 BOOTLOADER_SLEEP = 1.5 BOOTLOADER_LOAD_TMO = 5 # let GRUB screen load @@ -616,58 +617,13 @@ def BOOTLOADERchooseSerialConsole(child, live: bool, log=None) -> None: # Wait for GRUB child.expect(GRUB_STRING, timeout=BOOTLOADER_TMO) - # The installed system's top-level menu auto-boots its default - # entry after ~BOOTLOADER_LOAD_TMO seconds, timed from when GRUB - # itself draws the menu - not from when this script's regex match - # on GRUB_STRING returns. Under host load the menu text can reach - # us well after that internal countdown already started, so there - # is no reliable amount of "send a key fast enough" that wins this - # race every time. - # - # That's fine to lose: the installer always answers 'S' (serial) - # to "What console should be used by default?", so the default - # entry GRUB auto-boots already targets the right console. - # waitForLogin()/loginVM(), called after this function returns, - # already tolerate landing straight on the GRUB countdown or the - # login prompt. So treat this submenu navigation as best-effort: - # if we don't land in "Boot options" in time, stop navigating and - # let the default entry (which is already auto-booting) carry on, - # instead of raising and aborting the whole test. - try: - # Select GRUB serial console - # Boot options - child.send(KEY_DOWN) - time.sleep(BOOTLOADER_LOAD_TMO) - child.send(KEY_RETURN) - time.sleep(BOOTLOADER_SLEEP) - # GRUB submenus never time out on their own, so confirm we actually - # landed on this submenu before navigating further - otherwise a - # dropped keypress leaves the VM stuck here until the login wait - # elsewhere expires - child.expect('Select console type', timeout=BOOTLOADER_TMO) - except pexpect.TIMEOUT: - if log is not None: - log.warning('GRUB auto-booted the default entry before "Boot ' - 'options" navigation completed; continuing since ' - 'the default entry already boots the serial ' - 'console selected during install') - else: - # We're inside the submenu, so a timeout past this point is a - # real navigation bug, not the auto-boot race - let it propagate. - # Select console type - child.send(KEY_DOWN) - time.sleep(BOOTLOADER_SLEEP) - child.send(KEY_RETURN) - time.sleep(BOOTLOADER_SLEEP) - child.expect(r'ttyS \(serial\)', timeout=BOOTLOADER_TMO) - - # *ttyS (serial) - child.send(KEY_DOWN) - time.sleep(BOOTLOADER_SLEEP) - child.send(KEY_RETURN) - time.sleep(BOOTLOADER_SLEEP) - # Boot - child.send(KEY_RETURN) + # Do not navigate the installed system's GRUB menu. The installer + # already made the serial console the default (we answer 'S' to + # "What console should be used by default?", raw images get it from + # the build flavor), so the default entry boots the right console. + # Steering the menu with timed keypresses raced GRUB's auto-boot + # countdown and lost keypresses under host load (T8147, T9099, + # T9214). basic_cli_tests() verifies the console settings. return None @@ -1021,7 +977,7 @@ try: log.info('Disable UEFI Secure Boot for initial installation') toggleUEFISecureBoot(c) - BOOTLOADERchooseSerialConsole(c, live=(not args.cloud_init), log=log) + BOOTLOADERchooseSerialConsole(c, live=(not args.cloud_init)) loginVM(c, log) ################################################# @@ -1191,7 +1147,7 @@ try: # Booting installed system ################################################# log.info('Booting installed system') - BOOTLOADERchooseSerialConsole(c, live=False, log=log) + BOOTLOADERchooseSerialConsole(c, live=False) ################################################# # Logging into VyOS system -- cgit v1.2.3