summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/functest/config.py5
-rw-r--r--test/functest/run_tests.py10
-rw-r--r--test/functest/tempest.py12
3 files changed, 16 insertions, 11 deletions
diff --git a/test/functest/config.py b/test/functest/config.py
index 5280a89..45611c7 100644
--- a/test/functest/config.py
+++ b/test/functest/config.py
@@ -1,6 +1,7 @@
import yaml
import os
+import functest.utils.functest_constants as ft_constants
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
@@ -11,8 +12,9 @@ class CommonConfig(object):
"""
Common configuration parameters across testcases
"""
+
def __init__(self):
- self.repo_path = os.path.join(os.environ['repos_dir'], 'sdnvpn')
+ self.repo_path = ft_constants.SDNVPN_REPO_DIR
self.config_file = os.path.join(self.repo_path,
'test/functest/config.yaml')
self.keyfile_path = os.path.join(self.repo_path,
@@ -37,6 +39,7 @@ class TestcaseConfig(object):
Configuration for a testcase.
Parse config.yaml into a dict and create an object out of it.
"""
+
def __init__(self, testcase):
common_config = CommonConfig()
test_config = None
diff --git a/test/functest/run_tests.py b/test/functest/run_tests.py
index b5361cd..e05cd7f 100644
--- a/test/functest/run_tests.py
+++ b/test/functest/run_tests.py
@@ -10,12 +10,13 @@
import argparse
import importlib
-import os
import sys
import time
+import yaml
+
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
-import yaml
+import config as sdnvpn_config
parser = argparse.ArgumentParser()
@@ -26,7 +27,8 @@ args = parser.parse_args()
TEST_DB_URL = ft_utils.get_functest_config('results.test_db_url')
logger = ft_logger.Logger("sdnvpn-run-tests").getLogger()
-REPO_PATH = os.environ['repos_dir'] + '/sdnvpn/'
+
+COMMON_CONFIG = sdnvpn_config.CommonConfig()
def push_results(testname, start_time, end_time, criteria, details):
@@ -41,7 +43,7 @@ def push_results(testname, start_time, end_time, criteria, details):
def main():
- with open(REPO_PATH + 'test/functest/config.yaml') as f:
+ with open(COMMON_CONFIG.config_file) as f:
config_yaml = yaml.safe_load(f)
testcases = config_yaml.get("testcases")
diff --git a/test/functest/tempest.py b/test/functest/tempest.py
index 61616de..9797ced 100644
--- a/test/functest/tempest.py
+++ b/test/functest/tempest.py
@@ -12,17 +12,17 @@ import ConfigParser
import os
import re
import shutil
+
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
-
+import config as sdnvpn_config
logger = ft_logger.Logger("sdnvpn-tempest").getLogger()
-REPO_PATH = os.environ['repos_dir'] + '/sdnvpn/'
-config_file = REPO_PATH + 'test/functest/config.yaml'
+COMMON_CONFIG = sdnvpn_config.CommonConfig()
SUCCESS_CRITERIA = ft_utils.get_parameter_from_yaml(
- "testcases.testcase_1.succes_criteria", config_file)
+ "testcases.testcase_1.succes_criteria", COMMON_CONFIG.config_file)
def main():
@@ -44,8 +44,8 @@ def main():
config.read(bgpvpn_tempest_conf)
config.set('service_available', 'bgpvpn', 'True')
logger.debug("Updating %s with bgpvpn=True" % bgpvpn_tempest_conf)
- with open(bgpvpn_tempest_conf, 'wb') as config_file:
- config.write(config_file)
+ with open(bgpvpn_tempest_conf, 'wb') as tempest_conf:
+ config.write(tempest_conf)
cmd_line = (src_tempest_dir +
"/run_tempest.sh -C %s -t -N -- "