From nobody Fri May 3 11:50:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499958901899389.20502143375074; Thu, 13 Jul 2017 08:15:01 -0700 (PDT) Received: from localhost ([::1]:60609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVfpP-0005GJ-L1 for importer@patchew.org; Thu, 13 Jul 2017 11:14:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVfLe-00022p-5D for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:44:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVfLa-0005N1-Ul for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:44:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34080) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVfLa-0005Me-PS for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:44:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 961B67DCD8; Thu, 13 Jul 2017 14:44:05 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.22.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89FAA60614; Thu, 13 Jul 2017 14:43:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 961B67DCD8 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=berrange@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 961B67DCD8 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:43:52 +0100 Message-Id: <20170713144352.2212-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 13 Jul 2017 14:44:05 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] docker: Don't enable networking as a side-effect of DEBUG=1 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: Fam Zheng , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When trying to debug problems with tests it is natural to set DEBUG=3D1 when starting the docker environment. Unfortunately this has a side-effect of enabling an eth0 network interface in the container, which changes the operating environment of the test suite. IOW tests with fail may suddenly start working again if DEBUG=3D1 is set, due to changed network setup. Add a separate NETWORK variable to allow enablement of networking separately from DEBUG=3D1. This can be used in two ways. To enable the default docker network backend make docker-test-build@fedora NETWORK=3D1 while to enable a specific network backend, eg join the network associated with the container 'wibble': make docker-test-build@fedora NETWORK=3Dcontainer:wibble Signed-off-by: Daniel P. Berrange --- Changed in v2: - Remove reference to eth0 - Allow arbitrary docker network backend to be given tests/docker/Makefile.include | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 037cb9e9e7..ec8e8d935d 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -106,6 +106,8 @@ docker: @echo ' (default is 1)' @echo ' DEBUG=3D1 Stop and drop to shell in the created c= ontainer' @echo ' before running the command.' + @echo ' NETWORK=3D1 Enable virtual network interface with d= efault backend.' + @echo ' NETWORK=3D$BACKEND Enable virtual network interface with $= BACKEND.' @echo ' NOUSER Define to disable adding current user to = containers passwd.' @echo ' NOCACHE=3D1 Ignore cache when build images.' @echo ' EXECUTABLE=3D Include executable in image.' @@ -132,7 +134,8 @@ docker-run: docker-qemu-src $(SRC_PATH)/tests/docker/docker.py run \ $(if $(NOUSER),,-u $(shell id -u)) -t \ $(if $V,,--rm) \ - $(if $(DEBUG),-i,--net=3Dnone) \ + $(if $(DEBUG),-i,) \ + $(if $(NETWORK),$(if $(subst $(NETWORK),,1)$(subst 1,,$(NETWORK)),--net= =3D$(NETWORK),),--net=3Dnone) \ -e TARGET_LIST=3D$(TARGET_LIST) \ -e EXTRA_CONFIGURE_OPTS=3D"$(EXTRA_CONFIGURE_OPTS)" \ -e V=3D$V -e J=3D$J -e DEBUG=3D$(DEBUG) \ --=20 2.13.0