aboutsummaryrefslogtreecommitdiff
path: root/tests/docker/Makefile.include
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2021-02-02 13:39:51 +0000
committerAlex Bennée <alex.bennee@linaro.org>2021-02-08 09:41:00 +0000
commitddd5ed8331652cd77546c331caee49d76fffe4a4 (patch)
treea65ce4c2136184730fc82191714f681aa8f04b74 /tests/docker/Makefile.include
parent6147c2495d1a362cb78cdbd6a321ddae31e13f9d (diff)
downloadqemu-ddd5ed8331652cd77546c331caee49d76fffe4a4.zip
qemu-ddd5ed8331652cd77546c331caee49d76fffe4a4.tar.gz
qemu-ddd5ed8331652cd77546c331caee49d76fffe4a4.tar.bz2
tests/docker: add a docker-exec-copy-test
This provides test machinery for checking the QEMU copying logic works properly. It takes considerably less time to run than starting a debootstrap only for it to fail later. I considered adding a remove command to docker.py but figured that might be gold plating given the relative size of the containers compared to the ones with actual stuff in them. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210202134001.25738-7-alex.bennee@linaro.org>
Diffstat (limited to 'tests/docker/Makefile.include')
-rw-r--r--tests/docker/Makefile.include20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index a5c1e4a..93b29ad 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -11,7 +11,7 @@ HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m))
DOCKER_SUFFIX := .docker
DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles
# we don't run tests on intermediate images (used as base by another image)
-DOCKER_PARTIAL_IMAGES := debian10 debian11 debian-bootstrap
+DOCKER_PARTIAL_IMAGES := debian10 debian11 debian-bootstrap empty
DOCKER_IMAGES := $(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker))))
DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES))
# Use a global constant ccache directory to speed up repetitive builds
@@ -92,6 +92,24 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
{ echo "You will need to build $(EXECUTABLE)"; exit 1;},\
"CHECK", "debian-$* exists"))
+# These are test targets
+USER_TCG_TARGETS=$(patsubst %-linux-user,qemu-%,$(filter %-linux-user,$(TARGET_DIRS)))
+EXEC_COPY_TESTS=$(patsubst %,docker-exec-copy-test-%, $(USER_TCG_TARGETS))
+
+$(EXEC_COPY_TESTS): docker-exec-copy-test-%: $(DOCKER_FILES_DIR)/empty.docker
+ $(call quiet-command, \
+ $(DOCKER_SCRIPT) build -t qemu/exec-copy-test-$* -f $< \
+ $(if $V,,--quiet) --no-cache \
+ --include-executable=$* \
+ --skip-binfmt, \
+ "TEST","copy $* to container")
+ $(call quiet-command, \
+ $(DOCKER_SCRIPT) run qemu/exec-copy-test-$* \
+ /$* -version > tests/docker-exec-copy-test-$*.out, \
+ "TEST","check $* works in container")
+
+docker-exec-copy-test: $(EXEC_COPY_TESTS)
+
endif
# Enforce dependencies for composite images