[CRIU] [PATCH 1/2] zdtm.py: Split per-test options into C and R ones
Pavel Emelyanov
xemul at parallels.com
Mon Oct 12 11:53:13 PDT 2015
One for checkpoint another for restore.
Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
test/zdtm.py | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/test/zdtm.py b/test/zdtm.py
index cc2bf6c..bcbd537 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -247,7 +247,7 @@ class zdtm_test:
def getname(self):
return self.__name
- def getcropts(self):
+ def __getcropts(self):
opts = self.__desc.get('opts', '').split() + ["--pidfile", os.path.realpath(self.__pidfile())]
if self.__flavor.ns:
opts += ["--root", self.__flavor.root]
@@ -255,6 +255,12 @@ class zdtm_test:
opts += ["-L", os.path.dirname(os.path.realpath(self.__name)) + '/lib']
return opts
+ def getdopts(self):
+ return self.__getcropts()
+
+ def getropts(self):
+ return self.__getcropts()
+
def gone(self, force = True):
if not self.auto_reap:
pid, status = os.waitpid(int(self.__pid), 0)
@@ -307,9 +313,6 @@ class criu_cli:
if ret != 0:
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 = []):
self.__iter += 1
os.mkdir(self.__ddir())
@@ -324,7 +327,9 @@ class criu_cli:
"--daemon", "--pidfile", "ps.pid"])
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:
wait_pid_die(int(rpidfile(self.__ddir() + "/ps.pid")), "page server")
@@ -334,7 +339,9 @@ class criu_cli:
if self.__restore_sibling:
r_opts = ["--restore-sibling"]
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
def check(feature):
--
1.9.3
More information about the CRIU
mailing list