[CRIU] [PATCH 1/4] zdtm.py: unmount tests_root before rm-ing it

Tycho Andersen tycho.andersen at canonical.com
Tue Nov 3 13:20:33 PST 2015


This avoids problems like:

$ sudo ./zdtm.py run -a
Skipping test zdtm/live/static/mem-touch (manual run only)
./sock_opts00 --pidfile=sock_opts00.pid --outfile=sock_opts00.out
./sock_opts00 --pidfile=sock_opts00.pid --outfile=sock_opts00.out

==================== Run zdtm/live/static/sock_opts00 in h =====================
Start test
Test is SUID
Run CRIU: [dump -o dump.log -D dump/zdtm/live/static/sock_opts00/74/1 -v4 -t 74 --pidfile /home/ubuntu/criu/test/zdtm/live/static/sock_opts00.pid]
Run CRIU: [restore -o restore.log -D dump/zdtm/live/static/sock_opts00/74/1 -v4 --pidfile /home/ubuntu/criu/test/zdtm/live/static/sock_opts00.pid --restore-detached]
Wait for zdtm/live/static/sock_opts00 to die for 0.100000
Remvoing dump/zdtm/live/static/sock_opts00/74
==================== Test zdtm/live/static/sock_opts00 PASS ====================

==================== Run zdtm/live/static/sock_opts00 in ns ====================
Construct root for zdtm/live/static/sock_opts00
Start test
Test is SUID
Traceback (most recent call last):
  File "zdtm.py", line 850, in <module>
    do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3])
  File "zdtm.py", line 641, in do_run_test
    cr(cr_api, t, opts)
  File "zdtm.py", line 562, in cr
    cr_api.set_test(test)
  File "zdtm.py", line 469, in set_test
    os.makedirs(self.__dump_path)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: 'dump/zdtm/live/static/sock_opts00/153'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "zdtm.py", line 46, in clean_tests_root
    os.rmdir(tests_root)
OSError: [Errno 16] Device or resource busy: '/tmp/criu-root-MmGEQD'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "zdtm.py", line 46, in clean_tests_root
    os.rmdir(tests_root)
OSError: [Errno 16] Device or resource busy: '/tmp/criu-root-MmGEQD'

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 test/zdtm.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/zdtm.py b/test/zdtm.py
index 6fd8ed9..9474de0 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -42,6 +42,7 @@ tests_root = None
 
 def clean_tests_root():
 	global tests_root
+	subprocess.call(["umount", tests_root])
 	if tests_root:
 		os.rmdir(tests_root)
 
-- 
2.5.0



More information about the CRIU mailing list