[01/21] zdtm: Make possible to claim for features list

Submitted by Kirill Tkhai on May 23, 2017, 12:38 p.m.

Details

Message ID 149554309103.12386.1993531283950492792.stgit@localhost.localdomain
State New
Series "Add /proc/[pid]/ns/pid_for_children ns support (and fixes)"
Headers show

Commit Message

Kirill Tkhai May 23, 2017, 12:38 p.m.
Currently, one feature is supported. Add possibility
for a test to depend on several features.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 test/zdtm.py |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm.py b/test/zdtm.py
index 26b8939ae..761843d24 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1714,12 +1714,16 @@  default_test = {}
 
 			feat = tdesc.get('feature', None)
 			if feat:
-				if feat not in features:
-					print "Checking feature %s" % feat
-					features[feat] = criu.check(feat)
-
-				if not features[feat]:
-					l.skip(t, "no %s feature" % feat)
+				for f in feat.split():
+					if f not in features:
+						print "Checking feature %s" % f
+						features[f] = criu.check(f)
+
+					if not features[f]:
+						l.skip(t, "no %s feature" % f)
+						feat = None
+						break
+				if feat is None:
 					continue
 
 			if self_checkskip(t):

Comments

Andrey Vagin May 30, 2017, 6:24 p.m.
On Tue, May 23, 2017 at 03:38:11PM +0300, Kirill Tkhai wrote:
> Currently, one feature is supported. Add possibility
> for a test to depend on several features.
> 
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
> ---
>  test/zdtm.py |   16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/test/zdtm.py b/test/zdtm.py
> index 26b8939ae..761843d24 100755
> --- a/test/zdtm.py
> +++ b/test/zdtm.py
> @@ -1714,12 +1714,16 @@ default_test = {}
>  
>  			feat = tdesc.get('feature', None)

feat = tdesc.get('feature', "") to remove next "if". Otherwise here are
too many indents.

>  			if feat:
> -				if feat not in features:
> -					print "Checking feature %s" % feat
> -					features[feat] = criu.check(feat)
> -
> -				if not features[feat]:
> -					l.skip(t, "no %s feature" % feat)
> +				for f in feat.split():
> +					if f not in features:
> +						print "Checking feature %s" % f
> +						features[f] = criu.check(f)
> +
> +					if not features[f]:
> +						l.skip(t, "no %s feature" % f)
> +						feat = None
> +						break
> +				if feat is None:
>  					continue
>  
>  			if self_checkskip(t):
>