diff --git a/test/zdtm.py b/test/zdtm.py index fbb3400c4..df23ea03d 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -913,6 +913,10 @@ class criu_cli: return cr return cr.wait(timeout=timeout) + @staticmethod + def exit_signal(ret): + return ret < 0 + class criu_rpc_process: def wait(self): @@ -1033,8 +1037,11 @@ class criu_rpc: else: raise test_fail_exc('RPC for %s required' % action) except crpc.CRIUExceptionExternal as e: - print("Fail", e) - ret = -1 + if e.typ != e.resp_typ: + ret = -2 + else: + print("Fail", e) + ret = -1 else: ret = 0 @@ -1047,6 +1054,10 @@ class criu_rpc: return ret + @staticmethod + def exit_signal(ret): + return ret == -2 + class criu: def __init__(self, opts): @@ -1251,8 +1262,8 @@ class criu: return rst_succeeded = os.access( os.path.join(__ddir, "restore-succeeded"), os.F_OK) - if self.__test.blocking() or (self.__sat and action == 'restore' and - rst_succeeded): + if (self.__test.blocking() and not self.__criu.exit_signal(ret)) or \ + (self.__sat and action == 'restore' and rst_succeeded): raise test_fail_expected_exc(action) else: raise test_fail_exc("CRIU %s" % action) diff --git a/test/zdtm/criu_config.py b/test/zdtm/criu_config.py index 221c23292..9fd292747 100644 --- a/test/zdtm/criu_config.py +++ b/test/zdtm/criu_config.py @@ -41,3 +41,7 @@ class criu_config: if nowait: return cr return cr.wait() + + @staticmethod + def exit_signal(ret): + return ret < 0