From 2d525e9a88fea6a384425f724e315578c754cd8f Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 17 Jul 2026 13:20:01 +0200 Subject: 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. --- scripts/check-qemu-install | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 0929ea02..684f135f 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -599,11 +599,19 @@ def BOOTLOADERchooseSerialConsole(child, live: bool) -> None: time.sleep(BOOTLOADER_SLEEP) 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) + # 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) -- cgit v1.2.3