2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00
criu/test/zdtm_mount_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
527 B
Bash
Executable File

#!/bin/sh
# If a controller is created during dumping processes, criu may fail with error:
# Error (cgroup.c:768): cg: Set 3 is not subset of 2
# so lets create all test controllers before executing tests.
uuid=$1
cat /proc/self/cgroup | grep -q zdtmtst.defaultroot && exit
tdir=`mktemp -d zdtm.XXXXXX`
for i in "zdtmtst" "zdtmtst.defaultroot"; do
mount -t cgroup -o none,name=$i zdtm $tdir &&
# a fake group prevents destroying of a controller
mkdir -p $tdir/holder.$uuid &&
umount -l $tdir || exit 1
done
rmdir $tdir