Commit 65b7d746 authored by Pavel Emelyanov's avatar Pavel Emelyanov

zdtm: Handle dump/restore error in RPC mode

travis-ci: success for tests: Add RPC testing to CI (rev2)
Acked-by: 's avatarAndrey Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 2e637541
......@@ -730,23 +730,29 @@ class criu_rpc:
criu.use_binary(criu_bin)
criu_rpc.__set_opts(criu, args, ctx)
if action == 'dump':
criu.dump()
elif action == 'restore':
if 'rd' not in ctx:
raise test_fail_exc('RPC Non-detached restore is impossible')
res = criu.restore()
pidf = ctx.get('pidf')
if pidf:
open(pidf, 'w').write('%d\n' % res.pid)
try:
if action == 'dump':
criu.dump()
elif action == 'restore':
if 'rd' not in ctx:
raise test_fail_exc('RPC Non-detached restore is impossible')
res = criu.restore()
pidf = ctx.get('pidf')
if pidf:
open(pidf, 'w').write('%d\n' % res.pid)
else:
raise test_fail_exc('RPC for %s required' % action)
except crpc.CRIUExceptionExternal:
print "Fail"
ret = -1
else:
raise test_fail_exc('RPC for %s required' % action)
ret = 0
imgd = ctx.get('imgd')
if imgd:
os.close(imgd)
return 0
return ret
class criu:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment