From 4a607daea35b21b86d063a9f32a332396ce5681a Mon Sep 17 00:00:00 2001 From: Dimitrios Markou Date: Fri, 25 Aug 2017 10:43:22 +0300 Subject: Adapt the testcases to multiple installers Right now the testcases are dependent to only one installer. So when we are trying to run the testcases to multiple installers the tests are failing. This patch make the testcases independent to the installer that they run. The testcases are running until the point which they hit the tacker client commands.They are failing in the tacker client commands because we need the new library for the upstream tacker API. The testaces have already tested to two installers (Fuel,Apex-ha). Also this patch contains the changes which are required for the adaptation to the new functest. For more information see the Jira tickets [0],[1],[2]. [0]: https://jira.opnfv.org/browse/SFC-100 [1]: https://jira.opnfv.org/browse/SFC-101 [2]: https://jira.opnfv.org/browse/SFC-102 Change-Id: Id1e5d5c94a65ab8bdea9584fa833bfa0cdec6632 Signed-off-by: Dimitrios Markou --- sfc/lib/config.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'sfc/lib/config.py') diff --git a/sfc/lib/config.py b/sfc/lib/config.py index c1e73e46..16613eab 100644 --- a/sfc/lib/config.py +++ b/sfc/lib/config.py @@ -10,7 +10,10 @@ import os import yaml +import sfc +import functest +import sfc.lib.utils as test_utils from functest.utils.constants import CONST import logging import functest.utils.functest_utils as ft_utils @@ -27,37 +30,44 @@ class CommonConfig(object): def __init__(self): self.line_length = 30 self.test_db = ft_utils.get_functest_config("results.test_db_url") - self.repo_path = CONST.dir_repo_sfc + self.functest_repo_path = os.path.dirname(functest.__file__) + self.functest_logging_api = os.path.join(self.functest_repo_path, + "ci", "logging.ini") + self.sfc_repo_path = os.path.dirname(sfc.__file__) self.sfc_test_dir = os.path.join( - self.repo_path, "sfc", "tests", "functest") + self.sfc_repo_path, "tests", "functest") self.vnfd_dir = os.path.join(self.sfc_test_dir, "vnfd-templates") self.vnfd_default_params_file = os.path.join( self.sfc_test_dir, "vnfd-default-params-file") self.functest_results_dir = os.path.join( CONST.dir_results, "odl-sfc") self.config_file = os.path.join(self.sfc_test_dir, "config.yaml") - self.installer_type = ft_utils.get_parameter_from_yaml( - "defaults.installer.type", self.config_file) - self.installer_ip = ft_utils.get_parameter_from_yaml( - "defaults.installer.ip", self.config_file) + + self.installer_type = CONST.__getattribute__('INSTALLER_TYPE') + + self.installer_fields = test_utils.fill_installer_dict( + self.installer_type) + + self.installer_ip = CONST.__getattribute__('INSTALLER_IP') + self.installer_user = ft_utils.get_parameter_from_yaml( - "defaults.installer.user", self.config_file) + self.installer_fields['user'], self.config_file) try: self.installer_password = ft_utils.get_parameter_from_yaml( - "defaults.installer.password", self.config_file) + self.installer_fields['password'], self.config_file) except: self.installer_password = None try: self.installer_key_file = ft_utils.get_parameter_from_yaml( - "defaults.installer.key_file", self.config_file) + self.installer_fields['pkey_file'], self.config_file) except: self.installer_key_file = None try: self.installer_cluster = ft_utils.get_parameter_from_yaml( - "defaults.installer.cluster", self.config_file) + self.installer_fields['cluster'], self.config_file) except: self.installer_cluster = None -- cgit 1.2.3-korg