2014-09-19 14:20:00 +04:00
|
|
|
#!/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.
|
|
|
|
|
2022-03-20 22:11:19 -07:00
|
|
|
uuid=$1
|
|
|
|
|
2015-10-30 15:55:41 +04:00
|
|
|
cat /proc/self/cgroup | grep -q zdtmtst.defaultroot && exit
|
2014-09-19 14:20:00 +04:00
|
|
|
|
|
|
|
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
|
2022-03-20 22:11:19 -07:00
|
|
|
mkdir -p $tdir/holder.$uuid &&
|
tests: prevent zdtm_mount_cgroups from failing w/ EBUSY
Sometimes I get:
sudo ./zdtm.py run -t zdtm/live/static/cgroup03
umount: /home/tycho/packages/criu/test/zdtm.qPwsoO: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
Traceback (most recent call last):
File "./zdtm.py", line 1401, in <module>
tst.available()
File "./zdtm.py", line 435, in available
subprocess.check_call(["flock", "zdtm_mount_cgroups", "./zdtm_mount_cgroups"])
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['flock', 'zdtm_mount_cgroups', './zdtm_mount_cgroups']' returned non-zero exit status 1
let's use a lazy unmount so we avoid this.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-02 09:56:41 +11:00
|
|
|
umount -l $tdir || exit 1
|
2014-09-19 14:20:00 +04:00
|
|
|
done
|
|
|
|
rmdir $tdir
|