All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/4] Docker testing patches
@ 2016-10-14 15:29 Fam Zheng
  2016-10-14 15:29 ` [Qemu-devel] [PULL 1/4] tests/docker: add travis dockerfile Fam Zheng
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Fam Zheng @ 2016-10-14 15:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Fam Zheng

The following changes since commit c16fe84f07a9d3a04c11ce8a139e13a092b384c2:

  docker: Build in a clean directory (2016-10-02 09:47:23 +0800)

are available in the git repository at:

  git@github.com:famz/qemu tags/for-upstream

for you to fetch changes up to c16fe84f07a9d3a04c11ce8a139e13a092b384c2:

  docker: Build in a clean directory (2016-10-02 09:47:23 +0800)

----------------------------------------------------------------

These are Alex's new tweaks/images/tests.

----------------------------------------------------------------

Alex Bennée (4):
  tests/docker: add travis dockerfile
  tests/docker: test-build script
  tests/docker: make test-mingw honour TARGET_LIST
  tests/docker/Makefile.include: add a generic docker-run target

 tests/docker/Makefile.include          | 61 +++++++++++++++++++++-------------
 tests/docker/dockerfiles/travis.docker |  6 ++++
 tests/docker/test-build                | 20 +++++++++++
 tests/docker/test-mingw                |  3 +-
 4 files changed, 66 insertions(+), 24 deletions(-)
 create mode 100644 tests/docker/dockerfiles/travis.docker
 create mode 100755 tests/docker/test-build

-- 
2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PULL 1/4] tests/docker: add travis dockerfile
  2016-10-14 15:29 [Qemu-devel] [PULL 0/4] Docker testing patches Fam Zheng
@ 2016-10-14 15:29 ` Fam Zheng
  2016-10-14 15:29 ` [Qemu-devel] [PULL 2/4] tests/docker: test-build script Fam Zheng
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2016-10-14 15:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Fam Zheng

From: Alex Bennée <alex.bennee@linaro.org>

This target grabs the latest Travis containers from their repository at
quay.io and then installs QEMU's build dependencies. With this it is
possible to run on broadly the same setup as they have on travis-ci.org.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20161011161625.9070-2-alex.bennee@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/docker/dockerfiles/travis.docker | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 tests/docker/dockerfiles/travis.docker

diff --git a/tests/docker/dockerfiles/travis.docker b/tests/docker/dockerfiles/travis.docker
new file mode 100644
index 0000000..e4983ae
--- /dev/null
+++ b/tests/docker/dockerfiles/travis.docker
@@ -0,0 +1,6 @@
+FROM quay.io/travisci/travis-ruby
+RUN apt-get update
+RUN apt-get -y build-dep qemu
+RUN apt-get -y build-dep device-tree-compiler
+RUN apt-get -y install python2.7 dh-autoreconf
+ENV FEATURES pyyaml
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PULL 2/4] tests/docker: test-build script
  2016-10-14 15:29 [Qemu-devel] [PULL 0/4] Docker testing patches Fam Zheng
  2016-10-14 15:29 ` [Qemu-devel] [PULL 1/4] tests/docker: add travis dockerfile Fam Zheng
@ 2016-10-14 15:29 ` Fam Zheng
  2016-10-14 15:29 ` [Qemu-devel] [PULL 3/4] tests/docker: make test-mingw honour TARGET_LIST Fam Zheng
  2016-10-14 15:29 ` [Qemu-devel] [PULL 4/4] tests/docker/Makefile.include: add a generic docker-run target Fam Zheng
  3 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2016-10-14 15:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Fam Zheng

From: Alex Bennée <alex.bennee@linaro.org>

Much like test-quick but only builds. This is useful for some of the
build targets like ThreadSanitizer that don't yet pass "make check".

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Message-Id: <20161011161625.9070-3-alex.bennee@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/docker/test-build | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100755 tests/docker/test-build

diff --git a/tests/docker/test-build b/tests/docker/test-build
new file mode 100755
index 0000000..031a7d9
--- /dev/null
+++ b/tests/docker/test-build
@@ -0,0 +1,20 @@
+#!/bin/bash -e
+#
+# Quick compile test without the make check step of test-quick.
+#
+# Copyright (c) 2016 Red Hat Inc.
+#
+# Authors:
+#  Fam Zheng <famz@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2
+# or (at your option) any later version. See the COPYING file in
+# the top-level directory.
+
+. common.rc
+
+cd "$BUILD_DIR"
+
+DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"
+TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
+build_qemu
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PULL 3/4] tests/docker: make test-mingw honour TARGET_LIST
  2016-10-14 15:29 [Qemu-devel] [PULL 0/4] Docker testing patches Fam Zheng
  2016-10-14 15:29 ` [Qemu-devel] [PULL 1/4] tests/docker: add travis dockerfile Fam Zheng
  2016-10-14 15:29 ` [Qemu-devel] [PULL 2/4] tests/docker: test-build script Fam Zheng
@ 2016-10-14 15:29 ` Fam Zheng
  2016-10-14 15:29 ` [Qemu-devel] [PULL 4/4] tests/docker/Makefile.include: add a generic docker-run target Fam Zheng
  3 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2016-10-14 15:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Fam Zheng

From: Alex Bennée <alex.bennee@linaro.org>

The other builders honour this variable, so should the mingw build.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20161011161625.9070-4-alex.bennee@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/docker/test-mingw | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/docker/test-mingw b/tests/docker/test-mingw
index 3396876..2adadcb 100755
--- a/tests/docker/test-mingw
+++ b/tests/docker/test-mingw
@@ -16,9 +16,10 @@
 requires mingw dtc
 
 cd "$BUILD_DIR"
+DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"
 
 for prefix in x86_64-w64-mingw32- i686-w64-mingw32-; do
-    TARGET_LIST=x86_64-softmmu,aarch64-softmmu \
+    TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
         build_qemu --cross-prefix=$prefix \
         --enable-trace-backends=simple \
         --enable-debug \
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PULL 4/4] tests/docker/Makefile.include: add a generic docker-run target
  2016-10-14 15:29 [Qemu-devel] [PULL 0/4] Docker testing patches Fam Zheng
                   ` (2 preceding siblings ...)
  2016-10-14 15:29 ` [Qemu-devel] [PULL 3/4] tests/docker: make test-mingw honour TARGET_LIST Fam Zheng
@ 2016-10-14 15:29 ` Fam Zheng
  2016-10-15 13:51   ` Paolo Bonzini
  3 siblings, 1 reply; 8+ messages in thread
From: Fam Zheng @ 2016-10-14 15:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Fam Zheng

From: Alex Bennée <alex.bennee@linaro.org>

This re-factors the docker makefile to include a docker-run target which
can be controlled entirely from environment variables specified on the
make command line. This allows us to run against any given docker image
we may have in our repository, for example:

    make docker-run TEST="test-quick" IMAGE="debian:arm64" \
         EXECUTABLE=./aarch64-linux-user/qemu-aarch64

The existing docker-foo@bar targets still work but the inline
verification has been dropped because we already don't hit that due to
other pattern rules in rules.mak.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Message-Id: <20161011161625.9070-5-alex.bennee@linaro.org>
Message-Id: <20161011161625.9070-6-alex.bennee@linaro.org>
[Squash in the verification removal patch. - Fam]
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/docker/Makefile.include | 61 +++++++++++++++++++++++++++----------------
 1 file changed, 38 insertions(+), 23 deletions(-)

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index b44daab..925f711 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -78,6 +78,7 @@ docker:
 	@echo '                         "IMAGE" is one of the listed container name."'
 	@echo '    docker-image:        Build all images.'
 	@echo '    docker-image-IMAGE:  Build image "IMAGE".'
+	@echo '    docker-run:          For manually running a "TEST" with "IMAGE"'
 	@echo
 	@echo 'Available container images:'
 	@echo '    $(DOCKER_IMAGES)'
@@ -101,31 +102,45 @@ docker:
 	@echo '    NOCACHE=1            Ignore cache when build images.'
 	@echo '    EXECUTABLE=<path>    Include executable in image.'
 
+# This rule if for directly running against an arbitrary docker target.
+# It is called by the expanded docker targets (e.g. make
+# docker-test-foo@bar) which will do additional verification.
+#
+# For example: make docker-run TEST="test-quick" IMAGE="debian:arm64" EXECUTABLE=./aarch64-linux-user/qemu-aarch64
+#
+docker-run: docker-qemu-src
+	@mkdir -p "$(DOCKER_CCACHE_DIR)"
+	@if test -z "$(IMAGE)" || test -z "$(TEST)"; \
+		then echo "Invalid target $(IMAGE)/$(TEST)"; exit 1; \
+	fi
+	$(if $(EXECUTABLE),						\
+		$(call quiet-command,					\
+			$(SRC_PATH)/tests/docker/docker.py update 	\
+			$(IMAGE) $(EXECUTABLE),				\
+			"  COPYING $(EXECUTABLE) to $(IMAGE)"))
+	$(call quiet-command,						\
+		$(SRC_PATH)/tests/docker/docker.py run 			\
+			-t 						\
+			$(if $V,,--rm) 					\
+			$(if $(DEBUG),-i,--net=none) 			\
+			-e TARGET_LIST=$(TARGET_LIST) 			\
+			-e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \
+			-e V=$V -e J=$J -e DEBUG=$(DEBUG)		\
+			-e SHOW_ENV=$(SHOW_ENV) 			\
+			-e CCACHE_DIR=/var/tmp/ccache 			\
+			-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
+			-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z 	\
+			$(IMAGE) 					\
+			/var/tmp/qemu/run 				\
+			$(TEST), "  RUN $(TEST) in ${IMAGE}")
+
+# Run targets:
+#
+# Of the form docker-TEST-FOO@IMAGE-BAR which will then be expanded into a call to "make docker-run"
 docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
 docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
-docker-run-%: docker-qemu-src
-	@mkdir -p "$(DOCKER_CCACHE_DIR)"
-	@if test -z "$(IMAGE)" || test -z "$(CMD)"; \
-		then echo "Invalid target"; exit 1; \
-	fi
-	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
-		$(call quiet-command,\
-			if $(SRC_PATH)/tests/docker/docker.py images | \
-				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
-				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
-				-t \
-				$(if $(DEBUG),-i,--net=none) \
-				-e TARGET_LIST=$(TARGET_LIST) \
-				-e EXTRA_CONFIGURE_OPTS=$(EXTRA_CONFIGURE_OPTS) \
-				-e V=$V -e J=$J -e DEBUG=$(DEBUG) -e SHOW_ENV=$(SHOW_ENV)\
-				-e CCACHE_DIR=/var/tmp/ccache \
-				-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
-				-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \
-				qemu:$(IMAGE) \
-				/var/tmp/qemu/run \
-				$(CMD); \
-			fi \
-			,"RUN","$(CMD) in $(IMAGE)")))
+docker-run-%:
+	@make docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)
 
 docker-clean:
 	$(call quiet-command, $(SRC_PATH)/tests/docker/docker.py clean)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PULL 4/4] tests/docker/Makefile.include: add a generic docker-run target
  2016-10-14 15:29 ` [Qemu-devel] [PULL 4/4] tests/docker/Makefile.include: add a generic docker-run target Fam Zheng
@ 2016-10-15 13:51   ` Paolo Bonzini
  2016-10-15 14:48     ` Alex Bennée
  0 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2016-10-15 13:51 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: Peter Maydell



On 14/10/2016 17:29, Fam Zheng wrote:
> From: Alex Bennée <alex.bennee@linaro.org>
> 
> This re-factors the docker makefile to include a docker-run target which
> can be controlled entirely from environment variables specified on the
> make command line. This allows us to run against any given docker image
> we may have in our repository, for example:
> 
>     make docker-run TEST="test-quick" IMAGE="debian:arm64" \
>          EXECUTABLE=./aarch64-linux-user/qemu-aarch64
> 
> The existing docker-foo@bar targets still work but the inline
> verification has been dropped because we already don't hit that due to
> other pattern rules in rules.mak.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> 
> Message-Id: <20161011161625.9070-5-alex.bennee@linaro.org>
> Message-Id: <20161011161625.9070-6-alex.bennee@linaro.org>
> [Squash in the verification removal patch. - Fam]
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/docker/Makefile.include | 61 +++++++++++++++++++++++++++----------------
>  1 file changed, 38 insertions(+), 23 deletions(-)
> 
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index b44daab..925f711 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -78,6 +78,7 @@ docker:
>  	@echo '                         "IMAGE" is one of the listed container name."'
>  	@echo '    docker-image:        Build all images.'
>  	@echo '    docker-image-IMAGE:  Build image "IMAGE".'
> +	@echo '    docker-run:          For manually running a "TEST" with "IMAGE"'
>  	@echo
>  	@echo 'Available container images:'
>  	@echo '    $(DOCKER_IMAGES)'
> @@ -101,31 +102,45 @@ docker:
>  	@echo '    NOCACHE=1            Ignore cache when build images.'
>  	@echo '    EXECUTABLE=<path>    Include executable in image.'
>  
> +# This rule if for directly running against an arbitrary docker target.
> +# It is called by the expanded docker targets (e.g. make
> +# docker-test-foo@bar) which will do additional verification.
> +#
> +# For example: make docker-run TEST="test-quick" IMAGE="debian:arm64" EXECUTABLE=./aarch64-linux-user/qemu-aarch64
> +#
> +docker-run: docker-qemu-src
> +	@mkdir -p "$(DOCKER_CCACHE_DIR)"
> +	@if test -z "$(IMAGE)" || test -z "$(TEST)"; \
> +		then echo "Invalid target $(IMAGE)/$(TEST)"; exit 1; \
> +	fi
> +	$(if $(EXECUTABLE),						\
> +		$(call quiet-command,					\
> +			$(SRC_PATH)/tests/docker/docker.py update 	\
> +			$(IMAGE) $(EXECUTABLE),				\
> +			"  COPYING $(EXECUTABLE) to $(IMAGE)"))
> +	$(call quiet-command,						\
> +		$(SRC_PATH)/tests/docker/docker.py run 			\
> +			-t 						\
> +			$(if $V,,--rm) 					\
> +			$(if $(DEBUG),-i,--net=none) 			\
> +			-e TARGET_LIST=$(TARGET_LIST) 			\
> +			-e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \
> +			-e V=$V -e J=$J -e DEBUG=$(DEBUG)		\
> +			-e SHOW_ENV=$(SHOW_ENV) 			\
> +			-e CCACHE_DIR=/var/tmp/ccache 			\
> +			-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
> +			-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z 	\
> +			$(IMAGE) 					\
> +			/var/tmp/qemu/run 				\
> +			$(TEST), "  RUN $(TEST) in ${IMAGE}")
> +
> +# Run targets:
> +#
> +# Of the form docker-TEST-FOO@IMAGE-BAR which will then be expanded into a call to "make docker-run"
>  docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
>  docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
> -docker-run-%: docker-qemu-src
> -	@mkdir -p "$(DOCKER_CCACHE_DIR)"
> -	@if test -z "$(IMAGE)" || test -z "$(CMD)"; \
> -		then echo "Invalid target"; exit 1; \
> -	fi
> -	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
> -		$(call quiet-command,\
> -			if $(SRC_PATH)/tests/docker/docker.py images | \
> -				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
> -				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
> -				-t \
> -				$(if $(DEBUG),-i,--net=none) \
> -				-e TARGET_LIST=$(TARGET_LIST) \
> -				-e EXTRA_CONFIGURE_OPTS=$(EXTRA_CONFIGURE_OPTS) \
> -				-e V=$V -e J=$J -e DEBUG=$(DEBUG) -e SHOW_ENV=$(SHOW_ENV)\
> -				-e CCACHE_DIR=/var/tmp/ccache \
> -				-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
> -				-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \
> -				qemu:$(IMAGE) \
> -				/var/tmp/qemu/run \
> -				$(CMD); \
> -			fi \
> -			,"RUN","$(CMD) in $(IMAGE)")))
> +docker-run-%:
> +	@make docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)

This "make" should be $(MAKE), so that some parameters are handled
correctly (e.g. -n/--dry-run) and especially so that parallel make works
correctly.

Thanks,

Paolo

>  docker-clean:
>  	$(call quiet-command, $(SRC_PATH)/tests/docker/docker.py clean)
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PULL 4/4] tests/docker/Makefile.include: add a generic docker-run target
  2016-10-15 13:51   ` Paolo Bonzini
@ 2016-10-15 14:48     ` Alex Bennée
  2016-10-17  2:03       ` Fam Zheng
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Bennée @ 2016-10-15 14:48 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Fam Zheng, qemu-devel, Peter Maydell


Paolo Bonzini <pbonzini@redhat.com> writes:

> On 14/10/2016 17:29, Fam Zheng wrote:
>> From: Alex Bennée <alex.bennee@linaro.org>
>>
>> This re-factors the docker makefile to include a docker-run target which
>> can be controlled entirely from environment variables specified on the
>> make command line. This allows us to run against any given docker image
>> we may have in our repository, for example:
>>
>>     make docker-run TEST="test-quick" IMAGE="debian:arm64" \
>>          EXECUTABLE=./aarch64-linux-user/qemu-aarch64
>>
>> The existing docker-foo@bar targets still work but the inline
>> verification has been dropped because we already don't hit that due to
>> other pattern rules in rules.mak.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>
>> Message-Id: <20161011161625.9070-5-alex.bennee@linaro.org>
>> Message-Id: <20161011161625.9070-6-alex.bennee@linaro.org>
>> [Squash in the verification removal patch. - Fam]
>> Signed-off-by: Fam Zheng <famz@redhat.com>
>> ---
>>  tests/docker/Makefile.include | 61 +++++++++++++++++++++++++++----------------
>>  1 file changed, 38 insertions(+), 23 deletions(-)
>>
>> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
>> index b44daab..925f711 100644
>> --- a/tests/docker/Makefile.include
>> +++ b/tests/docker/Makefile.include
>> @@ -78,6 +78,7 @@ docker:
>>  	@echo '                         "IMAGE" is one of the listed container name."'
>>  	@echo '    docker-image:        Build all images.'
>>  	@echo '    docker-image-IMAGE:  Build image "IMAGE".'
>> +	@echo '    docker-run:          For manually running a "TEST" with "IMAGE"'
>>  	@echo
>>  	@echo 'Available container images:'
>>  	@echo '    $(DOCKER_IMAGES)'
>> @@ -101,31 +102,45 @@ docker:
>>  	@echo '    NOCACHE=1            Ignore cache when build images.'
>>  	@echo '    EXECUTABLE=<path>    Include executable in image.'
>>
>> +# This rule if for directly running against an arbitrary docker target.
>> +# It is called by the expanded docker targets (e.g. make
>> +# docker-test-foo@bar) which will do additional verification.
>> +#
>> +# For example: make docker-run TEST="test-quick" IMAGE="debian:arm64" EXECUTABLE=./aarch64-linux-user/qemu-aarch64
>> +#
>> +docker-run: docker-qemu-src
>> +	@mkdir -p "$(DOCKER_CCACHE_DIR)"
>> +	@if test -z "$(IMAGE)" || test -z "$(TEST)"; \
>> +		then echo "Invalid target $(IMAGE)/$(TEST)"; exit 1; \
>> +	fi
>> +	$(if $(EXECUTABLE),						\
>> +		$(call quiet-command,					\
>> +			$(SRC_PATH)/tests/docker/docker.py update 	\
>> +			$(IMAGE) $(EXECUTABLE),				\
>> +			"  COPYING $(EXECUTABLE) to $(IMAGE)"))
>> +	$(call quiet-command,						\
>> +		$(SRC_PATH)/tests/docker/docker.py run 			\
>> +			-t 						\
>> +			$(if $V,,--rm) 					\
>> +			$(if $(DEBUG),-i,--net=none) 			\
>> +			-e TARGET_LIST=$(TARGET_LIST) 			\
>> +			-e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \
>> +			-e V=$V -e J=$J -e DEBUG=$(DEBUG)		\
>> +			-e SHOW_ENV=$(SHOW_ENV) 			\
>> +			-e CCACHE_DIR=/var/tmp/ccache 			\
>> +			-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
>> +			-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z 	\
>> +			$(IMAGE) 					\
>> +			/var/tmp/qemu/run 				\
>> +			$(TEST), "  RUN $(TEST) in ${IMAGE}")
>> +
>> +# Run targets:
>> +#
>> +# Of the form docker-TEST-FOO@IMAGE-BAR which will then be expanded into a call to "make docker-run"
>>  docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
>>  docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
>> -docker-run-%: docker-qemu-src
>> -	@mkdir -p "$(DOCKER_CCACHE_DIR)"
>> -	@if test -z "$(IMAGE)" || test -z "$(CMD)"; \
>> -		then echo "Invalid target"; exit 1; \
>> -	fi
>> -	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
>> -		$(call quiet-command,\
>> -			if $(SRC_PATH)/tests/docker/docker.py images | \
>> -				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
>> -				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
>> -				-t \
>> -				$(if $(DEBUG),-i,--net=none) \
>> -				-e TARGET_LIST=$(TARGET_LIST) \
>> -				-e EXTRA_CONFIGURE_OPTS=$(EXTRA_CONFIGURE_OPTS) \
>> -				-e V=$V -e J=$J -e DEBUG=$(DEBUG) -e SHOW_ENV=$(SHOW_ENV)\
>> -				-e CCACHE_DIR=/var/tmp/ccache \
>> -				-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
>> -				-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \
>> -				qemu:$(IMAGE) \
>> -				/var/tmp/qemu/run \
>> -				$(CMD); \
>> -			fi \
>> -			,"RUN","$(CMD) in $(IMAGE)")))
>> +docker-run-%:
>> +	@make docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)
>
> This "make" should be $(MAKE), so that some parameters are handled
> correctly (e.g. -n/--dry-run) and especially so that parallel make works
> correctly.

Fam,

Do you want me to re-spin and re-send or are you going to fix up in your
pull request?

>
> Thanks,
>
> Paolo
>
>>  docker-clean:
>>  	$(call quiet-command, $(SRC_PATH)/tests/docker/docker.py clean)
>>


--
Alex Bennée

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PULL 4/4] tests/docker/Makefile.include: add a generic docker-run target
  2016-10-15 14:48     ` Alex Bennée
@ 2016-10-17  2:03       ` Fam Zheng
  0 siblings, 0 replies; 8+ messages in thread
From: Fam Zheng @ 2016-10-17  2:03 UTC (permalink / raw)
  To: Alex Bennée; +Cc: Paolo Bonzini, qemu-devel, Peter Maydell

On Sat, 10/15 15:48, Alex Bennée wrote:
> 
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
> > On 14/10/2016 17:29, Fam Zheng wrote:
> >> From: Alex Bennée <alex.bennee@linaro.org>
> >>
> >> This re-factors the docker makefile to include a docker-run target which
> >> can be controlled entirely from environment variables specified on the
> >> make command line. This allows us to run against any given docker image
> >> we may have in our repository, for example:
> >>
> >>     make docker-run TEST="test-quick" IMAGE="debian:arm64" \
> >>          EXECUTABLE=./aarch64-linux-user/qemu-aarch64
> >>
> >> The existing docker-foo@bar targets still work but the inline
> >> verification has been dropped because we already don't hit that due to
> >> other pattern rules in rules.mak.
> >>
> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> >>
> >> Message-Id: <20161011161625.9070-5-alex.bennee@linaro.org>
> >> Message-Id: <20161011161625.9070-6-alex.bennee@linaro.org>
> >> [Squash in the verification removal patch. - Fam]
> >> Signed-off-by: Fam Zheng <famz@redhat.com>
> >> ---
> >>  tests/docker/Makefile.include | 61 +++++++++++++++++++++++++++----------------
> >>  1 file changed, 38 insertions(+), 23 deletions(-)
> >>
> >> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> >> index b44daab..925f711 100644
> >> --- a/tests/docker/Makefile.include
> >> +++ b/tests/docker/Makefile.include
> >> @@ -78,6 +78,7 @@ docker:
> >>  	@echo '                         "IMAGE" is one of the listed container name."'
> >>  	@echo '    docker-image:        Build all images.'
> >>  	@echo '    docker-image-IMAGE:  Build image "IMAGE".'
> >> +	@echo '    docker-run:          For manually running a "TEST" with "IMAGE"'
> >>  	@echo
> >>  	@echo 'Available container images:'
> >>  	@echo '    $(DOCKER_IMAGES)'
> >> @@ -101,31 +102,45 @@ docker:
> >>  	@echo '    NOCACHE=1            Ignore cache when build images.'
> >>  	@echo '    EXECUTABLE=<path>    Include executable in image.'
> >>
> >> +# This rule if for directly running against an arbitrary docker target.
> >> +# It is called by the expanded docker targets (e.g. make
> >> +# docker-test-foo@bar) which will do additional verification.
> >> +#
> >> +# For example: make docker-run TEST="test-quick" IMAGE="debian:arm64" EXECUTABLE=./aarch64-linux-user/qemu-aarch64
> >> +#
> >> +docker-run: docker-qemu-src
> >> +	@mkdir -p "$(DOCKER_CCACHE_DIR)"
> >> +	@if test -z "$(IMAGE)" || test -z "$(TEST)"; \
> >> +		then echo "Invalid target $(IMAGE)/$(TEST)"; exit 1; \
> >> +	fi
> >> +	$(if $(EXECUTABLE),						\
> >> +		$(call quiet-command,					\
> >> +			$(SRC_PATH)/tests/docker/docker.py update 	\
> >> +			$(IMAGE) $(EXECUTABLE),				\
> >> +			"  COPYING $(EXECUTABLE) to $(IMAGE)"))
> >> +	$(call quiet-command,						\
> >> +		$(SRC_PATH)/tests/docker/docker.py run 			\
> >> +			-t 						\
> >> +			$(if $V,,--rm) 					\
> >> +			$(if $(DEBUG),-i,--net=none) 			\
> >> +			-e TARGET_LIST=$(TARGET_LIST) 			\
> >> +			-e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \
> >> +			-e V=$V -e J=$J -e DEBUG=$(DEBUG)		\
> >> +			-e SHOW_ENV=$(SHOW_ENV) 			\
> >> +			-e CCACHE_DIR=/var/tmp/ccache 			\
> >> +			-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
> >> +			-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z 	\
> >> +			$(IMAGE) 					\
> >> +			/var/tmp/qemu/run 				\
> >> +			$(TEST), "  RUN $(TEST) in ${IMAGE}")
> >> +
> >> +# Run targets:
> >> +#
> >> +# Of the form docker-TEST-FOO@IMAGE-BAR which will then be expanded into a call to "make docker-run"
> >>  docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
> >>  docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
> >> -docker-run-%: docker-qemu-src
> >> -	@mkdir -p "$(DOCKER_CCACHE_DIR)"
> >> -	@if test -z "$(IMAGE)" || test -z "$(CMD)"; \
> >> -		then echo "Invalid target"; exit 1; \
> >> -	fi
> >> -	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
> >> -		$(call quiet-command,\
> >> -			if $(SRC_PATH)/tests/docker/docker.py images | \
> >> -				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
> >> -				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
> >> -				-t \
> >> -				$(if $(DEBUG),-i,--net=none) \
> >> -				-e TARGET_LIST=$(TARGET_LIST) \
> >> -				-e EXTRA_CONFIGURE_OPTS=$(EXTRA_CONFIGURE_OPTS) \
> >> -				-e V=$V -e J=$J -e DEBUG=$(DEBUG) -e SHOW_ENV=$(SHOW_ENV)\
> >> -				-e CCACHE_DIR=/var/tmp/ccache \
> >> -				-v $$(readlink -e $(DOCKER_SRC_COPY)):/var/tmp/qemu:z$(COMMA)ro \
> >> -				-v $(DOCKER_CCACHE_DIR):/var/tmp/ccache:z \
> >> -				qemu:$(IMAGE) \
> >> -				/var/tmp/qemu/run \
> >> -				$(CMD); \
> >> -			fi \
> >> -			,"RUN","$(CMD) in $(IMAGE)")))
> >> +docker-run-%:
> >> +	@make docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)
> >
> > This "make" should be $(MAKE), so that some parameters are handled
> > correctly (e.g. -n/--dry-run) and especially so that parallel make works
> > correctly.

Parallism should terminate here because docker-run is a leaf target. But you are
right about parameters.

> 
> Fam,
> 
> Do you want me to re-spin and re-send or are you going to fix up in your
> pull request?

I'll fix up in my tree and send pull request again.

Fam

> 
> >
> > Thanks,
> >
> > Paolo
> >
> >>  docker-clean:
> >>  	$(call quiet-command, $(SRC_PATH)/tests/docker/docker.py clean)
> >>
> 
> 
> --
> Alex Bennée

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-17  2:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-14 15:29 [Qemu-devel] [PULL 0/4] Docker testing patches Fam Zheng
2016-10-14 15:29 ` [Qemu-devel] [PULL 1/4] tests/docker: add travis dockerfile Fam Zheng
2016-10-14 15:29 ` [Qemu-devel] [PULL 2/4] tests/docker: test-build script Fam Zheng
2016-10-14 15:29 ` [Qemu-devel] [PULL 3/4] tests/docker: make test-mingw honour TARGET_LIST Fam Zheng
2016-10-14 15:29 ` [Qemu-devel] [PULL 4/4] tests/docker/Makefile.include: add a generic docker-run target Fam Zheng
2016-10-15 13:51   ` Paolo Bonzini
2016-10-15 14:48     ` Alex Bennée
2016-10-17  2:03       ` Fam Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.