[CRIU] [PATCH 1/3] zdtm.py: Count skipped tests

Ruslan Kuprieiev rkuprieiev at cloudlinux.com
Fri Dec 4 06:23:24 PST 2015


Acked-by: Ruslan Kuprieiev <rkuprieiev at cloudlinux.com>

On 12/04/2015 04:06 PM, Pavel Emelyanov wrote:
> Currently launcher doesn't know that some tests are skipped
> and draws incorrect progress bar :)
>
> Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
> ---
>   test/zdtm.py | 16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/test/zdtm.py b/test/zdtm.py
> index 7cf113c..bc61d1d 100755
> --- a/test/zdtm.py
> +++ b/test/zdtm.py
> @@ -748,6 +748,10 @@ class launcher:
>   		perc = self.__nr * 16 / self.__total
>   		print "=== Run %d/%d %s" % (self.__nr, self.__total, '=' * perc + '-' * (16 - perc))
>   
> +	def skip(self, name, reason):
> +		print "Skipping %s (%s)" % (name, reason)
> +		self.__nr += 1
> +
>   	def run_test(self, name, desc, flavor):
>   
>   		if len(self.__subs) >= self.__max:
> @@ -888,16 +892,16 @@ def run_tests(opts):
>   			global arch
>   
>   			if excl and excl.match(t):
> -				print "Skipping %s (exclude)" % t
> +				l.skip(t, "exclude")
>   				continue
>   
>   			tdesc = get_test_desc(t)
>   			if tdesc.get('arch', arch) != arch:
> -				print "Skipping %s (arch %s)" % (t, tdesc['arch'])
> +				l.skip(t, "arch %s" % tdesc['arch'])
>   				continue
>   
>   			if run_all and test_flag(tdesc, 'noauto'):
> -				print "Skipping test %s (manual run only)" % t
> +				l.skip(t, "manual run only")
>   				continue
>   
>   			feat = tdesc.get('feature', None)
> @@ -907,11 +911,11 @@ def run_tests(opts):
>   					features[feat] = criu_cli.check(feat)
>   
>   				if not features[feat]:
> -					print "Skipping %s (no %s feature)" % (t, feat)
> +					l.skip(t, "no %s feature" % feat)
>   					continue
>   
>   			if self_checkskip(t):
> -				print "Skipping %s (self)" % t
> +				l.skip(t, "self")
>   				continue
>   
>   			test_flavs = tdesc.get('flavor', 'h ns uns').split()
> @@ -920,6 +924,8 @@ def run_tests(opts):
>   
>   			if run_flavs:
>   				l.run_test(t, tdesc, run_flavs)
> +			else:
> +				l.skip(t, "no flavors")
>   	finally:
>   		l.finish()
>   



More information about the CRIU mailing list