From 03d48e9aabb6e358e622a421351eb91e403b6745 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Fri, 17 May 2024 14:57:37 +0000 Subject: [PATCH] test: Unify the different test modes to a smaller number of targets Now that tests in the host's network namespce can be run inside the container, simplify test.mk for increased reusability. --- test/test.mk | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/test/test.mk b/test/test.mk index 69ead495..29bfd32f 100644 --- a/test/test.mk +++ b/test/test.mk @@ -1,36 +1,26 @@ test-dir := $(BR2_EXTERNAL_INFIX_PATH)/test +ninepm := $(BR2_EXTERNAL_INFIX_PATH)/test/9pm/9pm.py UNIT_TESTS ?= $(test-dir)/case/all-repo.yaml $(test-dir)/case/all-unit.yaml INFIX_TESTS ?= $(test-dir)/case/all.yaml +TEST_MODE ?= qeneth +mode-qeneth := -q $(test-dir)/virt/quad +mode-host := -t $(or $(TOPOLOGY),/etc/infamy.dot) +mode-run := -t $(BINARIES_DIR)/qemu.dot +mode := $(mode-$(TEST_MODE)) + binaries-$(ARCH) := $(addprefix infix-$(ARCH),.img -disk.img .pkg) binaries-x86_64 += OVMF.fd binaries := $(foreach bin,$(binaries-$(ARCH)),-f $(BINARIES_DIR)/$(bin)) -test-env-qeneth = $(test-dir)/env $(binaries) -q $(test-dir)/virt/quad $(1) -test-env-run = $(test-dir)/env $(binaries) -C -t $(BINARIES_DIR)/qemu.dot $(1) +test: + $(test-dir)/env $(mode) $(binaries) $(ninepm) $(INFIX_TESTS) -test test-qeneth: - $(call test-env-qeneth,\ - $(BR2_EXTERNAL_INFIX_PATH)/test/9pm/9pm.py \ - $(INFIX_TESTS)) -test-sh test-qeneth-sh: - $(call test-env-qeneth,-i /bin/sh) - -test-run: | ~/.infix-test-venv - $(call test-env-run,\ - $(BR2_EXTERNAL_INFIX_PATH)/test/9pm/9pm.py \ - $(INFIX_TESTS)) -test-run-sh: | ~/.infix-test-venv - $(call test-env-run,/bin/sh) - -test-run-play: | ~/.infix-test-venv - $(call test-env-run,$(test-dir)/case/meta/play.py) - -~/.infix-test-venv: - $(test-dir)/docker/init-venv.sh $(test-dir)/docker/pip-requirements.txt +test-sh: + $(test-dir)/env $(mode) $(binaries) -i /bin/sh test-unit: - $(test-dir)/env $(test-dir)/9pm/9pm.py $(UNIT_TESTS) + $(test-dir)/env $(ninepm) $(UNIT_TESTS) -.PHONY: test test-sh test-qeneth test-qeneth-sh test-run test-run-sh test-run-play test-unit +.PHONY: test test-sh test-unit