aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfunctest/ci/testcases.yaml8
-rw-r--r--functest/core/vnf_base.py4
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py5
-rwxr-xr-xfunctest/utils/functest_logger.py58
-rw-r--r--functest/utils/functest_utils.py2
-rw-r--r--functest/utils/openstack_tacker.py7
-rwxr-xr-xrun_unit_tests.sh9
7 files changed, 47 insertions, 46 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:
diff --git a/run_unit_tests.sh b/run_unit_tests.sh
index 606aedcd..d60a2d62 100755
--- a/run_unit_tests.sh
+++ b/run_unit_tests.sh
@@ -5,7 +5,7 @@ set -o pipefail
# Either Workspace is set (CI)
if [ -z $WORKSPACE ]
then
- WORKSPACE="."
+ WORKSPACE=`pwd`
fi
@@ -24,6 +24,13 @@ pip install --upgrade pip
pip install -r $WORKSPACE/test-requirements.txt
pip install $WORKSPACE
+#install releng
+cd $WORKSPACE/../
+git clone https://gerrit.opnfv.org/gerrit/releng
+pip install releng/modules/
+rm -fr releng
+cd $WORKSPACE
+
export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml
# unit tests
# TODO: remove cover-erase