From patchwork Tue Jul 19 09:58:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 72284 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp589125qga; Tue, 19 Jul 2016 03:07:37 -0700 (PDT) X-Received: by 10.55.162.1 with SMTP id l1mr20648997qke.176.1468922857614; Tue, 19 Jul 2016 03:07:37 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 94si19142631qkw.327.2016.07.19.03.07.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Jul 2016 03:07:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPRw9-0004tv-8Y for patch@linaro.org; Tue, 19 Jul 2016 06:07:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPRn7-0001xv-GT for qemu-devel@nongnu.org; Tue, 19 Jul 2016 05:58:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPRn1-0004F9-KZ for qemu-devel@nongnu.org; Tue, 19 Jul 2016 05:58:16 -0400 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:36458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPRn0-0004Eo-MQ for qemu-devel@nongnu.org; Tue, 19 Jul 2016 05:58:11 -0400 Received: by mail-wm0-x22a.google.com with SMTP id q128so13703813wma.1 for ; Tue, 19 Jul 2016 02:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=3ngcdD85txTivrvEcKRdwyiavBiywM0NPoHZTm7MmDo=; b=W0X4+T732Y1pQYOP0O7s9OAwm4rpPKhxgkbas2bv2xSn1pTdb9uSHtl25r//zpo6Dx 6Ce6/dVhweky1EF1l9ILze+a/Yg6GeGJ0kdbqoDmKT0BQ4JvGzNKBt0bsjetwbZ8eGlr 6lOhbRQsRtHNCyCzUCRGutdOhu/1yWwD1HFsM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=3ngcdD85txTivrvEcKRdwyiavBiywM0NPoHZTm7MmDo=; b=A2FnukRcRfr3Fs6Yg/OJKZ5z09i6Pn4Yvr5kuWMldGcIJv+Q545GdT3y6pl1S4iwwI E0ykFms+5tEm5/AsJthq5tMaA80Xdx33cLkgIGgjboD/Qf7CV8os8I/sFLCH/mISVo+5 qRyircv9UmcJIa4I58T34WRRILpZEPrnVFj7RpYdKEpvnN59rbeEq3IAOVhiJEGH7CcG v30dY/yHwAx6G7y8Ap7ha0MbBCBsu8nxsYU4cCkzrHMXmOSFq0uDUjTRZG+kuY1FAbe0 046KBpAgz0VR90o+c/U25HlTTfZHnA0njYro5BNqUyUXVFrODZrL6zEUIK7SCdxnt0rm 94zQ== X-Gm-Message-State: ALyK8tLNRqEI+6leq5nBKjsL3aTIHCCMrOCFLQ1uw2w2Wiw9CyUU1kev6m+gTD+4QZj21fOm X-Received: by 10.28.50.199 with SMTP id y190mr2837468wmy.61.1468922289785; Tue, 19 Jul 2016 02:58:09 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e65sm2629024wmg.3.2016.07.19.02.58.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 02:58:08 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id 3C3C03E0404; Tue, 19 Jul 2016 10:58:11 +0100 (BST) References: <1468916208-18668-1-git-send-email-famz@redhat.com> User-agent: mu4e 0.9.17; emacs 25.0.95.10 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Fam Zheng In-reply-to: <1468916208-18668-1-git-send-email-famz@redhat.com> Date: Tue, 19 Jul 2016 10:58:11 +0100 Message-ID: <87k2gilzkc.fsf@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22a Subject: Re: [Qemu-devel] [PATCH v6 0/8] docker: Support building qemu-user powered docker test images X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Fam Zheng writes: > v6: A few tweaks to make this more mergable. Including: > - Add and catch magic pre script exit code "3" to allow skipping image. > - Tweak debian-bootstrap.pre to return '3' when appropriate (It should > still return 1 for debootstrap command failure). > - Fix "realpath" to "readlink -e" to be compatible with centos6. > - Add the last patch to skip test if the image is skipped by .pre. > > Alex, if this looks good to you, I can send a pull req today. If you could apply the following changes to the appropriate patches I think we are good to go: > > Alex Bennée (5): > tests/docker/docker.py: docker_dir outside build > tests/docker/docker.py: support --include-executable > tests/docker/docker.py: check and run .pre script > tests/docker/dockerfiles: new debian-bootstrap.docker > tests/docker/docker.py: add update operation > > Fam Zheng (3): > docker: More sensible run script > docker: Fix exit code if $CMD failed > docker: Don't start a container that doesn't exist > > tests/docker/Makefile.include | 9 +- > tests/docker/docker.py | 150 +++++++++++++++++++++-- > tests/docker/dockerfiles/debian-bootstrap.docker | 21 ++++ > tests/docker/dockerfiles/debian-bootstrap.pre | 87 +++++++++++++ > tests/docker/run | 16 ++- > 5 files changed, 267 insertions(+), 16 deletions(-) > create mode 100644 tests/docker/dockerfiles/debian-bootstrap.docker > create mode 100755 tests/docker/dockerfiles/debian-bootstrap.pre -- Alex Bennée diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 2bb8a51..d85f50f 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -46,7 +46,8 @@ docker-image: ${DOCKER_TARGETS} docker-image-%: $(DOCKER_FILES_DIR)/%.docker $(call quiet-command,\ $(SRC_PATH)/tests/docker/docker.py build qemu:$* $< \ - $(if $V,,--quiet) $(if $(NOCACHE),--no-cache),\ + $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \ + $(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)),\ " BUILD $*") # Expand all the pre-requistes for each docker image and test combination @@ -95,6 +96,7 @@ docker: @echo ' DEBUG=1 Stop and drop to shell in the created container' @echo ' before running the command.' @echo ' NOCACHE=1 Ignore cache when build images.' + @echo ' EXECUTABLE= Include executable in image.' docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/') docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/') diff --git a/tests/docker/docker.py b/tests/docker/docker.py index fd162c0..40bda9d 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -238,7 +238,7 @@ class BuildCommand(SubCommand): if rc == 3: print "Skip" return 0 - else: + elif rc != 0: print "%s exited with code %d" % (docker_pre, rc) return 1 diff --git a/tests/docker/dockerfiles/debian-bootstrap.pre b/tests/docker/dockerfiles/debian-bootstrap.pre index 55850be..5d9c8d5 100755 --- a/tests/docker/dockerfiles/debian-bootstrap.pre +++ b/tests/docker/dockerfiles/debian-bootstrap.pre @@ -81,7 +81,7 @@ else fi fi -echo "Building a rootfs using ${FAKEROOT} and ${DEBOOTSTRAP}" +echo "Building a rootfs using ${FAKEROOT} and ${DEBOOTSTRAP} ${DEB_ARCH}/${DEB_TYPE}" ${FAKEROOT} ${DEBOOTSTRAP} --variant=buildd --foreign --arch=$DEB_ARCH $DEB_TYPE . http://httpredir.debian.org/debian || exit 1 exit 0