[5/5] Process Migration using Sockets

Submitted by Rodrigo Bruno on Feb. 11, 2017, 3:34 a.m.

Details

Message ID ffe9ad0a89d1d5ccf5fe6fef9e1467fe.squirrel@146.193.41.131
State New
Series "Series without cover letter"
Headers show

Commit Message

Rodrigo Bruno Feb. 11, 2017, 3:34 a.m.
test/zdtm.py | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

    Add support for image-proxy/image-cache in zdtm test suite.

    Signed-off-by: Rodrigo Bruno <rbruno@gsd.inesc-id.pt>
    Signed-off-by: Katerina Koukiou <k.koukiou@gmail.com>

 		arg = repr((name, desc, flavor, {d: self.__opts[d] for d in nd}))

 		if self.__use_log:
@@ -1834,6 +1861,7 @@ rp.add_argument("--user", help = "Run CRIU as
regular user", action = 'store_tru
 rp.add_argument("--rpc", help = "Run CRIU via RPC rather than CLI",
action = 'store_true')

 rp.add_argument("--page-server", help = "Use page server dump", action =
'store_true')
+rp.add_argument("--remote", help = "Use remote option for diskless C/R",
action = 'store_true')
 rp.add_argument("-p", "--parallel", help = "Run test in parallel")
 rp.add_argument("--dry-run", help="Don't run tests, just pretend to",
action='store_true')
 rp.add_argument("--script", help="Add script to get notified by criu")

Patch hide | download patch | download mbox

diff --git a/test/zdtm.py b/test/zdtm.py
index 7cd9dc4..8d389a3 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -777,6 +777,7 @@  class criu:
 		self.__mdedup = (opts['noauto_dedup'] and True or False)
 		self.__user = (opts['user'] and True or False)
 		self.__leave_stopped = (opts['stop'] and True or False)
+		self.__remote = (opts['remote'] and True or False)
 		self.__criu = (opts['rpc'] and criu_rpc or criu_cli)

 	def logs(self):
@@ -884,6 +885,29 @@  class criu:

 		a_opts += self.__test.getdopts()

+		if self.__remote:
+			from subprocess import check_output
+
+			logdir = os.getcwd() + "/" + self.__dump_path + "/" + str(self.__iter)
+			print "Adding image cache"
+
+			cache_opts = [criu_bin, "image-cache", "--port", "12345", "-v4", "-o",
+				      logdir + "/image-cache.log", "-D", logdir]
+
+			cpid = subprocess.Popen(cache_opts).pid
+			time.sleep(1)
+
+			print "Adding image proxy"
+
+			proxy_opts = [criu_bin, "image-proxy", "--port", "12345", "--address",
+				      "localhost", "-v4", "-o", logdir + "/image-proxy.log",
+                                      "-D", logdir]
+
+			ppid = subprocess.Popen(proxy_opts).pid
+			time.sleep(1)
+
+			a_opts += ["--remote"]
+
 		if self.__dedup:
 			a_opts += ["--auto-dedup"]

@@ -923,6 +947,9 @@  class criu:
 			r_opts += ['--empty-ns', 'net']
 			r_opts += ['--action-script', os.getcwd() + '/empty-netns-prep.sh']

+		if self.__remote:
+			r_opts += ["--remote"]
+
 		self.__prev_dump_iter = None
 		criu_dir = os.path.dirname(os.getcwd())
 		if os.getenv("GCOV"):
@@ -1362,7 +1389,7 @@  class launcher:

 		nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling',
'stop', 'empty_ns',
 				'fault', 'keep_img', 'report', 'snaps', 'sat', 'script', 'rpc',
-				'join_ns', 'dedup', 'sbs', 'freezecg', 'user', 'dry_run',
'noauto_dedup')
+				'join_ns', 'dedup', 'sbs', 'freezecg', 'user', 'dry_run',
'noauto_dedup', 'remote')