From e93bf8981b84145acd24bc44c27decae4bb02020 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Wed, 21 May 2014 11:33:57 -0500 Subject: [PATCH] unpriv tests: also move caller into unbound cgroups MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/tests/lxc-test-unpriv | 2 +- src/tests/lxc-test-usernic.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 -- 2.47.2