Commit 12e85f15 authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Pavel Emelyanov

zdtm.py: updated logic for --keep-going option

- 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: 's avatarSergey Bronnikov <sergeyb@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 92c0e732
...@@ -1019,7 +1019,7 @@ class launcher: ...@@ -1019,7 +1019,7 @@ class launcher:
else: else:
self.__use_log = False 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() now = datetime.datetime.now()
att = 0 att = 0
reportname = os.path.join(report_dir, "criu-testreport.tap") reportname = os.path.join(report_dir, "criu-testreport.tap")
...@@ -1188,15 +1188,20 @@ def run_tests(opts): ...@@ -1188,15 +1188,20 @@ def run_tests(opts):
excl = None excl = None
features = {} features = {}
if opts['keep_going'] and (not opts['all']):
print "[WARNING] Option --keep-going is more useful with option --all."
if opts['all']: if opts['all']:
torun = all_tests(opts) torun = all_tests(opts)
run_all = True run_all = True
elif opts['tests']: elif opts['tests']:
r = re.compile(opts['tests']) r = re.compile(opts['tests'])
torun = filter(lambda x: r.match(x), all_tests(opts)) torun = filter(lambda x: r.match(x), all_tests(opts))
opts['keep_going'] = False
run_all = True run_all = True
elif opts['test']: elif opts['test']:
torun = opts['test'] torun = opts['test']
opts['keep_going'] = False
run_all = False run_all = False
elif opts['from']: elif opts['from']:
if not os.access(opts['from'], os.R_OK): if not os.access(opts['from'], os.R_OK):
...@@ -1204,6 +1209,7 @@ def run_tests(opts): ...@@ -1204,6 +1209,7 @@ def run_tests(opts):
return return
torun = map(lambda x: x.strip(), open(opts['from'])) torun = map(lambda x: x.strip(), open(opts['from']))
opts['keep_going'] = False
run_all = True run_all = True
else: else:
print "Specify test with -t <name> or -a" print "Specify test with -t <name> or -a"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment