aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests')
-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.py30
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.yaml4
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestrator_cloudify.py7
6 files changed, 49 insertions, 45 deletions
diff --git a/functest/opnfv_tests/features/security_scan.py b/functest/opnfv_tests/features/security_scan.py
index bcae516b..2db44175 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 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/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index efde44a0..584d780a 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")
@@ -130,8 +130,8 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
flavor_exist, flavor_id = os_utils.get_or_create_flavor(
"m1.large",
self.orchestrator['requirements']['ram_min'],
- '1',
- '1',
+ '50',
+ '2',
public=True)
self.logger.debug("Flavor id: %s" % flavor_id)
@@ -187,8 +187,12 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
self.orchestrator['blueprint']['url'],
self.orchestrator['blueprint']['branch'])
- cfy.deploy_manager()
- return {'status': 'PASS', 'result': ''}
+ error = cfy.deploy_manager()
+ if error:
+ self.logger.error(error)
+ return {'status': 'FAIL', 'result': error}
+ else:
+ return {'status': 'PASS', 'result': ''}
def deploy_vnf(self):
cw = Clearwater(self.vnf.inputs, self.orchestrator.object, self.logger)
@@ -198,7 +202,7 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
flavor_exist, flavor_id = os_utils.get_or_create_flavor(
"m1.small",
self.vnf['requirements']['ram_min'],
- '1',
+ '20',
'1',
public=True)
self.logger.debug("Flavor id: %s" % flavor_id)
@@ -229,8 +233,12 @@ class ImsVnf(vnf_base.VnfOnBoardingBase):
cw.set_external_network_name(ext_net)
- cw.deploy_vnf()
- return {'status': 'PASS', 'result': ''}
+ error = cw.deploy_vnf()
+ if error:
+ self.logger.error(error)
+ return {'status': 'FAIL', 'result': error}
+ else:
+ return {'status': 'PASS', 'result': ''}
def test_vnf(self):
script = "source {0}venv_cloudify/bin/activate; "
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml b/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
index c5918087..775685fa 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
@@ -6,7 +6,7 @@ cloudify:
url: https://github.com/boucherv-orange/cloudify-manager-blueprints.git
branch: '3.3.1-build'
requirements:
- ram_min: 3000
+ ram_min: 4000
os_image: centos_7
inputs:
keystone_username: ""
@@ -29,7 +29,7 @@ clearwater:
branch: stable
deployment_name: clearwater-opnfv
requirements:
- ram_min: 1700
+ ram_min: 2000
os_image: ubuntu_14.04
inputs:
image_id: ''
diff --git a/functest/opnfv_tests/vnf/ims/orchestrator_cloudify.py b/functest/opnfv_tests/vnf/ims/orchestrator_cloudify.py
index f3838f87..775b71c8 100644
--- a/functest/opnfv_tests/vnf/ims/orchestrator_cloudify.py
+++ b/functest/opnfv_tests/vnf/ims/orchestrator_cloudify.py
@@ -114,6 +114,7 @@ class Orchestrator:
cmd = "/bin/bash -c '" + script + "'"
error = execute_command(cmd, self.logger)
if error:
+ self.logger.error("Failed to deploy cloudify-manager")
return error
self.logger.info("Cloudify-manager server is UP !")
@@ -171,6 +172,7 @@ class Orchestrator:
cmd = "/bin/bash -c '" + script + "'"
error = execute_command(cmd, self.logger, 2000)
if error:
+ self.logger.error("Failed to deploy blueprint")
return error
self.logger.info("The deployment of {0} is ended".format(dep_name))
@@ -228,7 +230,4 @@ def execute_command(cmd, logger, timeout=1800):
logger.error("Error when executing command %s" % cmd)
f = open(output_file, 'r')
lines = f.readlines()
- result = lines[len(lines) - 3]
- result += lines[len(lines) - 2]
- result += lines[len(lines) - 1]
- return result
+ return lines[-5:]