summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docker/Dockerfile1
-rwxr-xr-xfunctest/ci/config_functest.yaml1
-rwxr-xr-xfunctest/ci/testcases.yaml20
-rw-r--r--functest/core/vnf_base.py14
-rw-r--r--functest/opnfv_tests/features/netready.py22
-rwxr-xr-xfunctest/opnfv_tests/features/security_scan.py2
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py45
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py6
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py13
-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
13 files changed, 118 insertions, 82 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index bb469ae54..13f43dd44 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -83,6 +83,7 @@ RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/parser ${REPO
RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPOS_DIR}/doctor
RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/ovno ${REPOS_DIR}/ovno
RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise
+RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/netready ${REPOS_DIR}/netready
RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/sfc ${REPOS_DIR}/sfc
RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/securityscanning ${REPOS_DIR}/securityscanning
RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${REPOS_DIR}/releng
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
index d0442cf9a..8fa4bd342 100755
--- a/functest/ci/config_functest.yaml
+++ b/functest/ci/config_functest.yaml
@@ -20,6 +20,7 @@ general:
repo_sfc: /home/opnfv/repos/sfc
dir_repo_onos: /home/opnfv/repos/onos
repo_promise: /home/opnfv/repos/promise
+ repo_netready: /home/opnfv/repos/netready
repo_doctor: /home/opnfv/repos/doctor
repo_copper: /home/opnfv/repos/copper
dir_repo_ovno: /home/opnfv/repos/ovno
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml
index 4d02fe786..77bd01526 100755
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -336,6 +336,18 @@ tiers:
run:
module: 'functest.opnfv_tests.features.orchestrator.orchestra'
class: 'OpenbatonOrchestrator'
+ -
+ name: netready
+ criteria: 'status == "PASS"'
+ blocking: false
+ description: >-
+ Test suite from Netready project.
+ dependencies:
+ installer: 'apex'
+ scenario: 'gluon'
+ run:
+ module: 'functest.opnfv_tests.features.netready'
+ class: 'GluonVping'
-
name: components
order: 3
@@ -375,7 +387,7 @@ tiers:
-
name: vnf
order: 4
- ci_loop: 'weekly'
+ ci_loop: '(daily)|(weekly)'
description : >-
Collection of VNF test cases.
testcases:
@@ -388,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'
@@ -399,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 44b4ae04c..07b64fd05 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:
@@ -150,12 +150,14 @@ class VnfOnBoardingBase(base.TestcaseBase):
self.step_failure("Failed to create user ")
self.logger.info("Update OpenStack creds informations")
- self.creds.update({
- "tenant": self.tenant_name,
+ self.admin_creds = self.creds.copy()
+ self.admin_creds.update({
+ "tenant": self.tenant_name
})
- self.neutron_client = os_utils.get_neutron_client(self.creds)
- self.nova_client = os_utils.get_nova_client(self.creds)
+ self.neutron_client = os_utils.get_neutron_client(self.admin_creds)
+ self.nova_client = os_utils.get_nova_client(self.admin_creds)
self.creds.update({
+ "tenant": self.tenant_name,
"username": self.tenant_name,
"password": self.tenant_name,
})
diff --git a/functest/opnfv_tests/features/netready.py b/functest/opnfv_tests/features/netready.py
new file mode 100644
index 000000000..dec2a23ce
--- /dev/null
+++ b/functest/opnfv_tests/features/netready.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+#
+import functest.core.feature_base as base
+
+
+class GluonVping(base.FeatureBase):
+
+ def __init__(self):
+ super(GluonVping, self).__init__(project='netready',
+ case='gluon_vping',
+ repo='dir_repo_netready')
+ dir_netready_functest = '{}/test/functest'.format(self.repo)
+ self.cmd = ('cd %s && python ./gluon-test-suite.py' %
+ dir_netready_functest)
diff --git a/functest/opnfv_tests/features/security_scan.py b/functest/opnfv_tests/features/security_scan.py
index bcae516b8..2db44175d 100755
--- a/functest/opnfv_tests/features/security_scan.py
+++ b/functest/opnfv_tests/features/security_scan.py
@@ -14,7 +14,7 @@ from functest.utils.constants import CONST
class SecurityScan(base.FeatureBase):
def __init__(self):
- super(SecurityScan, self).__init__(project='security_scan',
+ super(SecurityScan, self).__init__(project='securityscanning',
case='security_scan',
repo='dir_repo_securityscan')
self.cmd = ('bash {0} && '
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 028b085c9..893fff8c2 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -106,7 +106,19 @@ def get_verifier_deployment_dir(verifier_id, deployment_id):
'for-deployment-{}'.format(deployment_id))
-def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None):
+def backup_tempest_config(conf_file):
+ """
+ Copy config file to tempest results directory
+ """
+ if not os.path.exists(TEMPEST_RESULTS_DIR):
+ os.makedirs(TEMPEST_RESULTS_DIR)
+
+ shutil.copyfile(conf_file,
+ os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf'))
+
+
+def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None,
+ MODE=None):
"""
Calls rally verify and updates the generated tempest.conf with
given parameters
@@ -114,6 +126,8 @@ def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None):
conf_file = configure_verifier(deployment_dir)
configure_tempest_update_params(conf_file,
IMAGE_ID, FLAVOR_ID)
+ if MODE == 'feature_multisite':
+ configure_tempest_multisite_params(conf_file)
def configure_tempest_update_params(tempest_conf_file,
@@ -164,12 +178,7 @@ def configure_tempest_update_params(tempest_conf_file,
with open(tempest_conf_file, 'wb') as config_file:
config.write(config_file)
- # Copy tempest.conf to /home/opnfv/functest/results/tempest/
- if not os.path.exists(TEMPEST_RESULTS_DIR):
- os.makedirs(TEMPEST_RESULTS_DIR)
-
- shutil.copyfile(tempest_conf_file,
- os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf'))
+ backup_tempest_config(tempest_conf_file)
def configure_verifier(deployment_dir):
@@ -196,25 +205,11 @@ def configure_verifier(deployment_dir):
return tempest_conf_file
-def configure_tempest_multisite(deployment_dir):
+def configure_tempest_multisite_params(tempest_conf_file):
"""
- Add/update needed parameters into tempest.conf file generated by Rally
+ Add/update multisite parameters into tempest.conf file generated by Rally
"""
- logger.debug("configure the tempest")
- configure_tempest(deployment_dir)
-
- logger.debug("Finding tempest.conf file...")
- tempest_conf_old = os.path.join(deployment_dir, 'tempest.conf')
- if not os.path.isfile(tempest_conf_old):
- raise Exception("Tempest configuration file %s NOT found."
- % tempest_conf_old)
-
- # Copy tempest.conf to /home/opnfv/functest/results/tempest/
- cur_path = os.path.split(os.path.realpath(__file__))[0]
- tempest_conf_file = os.path.join(cur_path, 'tempest_multisite.conf')
- shutil.copyfile(tempest_conf_old, tempest_conf_file)
-
- logger.debug("Updating selected tempest.conf parameters...")
+ logger.debug("Updating multisite tempest.conf parameters...")
config = ConfigParser.RawConfigParser()
config.read(tempest_conf_file)
@@ -279,3 +274,5 @@ def configure_tempest_multisite(deployment_dir):
config.set('kingbird', 'api_version', kingbird_api_version)
with open(tempest_conf_file, 'wb') as config_file:
config.write(config_file)
+
+ backup_tempest_config(tempest_conf_file)
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index 13d9e4e6c..f925336d4 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -113,7 +113,7 @@ class TempestCommon(testcase_base.TestcaseBase):
if self.MODE == 'smoke':
testr_mode = "smoke"
elif self.MODE == 'feature_multisite':
- testr_mode = " | grep -i kingbird "
+ testr_mode = "'[Kk]ingbird'"
elif self.MODE == 'full':
testr_mode = ""
else:
@@ -272,7 +272,8 @@ class TempestCommon(testcase_base.TestcaseBase):
self.create_tempest_resources()
conf_utils.configure_tempest(self.DEPLOYMENT_DIR,
self.IMAGE_ID,
- self.FLAVOR_ID)
+ self.FLAVOR_ID,
+ self.MODE)
self.generate_test_list(self.VERIFIER_REPO_DIR)
self.apply_tempest_blacklist()
self.run_verifier_tests()
@@ -319,7 +320,6 @@ class TempestMultisite(TempestCommon):
self.case_name = "multisite"
self.MODE = "feature_multisite"
self.OPTION = "--concurrency 1"
- conf_utils.configure_tempest_multisite(self.DEPLOYMENT_DIR)
class TempestCustom(TempestCommon):
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index e2508c223..e354563e0 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -68,10 +68,10 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
def deploy_orchestrator(self, **kwargs):
self.logger.info("Additional pre-configuration steps")
- self.neutron_client = os_utils.get_neutron_client(self.creds)
- self.glance_client = os_utils.get_glance_client(self.creds)
- self.keystone_client = os_utils.get_keystone_client(self.creds)
- self.nova_client = os_utils.get_nova_client(self.creds)
+ self.neutron_client = os_utils.get_neutron_client(self.admin_creds)
+ self.glance_client = os_utils.get_glance_client(self.admin_creds)
+ self.keystone_client = os_utils.get_keystone_client(self.admin_creds)
+ self.nova_client = os_utils.get_nova_client(self.admin_creds)
# needs some images
self.logger.info("Upload some OS images if it doesn't exist")
@@ -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 f09f56be0..0cba8c528 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 12d8e902f..b2c36cff9 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 c7ac89af9..f3597965f 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 606aedcd5..d60a2d623 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