All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: qemu-devel@nongnu.org, "Fam Zheng" <famz@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] Don't enable networking as a side-effect of DEBUG=1
Date: Thu, 13 Jul 2017 10:24:53 +0100	[thread overview]
Message-ID: <20170713092453.GE4011@redhat.com> (raw)
In-Reply-To: <292ec5a0-8722-4c66-d3d6-377b9863e092@amsat.org>

On Wed, Jul 12, 2017 at 06:55:45PM -0300, Philippe Mathieu-Daudé wrote:
> Hi Daniel,
> 
> On 07/12/2017 01:25 PM, Daniel P. Berrange wrote:
> > When trying to debug problems with tests it is natural to set
> > DEBUG=1 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=1 is set, due to changed network setup.
> > 
> > Add a separate NETWORK=1 option to allow enablement of
> > networking separately from DEBUG=1, since common debugging
> > tasks probably don't require networking anyway.
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> >   tests/docker/Makefile.include | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> > index 037cb9e..a8c4b82 100644
> > --- a/tests/docker/Makefile.include
> > +++ b/tests/docker/Makefile.include
> > @@ -106,6 +106,7 @@ docker:
> >   	@echo '                         (default is 1)'
> >   	@echo '    DEBUG=1              Stop and drop to shell in the created container'
> >   	@echo '                         before running the command.'
> > +	@echo '    NETWORK=1            Enable eth0 virtual network interface.'
> 
> "eth0" is not always true...
> 
> This patch could be more generic, maybe documented as:
> 
>   NETWORK=host     Use full host network stack (default no network).'
> 
> >   	@echo '    NOUSER               Define to disable adding current user to containers passwd.'
> >   	@echo '    NOCACHE=1            Ignore cache when build images.'
> >   	@echo '    EXECUTABLE=<path>    Include executable in image.'
> > @@ -132,7 +133,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=none) 			\
> > +			$(if $(DEBUG),-i,)				\
> > +			$(if $(NETWORK),,--net=none)			\
> 
> and here use directly:  --net=${NETWORK:-none}
> 
> so an experimented docker user could even run tests as:
> 
>   make docker-test-quick@centos6 NETWORK=container:qemu
> 
> (or NETWORK=bridge)

This is a nice idea, though slightly more complicated. It would be good
to support NETWORK=1 as a short-cut for enabling the default docker
network backend, as well as being able to give an explicit backend for
those who really care about the flexibility.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  reply	other threads:[~2017-07-13  9:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 16:25 [Qemu-devel] [PATCH] Don't enable networking as a side-effect of DEBUG=1 Daniel P. Berrange
2017-07-12 21:46 ` Philippe Mathieu-Daudé
2017-07-12 22:09   ` Philippe Mathieu-Daudé
2017-07-12 21:55 ` Philippe Mathieu-Daudé
2017-07-13  9:24   ` Daniel P. Berrange [this message]
2017-07-13  6:14 ` Fam Zheng
2017-07-13  8:46   ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170713092453.GE4011@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.