[lxc-devel] [PATCH] tests: Copy the download cache when available

Stéphane Graber stgraber at ubuntu.com
Mon Aug 25 20:58:08 UTC 2014


On Mon, Aug 25, 2014 at 08:37:59PM +0000, Serge Hallyn wrote:
> Quoting Stéphane Graber (stgraber at ubuntu.com):
> > Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

Sent a v2 to workaround distros where /var/cache/lxc isn't world-readable.

> 
> > ---
> >  src/tests/lxc-test-unpriv     | 4 ++++
> >  src/tests/lxc-test-usernic.in | 5 +++++
> >  2 files changed, 9 insertions(+)
> > 
> > diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv
> > index 6242c5f..05cf155 100755
> > --- a/src/tests/lxc-test-unpriv
> > +++ b/src/tests/lxc-test-unpriv
> > @@ -114,6 +114,10 @@ else
> >  	done
> >  fi
> >  
> > +# Copy the download template cache if available
> > +run_cmd mkdir -p $HDIR/.cache/lxc
> > +[ -d /var/cache/lxc/download ] && run_cmd cp -R /var/cache/lxc/download $HDIR/.cache/lxc
> > +
> >  run_cmd lxc-create -t download -n c1 -- -d ubuntu -r trusty -a $ARCH
> >  run_cmd lxc-start -n c1 -d
> >  
> > diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in
> > index 395c453..e080bac 100755
> > --- a/src/tests/lxc-test-usernic.in
> > +++ b/src/tests/lxc-test-usernic.in
> > @@ -109,6 +109,11 @@ fi
> >  mkdir -p /run/user/$(id -u usernic-user)
> >  chown -R usernic-user: /run/user/$(id -u usernic-user) /home/usernic-user
> >  
> > +# Copy the download template cache if available
> > +run_cmd "mkdir -p /home/usernic-user/.cache/lxc"
> > +[ -d /var/cache/lxc/download ] && run_cmd "cp -R /var/cache/lxc/download /home/usernic-user/.cache/lxc"
> > +
> > +
> >  # Create two test bridges
> >  brctl addbr usernic-br0
> >  brctl addbr usernic-br1
> > -- 
> > 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/20140825/94de652b/attachment.sig>


More information about the lxc-devel mailing list