]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
unpriv tests: also move caller into unbound cgroups
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 21 May 2014 16:33:57 +0000 (11:33 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 21 May 2014 19:23:40 +0000 (15:23 -0400)
Otherwise the name=systemd cgroup isn't changed to one which
the lxc-unpriv user can write to, causing the test to fail.

This allows lxc-test-unpriv and lxc-test-usernic to pass when run in an
unprivileged container with cgmanager.

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

index bbe1e08cf70d77c1e14915a6c1fbe27682844b4b..139b0807f543a310957f1c7e0e77780b03aa879d 100755 (executable)
@@ -92,7 +92,7 @@ chown -R $TUSER /run/user/$(id -u $TUSER)
 cd $HDIR
 
 if [ -e /sys/fs/cgroup/cgmanager/sock ]; then
-       for d in $(grep -v ^# /proc/cgroups | awk '{print $1}'); do
+       for d in $(cut -d : -f 2 /proc/self/cgroup); do
                dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
                        --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \
                        string:$d string:$TUSER >/dev/null
index 93af62303748425d4a109b31ec150dfd466b0747..ad11f0aa727bc7700d59b006abdd42e6fcaa98b3 100755 (executable)
@@ -85,7 +85,7 @@ lxc.id_map = g 0 910000 10000
 EOF
 
 if [ -e /sys/fs/cgroup/cgmanager/sock ]; then
-       for d in $(grep -v ^# /proc/cgroups | awk '{print $1}'); do
+       for d in $(cut -d : -f 2 /proc/self/cgroup); do
                dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
                        --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \
                        string:$d string:usernic-user >/dev/null