From 3e3c96b2aa15d7757f281ce00518a67e2a1225a9 Mon Sep 17 00:00:00 2001 From: helenyao Date: Mon, 21 Nov 2016 06:50:06 -0500 Subject: Extracted all global parameters into functest_constants.py JIRA: FUNCTEST-533 1. Extracted all global variables into functest_constants.py and updated all affected areas accordingly 2. Used os.path.join to replace '/' to come up with the path for better cross-platform support and improve the path accuracy 3. Removed unused variables 4. Updated the hardcoded path in Dockerfile by using variable reference 5. Removed "/" ending from all path variables 6. Updated the unit test Change-Id: Ib30a81d1f0c83fbaef042d63c187c27bd18301bb Signed-off-by: helenyao --- functest/utils/functest_utils.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'functest/utils/functest_utils.py') diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 2d4a652d..a25967b6 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -25,9 +25,6 @@ import functest.utils.functest_logger as ft_logger logger = ft_logger.Logger("functest_utils").getLogger() -REPOS_DIR = os.getenv('repos_dir') -FUNCTEST_REPO = ("%s/functest" % REPOS_DIR) - # ---------------------------------------------------------- # @@ -342,7 +339,7 @@ def get_deployment_dir(): def get_dict_by_test(testname): - with open(get_testcases_file()) as f: + with open(get_testcases_file_dir()) as f: testcases_yaml = yaml.safe_load(f) for dic_tier in testcases_yaml.get("tiers"): @@ -438,8 +435,8 @@ def check_test_result(test_name, ret, start_time, stop_time): return status, details -def get_testcases_file(): - return FUNCTEST_REPO + "/functest/ci/testcases.yaml" +def get_testcases_file_dir(): + return "/home/opnfv/repos/functest/functest/ci/testcases.yaml" def get_functest_yaml(): @@ -447,3 +444,7 @@ def get_functest_yaml(): functest_yaml = yaml.safe_load(f) f.close() return functest_yaml + + +def print_separator(): + logger.info("==============================================") -- cgit 1.2.3-korg