Skip to content

Commit 2d525e9

Browse files
committed
Testsuite: T9099: harden GRUB console-select navigation with expect() checks
BOOTLOADERchooseSerialConsole() sent fixed DOWN/ENTER keystrokes with blind sleeps to navigate the post-install GRUB "Boot options" and "Select console type" submenus. Under host load, a dropped keystroke could land navigation one level too deep (e.g. "Select boot mode" instead of "Select console type"). GRUB submenus never time out on their own, so the VM sat there until the unrelated 600s login wait in loginVM() expired, producing a confusing pexpect.TIMEOUT far from the real cause. Add child.expect() checks after each submenu transition to confirm the expected menu actually rendered before sending the next keypress, so a misnavigation now fails fast and points at the right step.
1 parent 7a0ba32 commit 2d525e9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/check-qemu-install

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,11 +599,19 @@ def BOOTLOADERchooseSerialConsole(child, live: bool) -> None:
599599
time.sleep(BOOTLOADER_SLEEP)
600600
child.send(KEY_RETURN)
601601
time.sleep(BOOTLOADER_SLEEP)
602+
# GRUB submenus never time out on their own, so confirm we actually
603+
# landed on this submenu before navigating further - otherwise a
604+
# dropped keypress leaves the VM stuck here until the login wait
605+
# elsewhere expires
606+
child.expect('Select console type', timeout=BOOTLOADER_TMO)
607+
602608
# Select console type
603609
child.send(KEY_DOWN)
604610
time.sleep(BOOTLOADER_SLEEP)
605611
child.send(KEY_RETURN)
606612
time.sleep(BOOTLOADER_SLEEP)
613+
child.expect(r'ttyS \(serial\)', timeout=BOOTLOADER_TMO)
614+
607615
# *ttyS (serial)
608616
child.send(KEY_DOWN)
609617
time.sleep(BOOTLOADER_SLEEP)

0 commit comments

Comments
 (0)