mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-03 07:12:48 +00:00
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>
This commit is contained in:
parent
6eab073c07
commit
ee8cd3c261
1 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue