Bugfix: test case constraint not work if "INSTALLER_TYPE" and "NODE_NAME" absent 97/36897/3
authorJingLu5 <lvjing5@huawei.com>
Tue, 4 Jul 2017 07:44:52 +0000 (07:44 +0000)
committerJingLu5 <lvjing5@huawei.com>
Tue, 4 Jul 2017 12:11:16 +0000 (12:11 +0000)
Change-Id: Idffc07c28fabda590b58c9501f388099f84f06b2
Signed-off-by: JingLu5 <lvjing5@huawei.com>
yardstick/benchmark/core/task.py

index d1a4d75..f9c2551 100644 (file)
@@ -375,10 +375,10 @@ class TaskParser(object):       # pragma: no cover
                 tc_fit_installer = constraint.get('installer', None)
                 LOG.info("cur_pod:%s, cur_installer:%s,tc_constraints:%s",
                          cur_pod, cur_installer, constraint)
-                if cur_pod and tc_fit_pod and cur_pod not in tc_fit_pod:
+                if (cur_pod is None) or (tc_fit_pod and cur_pod not in tc_fit_pod):
                     return False
-                if cur_installer and tc_fit_installer and \
-                        cur_installer not in tc_fit_installer:
+                if (cur_installer is None) or (tc_fit_installer and cur_installer
+                                               not in tc_fit_installer):
                     return False
         return True