criu/test/zdtm/static/cgroup_threads.hook
Stepan Pieshkin f590c2b638 zdtm/static: check that cgroup layout of threads is preserved
Co-developed-by: Stepan Pieshkin <stepanpieshkin@google.com>
Signed-off-by: Stepan Pieshkin <stepanpieshkin@google.com>
Signed-off-by: Michal Clapinski <mclapinski@google.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
2024-09-11 16:02:11 -07:00

19 lines
389 B
Bash
Executable file

#!/bin/bash
set -e
[ "$1" == "--clean" -o "$1" == "--pre-restore" ] || exit 0
tname=$(mktemp -d cgclean.XXXXXX)
trap 'rmdir "${tname}"' EXIT
mount -t cgroup none $tname -o "none,name=zdtmtst"
trap 'umount "${tname}"; rmdir "${tname}"' EXIT
echo "Cleaning $tname"
rmdir "$tname/subcg_threads/subsubcg/" || true
rmdir "$tname/subcg_threads/" || true
echo "Left there is:"
ls "$tname"