[CRIU] [RFC PATCHv2 01/32] zdtm: zdtm.py: add --keep-going option

Ivan Shapovalov intelfx at intelfx.name
Sat Mar 12 00:42:00 PST 2016


--keep-going is similar to `make -k`: it makes zdtm.py continue executing tests
in spite of errors (as compared to exit(1) on first failure).

Signed-off-by: Ivan Shapovalov <intelfx at intelfx.name>
---
 test/zdtm.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/zdtm.py b/test/zdtm.py
index ea6492d..556217e 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -977,7 +977,8 @@ def do_run_test(tname, tdesc, flavs, opts):
 				cr_api.cleanup()
 			# This exit does two things -- exits from subprocess and
 			# aborts the main script execution on the 1st error met
-			sys.exit(1)
+			if not opts['keep_going']:
+				sys.exit(1)
 		else:
 			if opts['keep_img'] != 'always':
 				cr_api.cleanup()
@@ -1019,7 +1020,8 @@ class launcher:
 
 		nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling', \
 				'fault', 'keep_img', 'report', 'snaps', 'sat', \
-				'dedup', 'sbs', 'freezecg', 'user', 'dry_run')
+				'dedup', 'sbs', 'freezecg', 'user', 'dry_run', \
+				'keep_going')
 		arg = repr((name, desc, flavor, { d: self.__opts[d] for d in nd }))
 
 		if self.__use_log:
@@ -1398,6 +1400,8 @@ rp.add_argument("--sbs", help = "Do step-by-step execution, asking user for keyp
 rp.add_argument("--freezecg", help = "Use freeze cgroup (path:state)")
 rp.add_argument("--user", help = "Run CRIU as regular user", action = 'store_true')
 
+rp.add_argument("--keep-going", help = "Keep running tests in spite of failures", action = 'store_true')
+
 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')
-- 
2.7.2



More information about the CRIU mailing list