diff options
author | 2016-05-31 11:39:51 +0200 | |
---|---|---|
committer | 2016-06-01 12:20:53 +0200 | |
commit | 69fe5baee1cfb9f55c798620dda3151eab700bc7 (patch) | |
tree | c251f280704cfb390212a466662ce0c1615c2005 /utils/functest_utils.py | |
parent | 063eac6f79662606d11a68617e0cb2aaa1c449b6 (diff) |
Add criteria in testcases.yaml and Test class
JIRA: FUNCTEST-257
Added example of usage in vping_ssh
Change-Id: Iac143b811db163f0f86682b0688948c20843ede5
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'utils/functest_utils.py')
-rw-r--r-- | utils/functest_utils.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py index 23dea7e5..b43a63cb 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 |