[CRIU] [PATCH] tests: add --dry-run to zdtm.py

Tycho Andersen tycho.andersen at canonical.com
Thu Mar 3 10:16:38 PST 2016


v2: print test name + flavor info for each test too.
v3: pass dry_run via CR_CT_TEST_INFO

Output looks like this now:

=== Run 1/242 ----------------
Skipping zdtm/transition/thread-bomb (manual run only)
Skipping zdtm/transition/file_aio (manual run only)

======================= Run zdtm/transition/maps007 in h =======================

====================== Run zdtm/transition/maps007 in ns =======================

====================== Run zdtm/transition/maps007 in uns ======================
=== Run 4/242 ----------------
Skipping zdtm/transition/epoll (manual run only)

==================== Run zdtm/transition/pipe_shared00 in h ====================

=================== Run zdtm/transition/pipe_shared00 in ns ====================

=================== Run zdtm/transition/pipe_shared00 in uns ===================
=== Run 6/242 ----------------

======================== Run zdtm/transition/fork in h =========================

======================== Run zdtm/transition/fork in ns ========================

======================= Run zdtm/transition/fork in uns ========================
=== Run 7/242 ----------------
Skipping zdtm/transition/ptrace (manual run only)
Skipping zdtm/transition/socket_loop00 (manual run only)

======================== Run zdtm/transition/ipc in ns =========================
=== Run 10/242 ----------------
Skipping zdtm/transition/netlink00 (manual run only)

===================== Run zdtm/transition/socket-tcp6 in h =====================
=== Run 12/242 ----------------
...

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 test/zdtm.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/zdtm.py b/test/zdtm.py
index 966ed3d..4b2c547 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -939,6 +939,8 @@ def do_run_test(tname, tdesc, flavs, opts):
 	for f in flavs:
 		print
 		print_sep("Run %s in %s" % (tname, f))
+		if opts['dry_run']:
+			continue
 		flav = flavors[f](opts)
 		t = tclass(tname, tdesc, flav, fcg)
 		cr_api = criu_cli(opts)
@@ -1006,7 +1008,7 @@ class launcher:
 
 		nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling', \
 				'fault', 'keep_img', 'report', 'snaps', 'sat', \
-				'dedup', 'sbs', 'freezecg', 'user')
+				'dedup', 'sbs', 'freezecg', 'user', 'dry_run')
 		arg = repr((name, desc, flavor, { d: self.__opts[d] for d in nd }))
 
 		if self.__use_log:
@@ -1387,6 +1389,7 @@ rp.add_argument("--user", help = "Run CRIU as regular user", action = 'store_tru
 
 rp.add_argument("--page-server", help = "Use page server dump", 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("-k", "--keep-img", help = "Whether or not to keep images after test",
 		choices = [ 'always', 'never', 'failed' ], default = 'failed')
-- 
2.7.0



More information about the CRIU mailing list