[lxc-devel] [PATCH] lxc-test-usernic: avoid extra downloads
Stéphane Graber
stgraber at ubuntu.com
Fri Aug 22 18:59:15 UTC 2014
On Thu, Aug 21, 2014 at 04:01:38PM +0000, Serge Hallyn wrote:
> If the host has the ubuntu trusty download image in /var/cache/lxc,
> copy that into lxc-user-nic's account so we can avoid the extra
> download.
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
This should be made in a way that's generic and not specific to amd64.
Also this should be done for both lxc-test-usernic and lxc-test-userns.
I'll send a reworked version later today.
> ---
> src/tests/lxc-test-usernic.in | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in
> index 395c453..1e9485b 100755
> --- a/src/tests/lxc-test-usernic.in
> +++ b/src/tests/lxc-test-usernic.in
> @@ -109,6 +109,13 @@ fi
> mkdir -p /run/user/$(id -u usernic-user)
> chown -R usernic-user: /run/user/$(id -u usernic-user) /home/usernic-user
>
> +# Copy in the cached trusty download image if the host has it
> +if [ -d /var/cache/lxc/download/ubuntu/trusty/amd64/default ]; then
> + run_cmd "mkdir -p /home/usernic-user/.cache/lxc/download/ubuntu/trusty/amd64/default/"
> + cp /var/cache/lxc/download/ubuntu/trusty/amd64/default/* /home/usernic-user/.cache/lxc/download/ubuntu/trusty/amd64/default/
> + chown -R usernic-user: /home/usernic-user/.cache
> +fi
> +
> # Create two test bridges
> brctl addbr usernic-br0
> brctl addbr usernic-br1
> --
> 2.1.0.rc1
>
> _______________________________________________
> 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/20140822/43526984/attachment.sig>
More information about the lxc-devel
mailing list