]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: Copy the download cache when available [v2]
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 25 Aug 2014 13:56:50 +0000 (09:56 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 25 Aug 2014 20:59:26 +0000 (16:59 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/tests/lxc-test-unpriv
src/tests/lxc-test-usernic.in

index 6242c5fd8d3b1938030447b9fca80f6b0b3052d3..59c264032744334f4fa72912f98ac95ce65210c6 100755 (executable)
@@ -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
 
index 395c4534709a71eb8fb104b5a8d9f05a5646e97d..7955d4f65a8b1208f0d2a2975523a681339b20eb 100755 (executable)
@@ -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