From 43d8085d427baea48fd79a2768ce29ade89bb837 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Mon, 25 Aug 2014 09:56:50 -0400 Subject: [PATCH] tests: Copy the download cache when available [v2] MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- src/tests/lxc-test-unpriv | 6 ++++++ src/tests/lxc-test-usernic.in | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv index 6242c5fd8..59c264032 100755 --- a/src/tests/lxc-test-unpriv +++ b/src/tests/lxc-test-unpriv @@ -114,6 +114,12 @@ else done fi +# Copy the download template cache if available +run_cmd mkdir -p $HDIR/.cache/lxc +[ -d /var/cache/lxc/download ] && \ + cp -R /var/cache/lxc/download $HDIR/.cache/lxc && \ + chown -R $TUSER: $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 395c45347..7955d4f65 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 the download template cache if available +run_cmd "mkdir -p /home/usernic-user/.cache/lxc" +[ -d /var/cache/lxc/download ] && \ + cp -R /var/cache/lxc/download /home/usernic-user/.cache/lxc && \ + chown -R usernic-user: /home/usernic-user/.cache/lxc + + # Create two test bridges brctl addbr usernic-br0 brctl addbr usernic-br1 -- 2.47.2