2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00
criu/test/zdtm_umount_cgroups
Andrei Vagin ab6191ccd3 zdtm: use unique holder for cgroups
The idea that each zdtm.py should have own helder, so that two zdtm.py that are
running on the same host don't effect each other.

Fixes: #1774
Signed-off-by: Andrei Vagin <avagin@google.com>
2022-04-28 17:53:52 -07:00

19 lines
482 B
Bash
Executable File

#!/bin/sh
# Lets delete all test controllers after executing tests.
cat /proc/self/cgroup | grep -q zdtmtst.defaultroot || exit 0
uuid=$1
tdir=`mktemp -d zdtm.XXXXXX`
for i in "zdtmtst" "zdtmtst.defaultroot"; do
mount -t cgroup -o none,name=$i zdtm $tdir || { rmdir $tdir; exit 1; }
# remove a fake group if exists
if [ -d "$tdir/holder.$uuid" ]; then
rmdir $tdir/holder.$uuid || { umount -l $tdir && rmdir $tdir; exit 1; }
fi
umount -l $tdir || exit 1;
done
rmdir $tdir