]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-test-unpriv: test for different cgroups per subsystem
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 9 Oct 2014 16:24:37 +0000 (11:24 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 9 Oct 2014 16:24:37 +0000 (11:24 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/tests/lxc-test-unpriv

index a27857c5d109a0185a012b38b5a8b2b1ce60720e..93c91a9f4ee9b7ca2b9f4b11f538947a01391513 100755 (executable)
@@ -141,4 +141,22 @@ p1=$(run_cmd lxc-info -n c2 -p -H)
 
 run_cmd lxc-stop -n c2
 
+if which cgm >/dev/null 2>&1; then
+    echo "Testing containers under different cgroups per subsystem"
+    run_cmd cgm create freezer x1/x2
+    cgm movepid freezer x1 $$
+    run_cmd lxc-start -n c1 -d
+    p1=$(run_cmd lxc-info -n c1 -p -H)
+    [ "$p1" != "-1" ] || { echo "Failed to start container c1"; false; }
+    run_cmd lxc-info -n c1
+    run_cmd lxc-attach -n c1 -- /bin/true
+    run_cmd lxc-cgroup -n c1 freezer.state
+
+    echo "Testing lxc-attach and lxc-cgroup from different cgroup"
+    cgm movepid freezer x2 $$
+    run_cmd lxc-attach -n c1 -- /bin/true
+    run_cmd lxc-cgroup -n c1 freezer.state
+    run_cmd lxc-cgroup -n c1 memory.limit_in_bytes
+fi
+
 DONE=1