[lxc-devel] [PATCH] tests: Avoid the download template when possible

Stéphane Graber stgraber at ubuntu.com
Sat Jun 14 15:32:49 UTC 2014


On Sat, Jun 14, 2014 at 01:50:48PM +0000, Serge Hallyn wrote:
> Quoting Stéphane Graber (stgraber at ubuntu.com):
> > The use of the download template with an hardcoded --arch=amd64 in aa.c
> > was causing test failures on any platform incapable of running amd64
> > binaries.
> > 
> > This wasn't noticed in the CI environment as we run the tests within
> > containers on an amd64 kernel but this caused failures on the Ubuntu CI
> > environment.
> > 
> > Instead, let's use the busybox template, tweaking the configuration when
> > needed to match the needs of the testcase.
> > 
> > Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> 
> I assume you had a good reason to switch out the auto mounts with
> separate entries for proc and sys - could you tell us why?

Because otherwise they end up read-only and mess with the return values
we need to check apparmor works properly.

> 
> > ---
> >  src/tests/aa.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/tests/aa.c b/src/tests/aa.c
> > index b680333..b8689ac 100644
> > --- a/src/tests/aa.c
> > +++ b/src/tests/aa.c
> > @@ -164,10 +164,16 @@ int main(int argc, char *argv[])
> >  		goto err;
> >  	}
> >  	c->save_config(c, NULL);
> > -	if (!c->createl(c, "download", NULL, NULL, 0, "-d", "ubuntu", "-r", "trusty", "-a", "amd64", NULL)) {
> > +	if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) {
> >  		fprintf(stderr, "%s: %d: failed to create container\n", __FILE__, __LINE__);
> >  		goto err;
> >  	}
> > +
> > +	c->clear_config_item(c, "lxc.mount.auto");
> > +	c->set_config_item(c, "lxc.mount.entry", "proc proc proc");
> > +	c->set_config_item(c, "lxc.mount.entry", "sysfs sys sysfs");
> > +	c->save_config(c, NULL);
> > +
> >  	c->want_daemonize(c, true);
> >  	if (!c->startl(c, 0, NULL)) {
> >  		fprintf(stderr, "Error starting container\n");
> > -- 
> > 1.9.1
> > 
> > _______________________________________________
> > lxc-devel mailing list
> > lxc-devel at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-devel
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140614/c950bd51/attachment.sig>


More information about the lxc-devel mailing list