Commit 5193fa4a authored by Pavel Emelyanov's avatar Pavel Emelyanov

zdtm.py: Split per-test options into C and R ones

One for checkpoint another for restore.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 56eea20c
...@@ -247,7 +247,7 @@ class zdtm_test: ...@@ -247,7 +247,7 @@ class zdtm_test:
def getname(self): def getname(self):
return self.__name return self.__name
def getcropts(self): def __getcropts(self):
opts = self.__desc.get('opts', '').split() + ["--pidfile", os.path.realpath(self.__pidfile())] opts = self.__desc.get('opts', '').split() + ["--pidfile", os.path.realpath(self.__pidfile())]
if self.__flavor.ns: if self.__flavor.ns:
opts += ["--root", self.__flavor.root] opts += ["--root", self.__flavor.root]
...@@ -255,6 +255,12 @@ class zdtm_test: ...@@ -255,6 +255,12 @@ class zdtm_test:
opts += ["-L", os.path.dirname(os.path.realpath(self.__name)) + '/lib'] opts += ["-L", os.path.dirname(os.path.realpath(self.__name)) + '/lib']
return opts return opts
def getdopts(self):
return self.__getcropts()
def getropts(self):
return self.__getcropts()
def gone(self, force = True): def gone(self, force = True):
if not self.auto_reap: if not self.auto_reap:
pid, status = os.waitpid(int(self.__pid), 0) pid, status = os.waitpid(int(self.__pid), 0)
...@@ -317,9 +323,6 @@ class criu_cli: ...@@ -317,9 +323,6 @@ class criu_cli:
grep_errors(os.path.join(self.__ddir(), log)) grep_errors(os.path.join(self.__ddir(), log))
raise test_fail_exc("CRIU %s" % action) raise test_fail_exc("CRIU %s" % action)
def __criu_cr(self, action, opts):
self.__criu_act(action, opts = opts + self.__test.getcropts())
def dump(self, action, opts = []): def dump(self, action, opts = []):
self.__iter += 1 self.__iter += 1
os.mkdir(self.__ddir()) os.mkdir(self.__ddir())
...@@ -334,7 +337,9 @@ class criu_cli: ...@@ -334,7 +337,9 @@ class criu_cli:
"--daemon", "--pidfile", "ps.pid"]) "--daemon", "--pidfile", "ps.pid"])
a_opts += ["--page-server", "--address", "127.0.0.1", "--port", "12345"] a_opts += ["--page-server", "--address", "127.0.0.1", "--port", "12345"]
self.__criu_cr(action, opts = a_opts + opts) a_opts += self.__test.getdopts()
self.__criu_act(action, opts = a_opts + opts)
if self.__page_server: if self.__page_server:
wait_pid_die(int(rpidfile(self.__ddir() + "/ps.pid")), "page server") wait_pid_die(int(rpidfile(self.__ddir() + "/ps.pid")), "page server")
...@@ -344,7 +349,9 @@ class criu_cli: ...@@ -344,7 +349,9 @@ class criu_cli:
if self.__restore_sibling: if self.__restore_sibling:
r_opts = ["--restore-sibling"] r_opts = ["--restore-sibling"]
self.__test.auto_reap = False self.__test.auto_reap = False
self.__criu_cr("restore", opts = r_opts + ["--restore-detached"]) r_opts += self.__test.getropts()
self.__criu_act("restore", opts = r_opts + ["--restore-detached"])
@staticmethod @staticmethod
def check(feature): def check(feature):
......
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