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 <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Serge Hallyn 2014-05-21 11:33:57 -05:00 committed by Stéphane Graber
parent df9b1831fb
commit ef4deb7f20
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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