From ee8cd3c26166c39c177feef50bb92f31aa708ac0 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 25 Aug 2014 19:02:00 +0400 Subject: [PATCH] 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: Pavel Emelyanov Tested-by: Andrew Vagin --- test/zdtm/live/static/cgroup02.hook | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/zdtm/live/static/cgroup02.hook b/test/zdtm/live/static/cgroup02.hook index c99f4eac7..5f4d042f3 100755 --- a/test/zdtm/live/static/cgroup02.hook +++ b/test/zdtm/live/static/cgroup02.hook @@ -3,7 +3,9 @@ set -e rmroots() { - echo "Cleaning $tname" + echo "Cleaning $tname ($1)" + + mount -t cgroup none $tname -o "$1" set +e rmdir "$tname/oldroot" @@ -14,14 +16,12 @@ rmroots() { echo "Left there is:" ls "$tname" umount "$tname" - rmdir "$tname" } tname=$(mktemp -d cgclean.XXXXXX) -mount -t cgroup none $tname -o "none,name=zdtmtst" -rmroots -tname=$(mktemp -d cgclean.XXXXXX) -mount -t cgroup none $tname -o "none,name=defaultroot" -rmroots +for ctl in $(cat /proc/self/cgroup | cut -d: -f2); do + rmroots "$ctl" +done +rmdir $tname