[CRIU] [PATCH] zdtm: allow --keep-going anytime when running multiple tests

Mike Rapoport rppt at linux.vnet.ibm.com
Thu Dec 1 01:40:43 PST 2016


Currently it's possible to continue testing despite failures only when
running zdtm.py with --all option. Let's make --keep-going option also
valid when more than one test is requested with --tests or --from.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 test/zdtm.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/test/zdtm.py b/test/zdtm.py
index a17cce4..8b0dda6 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1521,8 +1521,7 @@ def run_tests(opts):
 			print "Tracking memory is not available"
 			return
 
-	if opts['keep_going'] and (not opts['all']):
-		print "[WARNING] Option --keep-going is more useful with option --all."
+	opts['keep_going'] = opts['keep_going'] and True or False
 
 	if opts['all']:
 		torun = all_tests(opts)
@@ -1530,11 +1529,9 @@ def run_tests(opts):
 	elif opts['tests']:
 		r = re.compile(opts['tests'])
 		torun = filter(lambda x: r.match(x), all_tests(opts))
-		opts['keep_going'] = False
 		run_all = True
 	elif opts['test']:
 		torun = opts['test']
-		opts['keep_going'] = False
 		run_all = False
 	elif opts['from']:
 		if not os.access(opts['from'], os.R_OK):
@@ -1548,6 +1545,10 @@ def run_tests(opts):
 		print "Specify test with -t <name> or -a"
 		return
 
+	if opts['keep_going'] and len(torun) < 2:
+		print "[WARNING] Option --keep-going is more useful when running multiple tests"
+		opts['keep_going'] = False
+
 	if opts['exclude']:
 		excl = re.compile(".*(" + "|".join(opts['exclude']) + ")")
 		print "Compiled exclusion list"
-- 
1.9.1



More information about the CRIU mailing list