From 69fe5baee1cfb9f55c798620dda3151eab700bc7 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Tue, 31 May 2016 11:39:51 +0200 Subject: 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 --- utils/functest_utils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'utils/functest_utils.py') 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 -- cgit 1.2.3-korg