From 4b2c6bc563c13f242d92fe4f8f31d22b31788858 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 13 Oct 2017 09:19:54 +0800 Subject: [PATCH 1/5] docker: Don't allocate tty unless DEBUG=1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existence of tty in the container seems to urge gcc into colorizing the errors, but the escape chars will clutter the report once turned into email replies on patchew. Move -t to debug mode. Reported-by: Eric Blake Signed-off-by: Fam Zheng Message-Id: <20171013011954.9975-1-famz@redhat.com> Reviewed-by: Alex Bennée Signed-off-by: Fam Zheng --- tests/docker/Makefile.include | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 6f9ea196a7..ab939f2bec 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -134,10 +134,10 @@ docker-run: docker-qemu-src " COPYING $(EXECUTABLE) to $(IMAGE)")) $(call quiet-command, \ $(SRC_PATH)/tests/docker/docker.py run \ - $(if $(NOUSER),,-u $(shell id -u)) -t \ + $(if $(NOUSER),,-u $(shell id -u)) \ --security-opt seccomp=unconfined \ $(if $V,,--rm) \ - $(if $(DEBUG),-i,) \ + $(if $(DEBUG),-ti,) \ $(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \ -e TARGET_LIST=$(TARGET_LIST) \ -e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \ From 08c3f6d57f9a95036eed1eea0571eb47605aaef4 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Tue, 17 Oct 2017 15:12:46 +0800 Subject: [PATCH 2/5] docker: cleanup temp directory after test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are temp directories named "docker-src.*" after doing docker tests. I don't see much point in keeping that (it only contains the qemu.tar which is exactly current tree, and the copied "run" file). Let's remove it after test finished. CC: "Alex Bennée" CC: Fam Zheng CC: "Philippe Mathieu-Daudé" Signed-off-by: Peter Xu Message-Id: <20171017071247.32355-1-peterx@redhat.com> Reviewed-by: Fam Zheng Signed-off-by: Fam Zheng --- tests/docker/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index ab939f2bec..38874ec03d 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -151,6 +151,8 @@ docker-run: docker-qemu-src $(IMAGE) \ /var/tmp/qemu/run \ $(TEST), " RUN $(TEST) in ${IMAGE}") + $(call quiet-command, rm -r $(DOCKER_SRC_COPY), \ + " CLEANUP $(DOCKER_SRC_COPY)") # Run targets: # From bc739b8e7d02c8010a5ab0a5f4d6ed99c1bb1d37 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 18 Oct 2017 15:06:29 +0200 Subject: [PATCH 3/5] docker: allow running from srcdir != builddir build The new script uses "git submodule", which is picky about being invoked from the top of the git checkout. Invoke the script from $(SRC_PATH) to avoid git's wrath. Fixes: b7f404201e45e99da23b9764dec27ce5f965cdcd Cc: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <1508331989-142364-1-git-send-email-pbonzini@redhat.com> Reviewed-by: Daniel P. Berrange Signed-off-by: Fam Zheng --- tests/docker/Makefile.include | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 38874ec03d..02cd520590 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -18,11 +18,11 @@ TESTS ?= % IMAGES ?= % CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$) -DOCKER_SRC_COPY := docker-src.$(CUR_TIME) +DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME) $(DOCKER_SRC_COPY): @mkdir $@ - $(call quiet-command, $(SRC_PATH)/scripts/archive-source.sh $@/qemu.tar, \ + $(call quiet-command, cd $(SRC_PATH) && scripts/archive-source.sh $@/qemu.tar, \ "GEN", "$@/qemu.tar") $(call quiet-command, cp $(SRC_PATH)/tests/docker/run $@/run, \ "COPY","RUNNER") From 1dc1700a60ece53c77d0e396c92b5acff9d66bf2 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Thu, 19 Oct 2017 13:40:42 +0200 Subject: [PATCH 4/5] docker: fix out-of-tree 'make docker-test-build@debian-powerpc-cross' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this patch, it fails with: IOError: [Errno 2] No such file or directory: 'tests/docker/dockerfiles/debian-apt-fake.sh' Signed-off-by: Greg Kurz Message-Id: <150841324224.31292.4012464539983692364.stgit@bahia.lan> Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Fam Zheng --- tests/docker/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 02cd520590..f1a398e9fa 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -44,7 +44,7 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker $(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)),\ "BUILD","$*") -docker-image-debian-powerpc-cross: EXTRA_FILES:=tests/docker/dockerfiles/debian-apt-fake.sh +docker-image-debian-powerpc-cross: EXTRA_FILES:=$(SRC_PATH)/tests/docker/dockerfiles/debian-apt-fake.sh # Enforce dependancies for composite images docker-image-debian: docker-image-debian9 From 6a2e11974fa6c4eaee6b2b156b1b4e03ca983bab Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Wed, 18 Oct 2017 15:38:41 +0800 Subject: [PATCH 5/5] docker: Fix PATH for ccache Before bcd7f06f57fb6f780a3e2f7a46c22b6f6c8238aa we source /etc/profile so the PATH included the right paths to ccache binaries. Now we need to update $PATH explicitly from run script. Keep the old /usr/lib around just so that in the future, ccache from 32 bit images will just work. Signed-off-by: Fam Zheng Message-Id: <20171018073841.30062-1-famz@redhat.com> Signed-off-by: Fam Zheng --- tests/docker/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker/run b/tests/docker/run index 642084bcb8..9dd362bb98 100755 --- a/tests/docker/run +++ b/tests/docker/run @@ -18,7 +18,7 @@ fi BASE="$(dirname $(readlink -e $0))" # Prepare the environment -export PATH=/usr/lib/ccache:$PATH +export PATH=/usr/lib/ccache:/usr/lib64/ccache:$PATH if test -n "$J"; then export MAKEFLAGS="$MAKEFLAGS -j$J"