From: Serge Hallyn Date: Wed, 21 May 2014 16:33:57 +0000 (-0500) Subject: unpriv tests: also move caller into unbound cgroups X-Git-Tag: lxc-1.1.0.alpha1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef4deb7f20dea12dd4225bbcc4ab471d0454289d;p=thirdparty%2Flxc.git unpriv tests: also move caller into unbound cgroups 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 Acked-by: Stéphane Graber --- diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv index bbe1e08cf..139b0807f 100755 --- a/src/tests/lxc-test-unpriv +++ b/src/tests/lxc-test-unpriv @@ -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 diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in index 93af62303..ad11f0aa7 100755 --- a/src/tests/lxc-test-usernic.in +++ b/src/tests/lxc-test-usernic.in @@ -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