[CRIU] [PATCH] zdtm.py: updated logic for --keep-going option
Sergey Bronnikov
sergeyb at openvz.org
Thu Mar 24 08:47:21 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 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/test/zdtm.py b/test/zdtm.py
index a499251..2672bc6 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")
@@ -1189,15 +1189,20 @@ def run_tests(opts):
excl = None
features = {}
+ if opts['keep_going'] and (opts['tests'] or opts['test']):
+ print "[WARNING] Option --keep-going is more useful with option --all."
+
if opts['all']:
torun = all_tests(opts)
run_all = True
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
else:
print "Specify test with -t <name> or -a"
--
2.5.0
--
sergeyb@
More information about the CRIU
mailing list