[CRIU] [PATCH] zdtm.py: updated logic for --keep-going option
Pavel Emelyanov
xemul at virtuozzo.com
Thu Mar 24 11:20:54 PDT 2016
On 03/24/2016 06:47 PM, Sergey Bronnikov wrote:
> - 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):
Is this hunk really needed? Why would we need TAP for single test?
> 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"
>
More information about the CRIU
mailing list