diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2014-08-25 19:02:00 +0400 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2014-08-26 12:54:40 +0400 |
commit | ee8cd3c26166c39c177feef50bb92f31aa708ac0 (patch) | |
tree | 2a7e18b0993786bc1f2335f1038c57f61490aca8 | |
parent | 6eab073c07bb0880934db38933bf934593d29559 (diff) |
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 <xemul@parallels.com>
Tested-by: Andrew Vagin <avagin@openvz.org>
-rwxr-xr-x | test/zdtm/live/static/cgroup02.hook | 14 |
1 files 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 |