From 01ea1f76641603e6dc0845ce2bc59c1eab2e8a3f Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 17 Aug 2026 18:44:56 +0000 Subject: Testsuite: T9014: restrict to amd64/arm64 and require --uefi on arm64 QEMU_CONFIG only defines profiles for amd64 and arm64, and arm64 guests only boot via UEFI, so fail fast with a clear message instead of running into an unsupported-architecture error deep into the install. --- scripts/check-qemu-install | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index b3dd8ce6..85d6c024 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -166,6 +166,13 @@ args = parser.parse_args() if os.geteuid() != 0: exit('You need to have root privileges to run this script.') +if platform.machine() not in ['amd64', 'x86_64', 'arm64', 'aarch64']: + exit(f'Unsupported host architecture "{platform.machine()}" - this script ' + 'only runs on amd64 or arm64 hosts.') + +if platform.machine() in ['arm64', 'aarch64'] and not args.uefi: + exit('--uefi is mandatory when running on arm64 hosts.') + if args.cloud_init: hostname = CI_CONFIG_ARGS['hostname'] op_mode_prompt = rf'vyos@{hostname}:~\$' -- cgit v1.2.3 From fa68ae40894c2d9dc743c38ba53982a67a0b03ac Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 17 Aug 2026 18:45:02 +0000 Subject: Makefile: T9014: pass --uefi to check-qemu-install only on arm64 hosts check-qemu-install now requires --uefi on arm64/aarch64. Add a UEFI_FLAG variable derived from ARCH so test targets that didn't already hardcode --uefi pick it up on arm64 while staying unchanged on amd64. --- Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 59faaf29..e9b75d82 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ build_dir := build ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) ISO_PATH := $(build_dir)/live-image-$(ARCH).hybrid.iso +# scripts/check-qemu-install requires --uefi on arm64/aarch64 hosts; on +# amd64 it stays optional. +UEFI_FLAG := $(if $(filter arm64 aarch64,$(ARCH)),--uefi,) + # Test targets forward extra CLI arguments (e.g. `make test -- --match foo`) # to their scripts via $(MAKECMDGOALS). Those extra words are also goals as # far as make is concerned, so without this they'd fall through to the `%:` @@ -49,17 +53,17 @@ test-vpp: .PHONY: testc .ONESHELL: testc: - scripts/check-qemu-install --debug --match="!vpp" --cpu 2 --memory 7 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --match="!vpp" $(UEFI_FLAG) --cpu 2 --memory 7 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: testcvpp .ONESHELL: testcvpp: - scripts/check-qemu-install --debug --match="vpp" --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --match="vpp" $(UEFI_FLAG) --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: testraid .ONESHELL: testraid: - scripts/check-qemu-install --debug --raid --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug $(UEFI_FLAG) --raid --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: testsb .ONESHELL: @@ -69,12 +73,12 @@ testsb: .PHONY: testtpm .ONESHELL: testtpm: - scripts/check-qemu-install --debug --tpmtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug $(UEFI_FLAG) --tpmtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: testifname .ONESHELL: testifname: - scripts/check-qemu-install --debug --ifnametest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug $(UEFI_FLAG) --ifnametest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: test-ci-qcow2 .ONESHELL: @@ -84,17 +88,17 @@ test-ci-qcow2: exit 1 fi rm -f cloud-init-image-$(ARCH).qcow2 ; cp $$(ls -t build/*.qcow2 | head -n 1) cloud-init-image-$(ARCH).qcow2 - scripts/check-qemu-install --debug --cloud-init --disk cloud-init-image-$(ARCH).qcow2 $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug $(UEFI_FLAG) --cloud-init --disk cloud-init-image-$(ARCH).qcow2 $(filter-out $@,$(MAKECMDGOALS)) .PHONY: test-image-update .ONESHELL: test-image-update: - scripts/check-qemu-install --debug --test-image-update --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug $(UEFI_FLAG) --test-image-update --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: qemu-live .ONESHELL: qemu-live: - scripts/check-qemu-install --qemu-cmd --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --qemu-cmd $(UEFI_FLAG) --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: oci .ONESHELL: -- cgit v1.2.3 From 4058d50f7f7680c9fb703fdb24c9fd2b8ca9ad32 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 17 Aug 2026 19:03:38 +0000 Subject: Makefile: T9014: unify test target CPU count and memory size Test targets had inconsistent --cpu (2/4) and --memory (7/8) values hardcoded inline. Standardize on TEST_CPUS and TEST_MEM variables: TEST_CPUS is min(nproc, 4) so hosts with fewer than 4 CPUs don't request more vCPUs than exist; TEST_MEM is 8GB when the host has at least 10GB of RAM, otherwise 4GB. --- Makefile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e9b75d82..6cf32d0c 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,13 @@ ISO_PATH := $(build_dir)/live-image-$(ARCH).hybrid.iso # amd64 it stays optional. UEFI_FLAG := $(if $(filter arm64 aarch64,$(ARCH)),--uefi,) +# Common vCPU count for QEMU test targets, capped at the host's available CPUs +TEST_CPUS := $(shell printf '%s\n' "$$(nproc)" 4 | sort -n | head -n1) + +# Common memory size (GB) for QEMU test targets: 8GB if the host has at +# least 10GB of RAM, otherwise 4GB +TEST_MEM := $(shell awk '/MemTotal/{if ($$2/1024/1024 >= 10) print 8; else print 4}' /proc/meminfo) + # Test targets forward extra CLI arguments (e.g. `make test -- --match foo`) # to their scripts via $(MAKECMDGOALS). Those extra words are also goals as # far as make is concerned, so without this they'd fall through to the `%:` @@ -28,37 +35,37 @@ all: .PHONY: test .ONESHELL: test: - scripts/check-qemu-install --debug --match="$(MATCH)" --smoketest --uefi --cpu 4 --memory 8 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --match="$(MATCH)" --smoketest --uefi --cpu $(TEST_CPUS) --memory $(TEST_MEM) --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: test-no-interfaces .ONESHELL: test-no-interfaces: - scripts/check-qemu-install --debug --smoketest --uefi --no-interfaces --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --smoketest --uefi --no-interfaces --cpu $(TEST_CPUS) --memory $(TEST_MEM) --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: test-no-interfaces-no-vpp .ONESHELL: test-no-interfaces-no-vpp: - scripts/check-qemu-install --debug --smoketest --uefi --no-interfaces --no-vpp --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --smoketest --uefi --no-interfaces --no-vpp --cpu $(TEST_CPUS) --memory $(TEST_MEM) --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: test-interfaces .ONESHELL: test-interfaces: - scripts/check-qemu-install --debug --match="interfaces_" --smoketest --uefi --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --match="interfaces_" --smoketest --uefi --cpu $(TEST_CPUS) --memory $(TEST_MEM) --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: test-vpp .ONESHELL: test-vpp: - scripts/check-qemu-install --debug --match="vpp" --smoketest --uefi --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --match="vpp" --smoketest --uefi --cpu $(TEST_CPUS) --memory $(TEST_MEM) --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: testc .ONESHELL: testc: - scripts/check-qemu-install --debug --match="!vpp" $(UEFI_FLAG) --cpu 2 --memory 7 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --match="!vpp" $(UEFI_FLAG) --cpu $(TEST_CPUS) --memory $(TEST_MEM) --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: testcvpp .ONESHELL: testcvpp: - scripts/check-qemu-install --debug --match="vpp" $(UEFI_FLAG) --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) + scripts/check-qemu-install --debug --match="vpp" $(UEFI_FLAG) --cpu $(TEST_CPUS) --memory $(TEST_MEM) --huge-page-size 2M --huge-page-count 1800 --isolate-cpus 2-3 --configtest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) .PHONY: testraid .ONESHELL: -- cgit v1.2.3 From 44130326e963b8cc94e762e27b966a133446a84a Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 17 Aug 2026 19:23:11 +0000 Subject: Makefile: T9014: add test-suite target to run core testcases sequentially Add test-suite, which runs test-interfaces, test-no-interfaces-no-vpp, testc, testraid, and testifname as separate $(MAKE) invocations so it aborts on the first failing testcase instead of running all of them regardless of earlier failures. --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6cf32d0c..68d06c73 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ TEST_MEM := $(shell awk '/MemTotal/{if ($$2/1024/1024 >= 10) print 8; else print # to their scripts via $(MAKECMDGOALS). Those extra words are also goals as # far as make is concerned, so without this they'd fall through to the `%:` # flavor rule below and run build-vyos-image with garbage arguments. -TEST_TARGETS := test test-no-interfaces test-no-interfaces-no-vpp test-interfaces test-vpp testc testcvpp testraid testsb testtpm testifname test-ci-qcow2 test-image-update qemu-live +TEST_TARGETS := test test-no-interfaces test-no-interfaces-no-vpp test-interfaces test-vpp testc testcvpp testraid testsb testtpm testifname test-ci-qcow2 test-image-update qemu-live test-suite ifneq ($(filter $(TEST_TARGETS),$(firstword $(MAKECMDGOALS))),) $(eval $(filter-out $(firstword $(MAKECMDGOALS)),$(MAKECMDGOALS)):;@:) endif @@ -87,6 +87,17 @@ testtpm: testifname: scripts/check-qemu-install --debug $(UEFI_FLAG) --ifnametest --iso $(ISO_PATH) $(filter-out $@,$(MAKECMDGOALS)) +# Runs each test target as its own $(MAKE) invocation (rather than as +# prerequisites) so make aborts immediately on the first failing testcase +# instead of collecting failures across a parallel-eligible dependency list. +.PHONY: test-suite +test-suite: + $(MAKE) test-interfaces + $(MAKE) test-no-interfaces-no-vpp + $(MAKE) testc + $(MAKE) testraid + $(MAKE) testifname + .PHONY: test-ci-qcow2 .ONESHELL: test-ci-qcow2: -- cgit v1.2.3