diff options
author | Romanos Skiadas <rski@intracom-telecom.com> | 2016-12-15 14:57:08 +0200 |
---|---|---|
committer | Romanos Skiadas <rski@intracom-telecom.com> | 2016-12-15 16:59:31 +0200 |
commit | c9356c8ef4a056f47e25cb0f07796e0f6e7ff574 (patch) | |
tree | 43b657e852520d332c259b81b47e12bef1c1cc0f /test/functest/config.py | |
parent | 033ddcc028b083df3ec9c077c6cb4bc53f4dc5d3 (diff) |
Make sdnvpn a package
- Clean up the test/functest folder and move things to lib/ & artifacts/
- Add a new top level folder for the sdnvpn python code
Change-Id: I5fdc7fa5475fb800f488a17d3481158c9c4f84e1
Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com>
Diffstat (limited to 'test/functest/config.py')
-rw-r--r-- | test/functest/config.py | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/test/functest/config.py b/test/functest/config.py deleted file mode 100644 index 45611c7..0000000 --- a/test/functest/config.py +++ /dev/null @@ -1,53 +0,0 @@ -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 - -logger = ft_logger.Logger("sndvpn_test_config").getLogger() - - -class CommonConfig(object): - """ - Common configuration parameters across testcases - """ - - def __init__(self): - 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, - 'test/functest/id_rsa') - self.test_db = ft_utils.get_functest_config("results.test_db_url") - self.line_length = 90 # length for the summary table - self.vm_boot_timeout = 180 - self.default_flavor = ft_utils.get_parameter_from_yaml( - "defaults.flavor", self.config_file) - self.image_filename = ft_utils.get_functest_config( - "general.openstack.image_file_name") - self.image_format = ft_utils.get_functest_config( - "general.openstack.image_disk_format") - self.image_path = '{0}/{1}'.format( - ft_utils.get_functest_config( - "general.directories.dir_functest_data"), - self.image_filename) - - -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 - with open(common_config.config_file) as f: - testcases_yaml = yaml.safe_load(f) - test_config = testcases_yaml['testcases'].get(testcase, None) - if test_config is None: - logger.error('Test {0} configuration is not present in {1}' - .format(testcase, common_config.config_file)) - # Update class fields with configuration variables dynamically - self.__dict__.update(**test_config) |