Commit ee8cd3c2 authored by Pavel Emelyanov's avatar Pavel Emelyanov

test/cgroup02: Clean newroot dir from all controllers in hooks

From avagin@:
  And here is one more problem. the newroot directory is created for all
  controllers, but currently test cleans up it only for the zdtmtst
  controller. We need to find a way to clean up all other conntrollers.
   Tests are executed on a node, which is rebooted only for updating
  kernel, so if we will not clean up all other controllers, we can eat all
  memory.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Tested-by: 's avatarAndrew Vagin <avagin@openvz.org>
parent 6eab073c
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
set -e set -e
rmroots() { rmroots() {
echo "Cleaning $tname" echo "Cleaning $tname ($1)"
mount -t cgroup none $tname -o "$1"
set +e set +e
rmdir "$tname/oldroot" rmdir "$tname/oldroot"
...@@ -14,14 +16,12 @@ rmroots() { ...@@ -14,14 +16,12 @@ rmroots() {
echo "Left there is:" echo "Left there is:"
ls "$tname" ls "$tname"
umount "$tname" umount "$tname"
rmdir "$tname"
} }
tname=$(mktemp -d cgclean.XXXXXX) tname=$(mktemp -d cgclean.XXXXXX)
mount -t cgroup none $tname -o "none,name=zdtmtst"
rmroots
tname=$(mktemp -d cgclean.XXXXXX) for ctl in $(cat /proc/self/cgroup | cut -d: -f2); do
mount -t cgroup none $tname -o "none,name=defaultroot" rmroots "$ctl"
rmroots done
rmdir $tname
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment