summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-06-02 07:41:44 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-02 07:41:44 +0000
commit7a55bacfa9d2c2fff84904578e7ebff0eb4cfb09 (patch)
treeb37a243958b78ec30e04833ed8d57a6790549710 /utils
parent5bf1647dec6860464eeb082b2875798f0759aa91 (diff)
parent69fe5baee1cfb9f55c798620dda3151eab700bc7 (diff)
Merge "Add criteria in testcases.yaml and Test class"
Diffstat (limited to 'utils')
-rw-r--r--utils/functest_utils.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py
index 23dea7e5a..b43a63cb8 100644
--- a/utils/functest_utils.py
+++ b/utils/functest_utils.py
@@ -20,6 +20,12 @@ import sys
import urllib2
import yaml
from git import Repo
+import functest.ci.tier_builder as tb
+
+
+""" global variables """
+REPOS_DIR = os.getenv('repos_dir')
+FUNCTEST_REPO = ("%s/functest/" % REPOS_DIR)
# ----------------------------------------------------------
@@ -261,3 +267,15 @@ def get_deployment_dir(logger=None):
deployment_dir = (rally_dir + "/tempest/for-deployment-" +
deployment_uuid)
return deployment_dir
+
+
+def get_criteria_by_test(testname):
+ criteria = ""
+ file = FUNCTEST_REPO + "/ci/testcases.yaml"
+ tiers = tb.TierBuilder("", "", file)
+ for tier in tiers.get_tiers():
+ for test in tier.get_tests():
+ if test.get_name() == testname:
+ criteria = test.get_criteria()
+
+ return criteria