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

Submitted by Kirill Tkhai on May 31, 2017, 9:30 a.m.

Details

Message ID 556240a0-0d0c-77f2-3c58-543cd4ae4c4b@virtuozzo.com
State New
Series "Add /proc/[pid]/ns/pid_for_children ns support (and fixes)"
Headers show

Commit Message

Kirill Tkhai May 31, 2017, 9:30 a.m.
On 30.05.2017 21:24, Andrei Vagin wrote:
> 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(-)
[skip]
> feat = tdesc.get('feature', "") to remove next "if". Otherwise here are
> too many indents.

[PATCH v2]zdtm: Make possible to claim for features list

Currently, one feature is supported. Add possibility
for a test to depend on several features.

v2: Delete excess "if" as suggested by Andrey Vagin.
    Rename variables to decrise patch size.
    
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 test/zdtm.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm.py b/test/zdtm.py
index 26b8939ae..16a65a22d 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1712,15 +1712,18 @@  default_test = {}
 				l.skip(t, "manual run only")
 				continue
 
-			feat = tdesc.get('feature', None)
-			if feat:
+			feat_list = tdesc.get('feature', "")
+			for feat in feat_list.split():
 				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)
-					continue
+					feat_list = None
+					break
+			if feat_list is None:
+				continue
 
 			if self_checkskip(t):
 				l.skip(t, "checkskip failed")