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: ...@@ -730,23 +730,29 @@ class criu_rpc:
criu.use_binary(criu_bin) criu.use_binary(criu_bin)
criu_rpc.__set_opts(criu, args, ctx) criu_rpc.__set_opts(criu, args, ctx)
if action == 'dump': try:
criu.dump() if action == 'dump':
elif action == 'restore': criu.dump()
if 'rd' not in ctx: elif action == 'restore':
raise test_fail_exc('RPC Non-detached restore is impossible') if 'rd' not in ctx:
raise test_fail_exc('RPC Non-detached restore is impossible')
res = criu.restore()
pidf = ctx.get('pidf') res = criu.restore()
if pidf: pidf = ctx.get('pidf')
open(pidf, 'w').write('%d\n' % res.pid) 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: else:
raise test_fail_exc('RPC for %s required' % action) ret = 0
imgd = ctx.get('imgd') imgd = ctx.get('imgd')
if imgd: if imgd:
os.close(imgd) os.close(imgd)
return 0 return ret
class criu: 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