aboutsummaryrefslogtreecommitdiff
path: root/tests/docker
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2016-07-19 21:20:44 +0800
committerFam Zheng <famz@redhat.com>2016-07-20 19:19:43 +0800
commitff31e2256d7c984d3c4aa06f38ecd54c5138549d (patch)
tree1c40ed2693fcc975420cd588121f5ca5927e1629 /tests/docker
parent4b08af6019ab9c5cb78cb910a42d27a2d441f7fe (diff)
downloadqemu-ff31e2256d7c984d3c4aa06f38ecd54c5138549d.zip
qemu-ff31e2256d7c984d3c4aa06f38ecd54c5138549d.tar.gz
qemu-ff31e2256d7c984d3c4aa06f38ecd54c5138549d.tar.bz2
docker: Don't start a container that doesn't exist
Image building targets are dependencies of test running targets, so when a docker image doesn't exist, it means it's skipped (due to dependency checks in pre script). Therefore, skip the test too. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1468934445-32183-10-git-send-email-famz@redhat.com
Diffstat (limited to 'tests/docker')
-rw-r--r--tests/docker/Makefile.include6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index c5546ee..e7f0023 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -105,7 +105,10 @@ docker-run-%: docker-qemu-src
fi
$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
$(call quiet-command,\
- $(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
+ if $(SRC_PATH)/tests/docker/docker.py images \
+ --format={{.Repository}}:{{.Tag}} | \
+ grep -qx qemu:$(IMAGE); then \
+ $(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
-t \
$(if $(DEBUG),-i,--net=none) \
-e TARGET_LIST=$(TARGET_LIST) \
@@ -117,6 +120,7 @@ docker-run-%: docker-qemu-src
qemu:$(IMAGE) \
/var/tmp/qemu/run \
$(CMD); \
+ fi \
, " RUN $(CMD) in $(IMAGE)")))
docker-clean: