]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-test-unpriv: test lxc-clone -s
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 14 Aug 2014 21:36:01 +0000 (21:36 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Sat, 16 Aug 2014 01:03:16 +0000 (21:03 -0400)
This would have caught a regression in Ubuntu's 3.16 kernel.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/tests/lxc-test-unpriv

index f5ab535377a162aa1e73d4ef3ba298d3389aa0a9..6242c5fd8d3b1938030447b9fca80f6b0b3052d3 100755 (executable)
@@ -33,7 +33,8 @@ DONE=0
 cleanup() {
        cd /
 
-       run_cmd lxc-stop -n c1 -k
+       run_cmd lxc-stop -n c2 -k || true
+       run_cmd lxc-stop -n c1 -k || true
        pkill -u $(id -u $TUSER) -9
 
        sed -i '/lxcunpriv/d' /run/lxc/nics /etc/lxc/lxc-usernet
@@ -122,4 +123,12 @@ p1=$(run_cmd lxc-info -n c1 -p -H)
 run_cmd lxc-info -n c1
 run_cmd lxc-attach -n c1 -- /bin/true
 
+run_cmd lxc-stop -n c1
+run_cmd lxc-clone -s -o c1 -n c2
+run_cmd lxc-start -n c2 -d
+p1=$(run_cmd lxc-info -n c2 -p -H)
+[ "$p1" != "-1" ] || { echo "Failed to start container c2"; false; }
+
+run_cmd lxc-stop -n c2
+
 DONE=1