[CRIU] [PATCH] zdtm.py: updated logic for --keep-going option

Sergey Bronnikov sergeyb at openvz.org
Thu Mar 24 05:51:33 PDT 2016


- option --keep-going is not mandatory if we run a single testcase
- show warning when we use --keep-going with a custom set of testcases
- ignore --keep-going when we run a custom set of testcase (exit on 1st fail)

Signed-off-by: Sergey Bronnikov <sergeyb at openvz.org>
---
 test/zdtm.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/zdtm.py b/test/zdtm.py
index a499251..78c08df 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1020,7 +1020,7 @@ class launcher:
 		else:
 			self.__use_log = False
 
-		if opts['report'] and opts['keep_going']:
+		if opts['report'] and (opts['keep_going'] or self.__total == 1):
 			now = datetime.datetime.now()
 			att = 0
 			reportname = os.path.join(report_dir, "criu-testreport.tap")
@@ -1115,12 +1115,12 @@ class launcher:
 		while self.__subs:
 			if not self.__wait_one(os.WNOHANG):
 				break
-		if self.__fail and not opts['keep_going']:
+		if self.__fail and (not opts['keep_going'] or opts['test'] or opts['tests']):
 			raise test_fail_exc('')
 
 	def wait_all(self):
 		self.__wait_all()
-		if self.__fail and not opts['keep_going']:
+		if self.__fail and (not opts['keep_going'] or opts['test'] or opts['tests']):
 			raise test_fail_exc('')
 
 	def finish(self):
@@ -1203,6 +1203,9 @@ def run_tests(opts):
 		print "Specify test with -t <name> or -a"
 		return
 
+	if opts['keep_going'] and (opts['tests'] or opts['test']):
+		print "[WARNING] Option --keep-going is more useful with option --all."
+
 	if opts['exclude']:
 		excl = re.compile(".*(" + "|".join(opts['exclude']) + ")")
 		print "Compiled exclusion list"
-- 
2.5.0


-- 
sergeyb@


More information about the CRIU mailing list