aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-08-31 12:13:43 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-08-31 12:13:44 +0000
commit72ed04570b6099e1ac52f76b3702a3463603b087 (patch)
tree4069067aa01b6b974df9087431d32efe7bdb3a80
parent25440e47fd5733786eb3da5ef1367b9fb77af0a9 (diff)
parentf5afb93a4a2ed9547757655c1405ef27fabed11b (diff)
Merge "unify testcases.yaml obtain process"
-rwxr-xr-xci/run_tests.py2
-rw-r--r--cli/commands/cli_testcase.py4
-rw-r--r--cli/commands/cli_tier.py4
-rw-r--r--utils/functest_utils.py6
4 files changed, 8 insertions, 8 deletions
diff --git a/ci/run_tests.py b/ci/run_tests.py
index f2a119900..d8f488388 100755
--- a/ci/run_tests.py
+++ b/ci/run_tests.py
@@ -187,7 +187,7 @@ def main():
CI_INSTALLER_TYPE = os.getenv('INSTALLER_TYPE')
CI_SCENARIO = os.getenv('DEPLOY_SCENARIO')
- file = FUNCTEST_REPO + "/ci/testcases.yaml"
+ file = ft_utils.get_testcases_file()
_tiers = tb.TierBuilder(CI_INSTALLER_TYPE, CI_SCENARIO, file)
if args.noclean:
diff --git a/cli/commands/cli_testcase.py b/cli/commands/cli_testcase.py
index abf67d193..d1b248297 100644
--- a/cli/commands/cli_testcase.py
+++ b/cli/commands/cli_testcase.py
@@ -21,8 +21,6 @@ import yaml
with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:
functest_yaml = yaml.safe_load(f)
-REPOS_DIR = os.getenv('repos_dir')
-FUNCTEST_REPO = ("%s/functest/" % REPOS_DIR)
FUNCTEST_CONF_DIR = functest_yaml.get("general").get(
"directories").get("dir_functest_conf")
ENV_FILE = FUNCTEST_CONF_DIR + "/env_active"
@@ -33,7 +31,7 @@ class CliTestcase:
def __init__(self):
CI_INSTALLER_TYPE = os.getenv('INSTALLER_TYPE')
CI_SCENARIO = os.getenv('DEPLOY_SCENARIO')
- testcases = FUNCTEST_REPO + "/ci/testcases.yaml"
+ testcases = ft_utils.get_testcases_file()
self.tiers = tb.TierBuilder(CI_INSTALLER_TYPE, CI_SCENARIO, testcases)
def list(self):
diff --git a/cli/commands/cli_tier.py b/cli/commands/cli_tier.py
index 8e031cce9..7797e9be6 100644
--- a/cli/commands/cli_tier.py
+++ b/cli/commands/cli_tier.py
@@ -20,8 +20,6 @@ import yaml
with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:
functest_yaml = yaml.safe_load(f)
-REPOS_DIR = os.getenv('repos_dir')
-FUNCTEST_REPO = ("%s/functest/" % REPOS_DIR)
FUNCTEST_CONF_DIR = functest_yaml.get("general").get(
"directories").get("dir_functest_conf")
ENV_FILE = FUNCTEST_CONF_DIR + "/env_active"
@@ -32,7 +30,7 @@ class CliTier:
def __init__(self):
CI_INSTALLER_TYPE = os.getenv('INSTALLER_TYPE')
CI_SCENARIO = os.getenv('DEPLOY_SCENARIO')
- testcases = FUNCTEST_REPO + "/ci/testcases.yaml"
+ testcases = ft_utils.get_testcases_file()
self.tiers = tb.TierBuilder(CI_INSTALLER_TYPE, CI_SCENARIO, testcases)
def list(self):
diff --git a/utils/functest_utils.py b/utils/functest_utils.py
index 199088b9c..fb4d75638 100644
--- a/utils/functest_utils.py
+++ b/utils/functest_utils.py
@@ -381,7 +381,7 @@ def get_deployment_dir(logger=None):
def get_criteria_by_test(testname):
criteria = ""
- file = FUNCTEST_REPO + "/ci/testcases.yaml"
+ file = get_testcases_file()
tiers = tb.TierBuilder("", "", file)
for tier in tiers.get_tiers():
for test in tier.get_tests():
@@ -463,3 +463,7 @@ def check_test_result(test_name, ret, start_time, stop_time):
}
return status, details
+
+
+def get_testcases_file():
+ return FUNCTEST_REPO + "/ci/testcases.yaml"