diff options
Diffstat (limited to 'functest')
-rwxr-xr-x | functest/ci/testcases.yaml | 8 | ||||
-rw-r--r-- | functest/core/vnf_base.py | 4 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/cloudify_ims.py | 5 | ||||
-rwxr-xr-x | functest/utils/functest_logger.py | 58 | ||||
-rw-r--r-- | functest/utils/functest_utils.py | 2 | ||||
-rw-r--r-- | functest/utils/openstack_tacker.py | 7 |
6 files changed, 39 insertions, 45 deletions
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml index b1d824f6..77bd0152 100755 --- a/functest/ci/testcases.yaml +++ b/functest/ci/testcases.yaml @@ -387,7 +387,7 @@ tiers: - name: vnf order: 4 - ci_loop: 'weekly' + ci_loop: '(daily)|(weekly)' description : >- Collection of VNF test cases. testcases: @@ -400,7 +400,7 @@ tiers: using the Cloudify orchestrator. It also runs some signaling traffic. dependencies: installer: '' - scenario: '(ocl)|(nosdn)|^(os-odl)((?!bgpvpn).)*$' + scenario: 'nosdn-nofeature' run: module: 'functest.opnfv_tests.vnf.ims.cloudify_ims' class: 'ImsVnf' @@ -411,8 +411,8 @@ tiers: description: >- Test suite from Parser project. dependencies: - installer: '' - scenario: '' + installer: 'unknown' + scenario: 'unknown' run: module: 'functest.opnfv_tests.vnf.aaa.aaa' class: 'AaaVnf' diff --git a/functest/core/vnf_base.py b/functest/core/vnf_base.py index 44b4ae04..8e98d8ed 100644 --- a/functest/core/vnf_base.py +++ b/functest/core/vnf_base.py @@ -67,8 +67,8 @@ class VnfOnBoardingBase(base.TestcaseBase): res_orchestrator['result']) self.details['orchestrator']['duration'] = round( orchestrator_ready_time - self.start_time, 1) - except: - self.logger.warn("Problem with the Orchestrator") + except Exception: + self.logger.warn("Problem with the Orchestrator", exc_info=True) # Deploy VNF try: diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index e2508c22..efde44a0 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -176,11 +176,6 @@ class ImsVnf(vnf_base.VnfOnBoardingBase): cfy.set_nameservers(ns) self.logger.debug("Resolvconf set") - if 'compute' in self.nova_client.client.services_url: - cfy.set_nova_url(self.nova_client.client.services_url['compute']) - if self.neutron_client.httpclient.endpoint_url is not None: - cfy.set_neutron_url(self.neutron_client.httpclient.endpoint_url) - self.logger.info("Prepare virtualenv for cloudify-cli") cmd = "chmod +x " + self.case_dir + "create_venv.sh" ft_utils.execute_command(cmd) diff --git a/functest/utils/functest_logger.py b/functest/utils/functest_logger.py index f09f56be..0cba8c52 100755 --- a/functest/utils/functest_logger.py +++ b/functest/utils/functest_logger.py @@ -28,42 +28,36 @@ import json from functest.utils.constants import CONST -logger = logging.getLogger(__name__) - - -def is_debug(): - if CONST.CI_DEBUG and CONST.CI_DEBUG.lower() == "true": - return True - return False - - -def setup_logging(default_path=CONST.dir_functest_logging_cfg, - default_level=logging.INFO, - env_key='LOG_CFG'): - path = default_path - value = os.getenv(env_key, None) - if value: - path = value - if os.path.exists(path): - with open(path, 'rt') as f: - config = json.load(f) - if (config['handlers'] and - config['handlers']['console']): - stream_level = logging.INFO - if is_debug(): - stream_level = logging.DEBUG - config['handlers']['console']['level'] = stream_level - logging.config.dictConfig(config) - else: - logging.basicConfig(level=default_level) - - -setup_logging() - class Logger: def __init__(self, logger_name): + self.setup_logging() self.logger = logging.getLogger(logger_name) def getLogger(self): return self.logger + + def is_debug(self): + if CONST.CI_DEBUG and CONST.CI_DEBUG.lower() == "true": + return True + return False + + def setup_logging(self, default_path=CONST.dir_functest_logging_cfg, + default_level=logging.INFO, + env_key='LOG_CFG'): + path = default_path + value = os.getenv(env_key, None) + if value: + path = value + if os.path.exists(path): + with open(path, 'rt') as f: + config = json.load(f) + if (config['handlers'] and + config['handlers']['console']): + stream_level = logging.INFO + if self.is_debug(): + stream_level = logging.DEBUG + config['handlers']['console']['level'] = stream_level + logging.config.dictConfig(config) + else: + logging.basicConfig(level=default_level) diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 12d8e902..b2c36cff 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -270,7 +270,7 @@ def get_resolvconf_ns(): while line: ip = re.search(r"\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b", line) if ip: - resolver.nameservers = [str(ip)] + resolver.nameservers = [ip.group(0)] try: result = resolver.query('opnfv.org')[0] if result != "": diff --git a/functest/utils/openstack_tacker.py b/functest/utils/openstack_tacker.py index c7ac89af..f3597965 100644 --- a/functest/utils/openstack_tacker.py +++ b/functest/utils/openstack_tacker.py @@ -108,7 +108,8 @@ def list_vnfs(tacker_client, verbose=False): return None -def create_vnf(tacker_client, vnf_name, vnfd_id=None, vnfd_name=None): +def create_vnf(tacker_client, vnf_name, vnfd_id=None, + vnfd_name=None, param_file=None): try: vnf_body = { 'vnf': { @@ -116,6 +117,10 @@ def create_vnf(tacker_client, vnf_name, vnfd_id=None, vnfd_name=None): 'name': vnf_name } } + if param_file is not None: + with open(param_file) as f: + params = f.read() + vnf_body['vnf']['attributes']['param_values'] = params if vnfd_id is not None: vnf_body['vnf']['vnfd_id'] = vnfd_id else: |