aboutsummaryrefslogtreecommitdiffstats
path: root/functest
diff options
context:
space:
mode:
Diffstat (limited to 'functest')
-rwxr-xr-xfunctest/ci/config_functest.yaml1
-rwxr-xr-xfunctest/ci/testcases.yaml12
-rw-r--r--functest/opnfv_tests/features/netready.py22
-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/utils/openstack_tacker.py7
6 files changed, 65 insertions, 28 deletions
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
index d0442cf9..8fa4bd34 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 3ff503cb..77bd0152 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
diff --git a/functest/opnfv_tests/features/netready.py b/functest/opnfv_tests/features/netready.py
new file mode 100644
index 00000000..dec2a23c
--- /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/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 028b085c..893fff8c 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 13d9e4e6..f925336d 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/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: