Skip to content

Commit 51ee73e

Browse files
authored
Merge pull request #1247 from c-po/smoketest-fixes
T9099: improve test framework - add safeguards
2 parents c8a5554 + 2d525e9 commit 51ee73e

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ build_dir := build
44
ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
55
ISO_PATH := $(build_dir)/live-image-$(ARCH).hybrid.iso
66

7+
# Test targets forward extra CLI arguments (e.g. `make test -- --match foo`)
8+
# to their scripts via $(MAKECMDGOALS). Those extra words are also goals as
9+
# far as make is concerned, so without this they'd fall through to the `%:`
10+
# flavor rule below and run build-vyos-image with garbage arguments.
11+
TEST_TARGETS := test test-no-interfaces test-no-interfaces-no-vpp test-interfaces test-vpp testc testcvpp testraid testsb testtpm test-ci-qcow2 test-image-update qemu-live
12+
ifneq ($(filter $(TEST_TARGETS),$(firstword $(MAKECMDGOALS))),)
13+
$(eval $(filter-out $(firstword $(MAKECMDGOALS)),$(MAKECMDGOALS)):;@:)
14+
endif
15+
716
.PHONY: all
817
all:
918
@echo "Make what specifically?"

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)