summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-11-10 18:33:29 +0100
committerChristian Breunig <christian@breunig.cc>2026-11-10 18:33:29 +0100
commitf2ac8b0d4034438dd0aae46a6984bff12328e191 (patch)
tree4c9513053ca17c40adfa08f917441cc1136de01c /scripts
parent97445025558f23c66e0ce1f5965bb9de84c51465 (diff)
downloadvyos-build-f2ac8b0d4034438dd0aae46a6984bff12328e191.tar.gz
vyos-build-f2ac8b0d4034438dd0aae46a6984bff12328e191.zip
smoketest: T9402: keep resending Home until the GRUB countdown expires
Three unacknowledged Home keys failed the run after about three seconds, although most of the autoboot countdown was still left. A guest stalled for over a second on a loaded host could trigger it. Home is now resent until shortly before the countdown expires and only then counts against the three attempts.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-qemu-install14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install
index 9f2f4eb5..b8ab3f61 100755
--- a/scripts/check-qemu-install
+++ b/scripts/check-qemu-install
@@ -658,21 +658,28 @@ def BOOTLOADERchooseSerialConsole(child, live: bool) -> None:
# The countdown is printed after all menu entries have been drawn.
child.expect(
- rb'The highlighted entry will be executed automatically in \d+s\.',
+ rb'The highlighted entry will be executed automatically in (\d+)s\.',
timeout=120,
)
+ # Until a key is confirmed, an unacknowledged Home is resent without
+ # using up an attempt, as long as the countdown may still be running.
+ autoboot = time.monotonic() + int(child.match.group(1)) - 2
# A missing acknowledgement does not tell us whether the key was received.
# Restart from Home instead of repeating Down from an unknown selection.
- for _ in range(3):
+ attempts = 3
+ while attempts:
if child.eof():
raise RuntimeError('QEMU exited during GRUB menu selection')
# Ctrl-A is Home without the EFI console's escape-sequence parsing.
child.sendcontrol('a')
- # Retry a dropped Home before the 10-second autoboot timeout expires.
if not expectSelected(b'Live system (vyos) - KVM console', timeout=1):
+ if time.monotonic() >= autoboot:
+ attempts -= 1
continue
+ # A received key stops the countdown
+ autoboot = 0
for title in (
b'Live system (vyos fail-safe mode)',
@@ -685,6 +692,7 @@ def BOOTLOADERchooseSerialConsole(child, live: bool) -> None:
else:
child.send(b'\r')
return
+ attempts -= 1
raise RuntimeError('Failed to confirm GRUB serial console boot selection after 3 attempts')
elif live and not args.uefi: