aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-09-04 14:29:05 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-04 14:29:05 +0000
commitac2de4356604f81cff9c303f0af36601e8a330ea (patch)
treefee6958bae0aad369f837b12206b0cfddd2882b6 /functest/opnfv_tests/vnf
parent506ef8bdcb772637be4dc01c5afc0e583f7ae3d3 (diff)
parent578f831fe90f08028c6e88e103175b9bb698b6c5 (diff)
Merge "More support of snaps for VNF"
Diffstat (limited to 'functest/opnfv_tests/vnf')
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py27
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.yaml7
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py15
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestra_openims.py17
4 files changed, 32 insertions, 34 deletions
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index 8ed7f0dd..b98cbe9a 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -24,7 +24,6 @@ import functest.opnfv_tests.vnf.ims.clearwater_ims_base as clearwater_ims_base
from functest.utils.constants import CONST
import functest.utils.openstack_utils as os_utils
-from snaps.openstack.os_credentials import OSCreds
from snaps.openstack.create_network import (NetworkSettings, SubnetSettings,
OpenStackNetwork)
from snaps.openstack.create_security_group import (SecurityGroupSettings,
@@ -63,7 +62,6 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
raise Exception("VNF config file not found")
self.snaps_creds = ''
- self.created_object = []
config_file = os.path.join(self.case_dir, self.config)
self.orchestrator = dict(
@@ -101,12 +99,19 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
self.__logger.info("Additional pre-configuration steps")
- self.snaps_creds = OSCreds(
- username=self.creds['username'],
- password=self.creds['password'],
- auth_url=self.creds['auth_url'],
- project_name=self.creds['tenant'],
- identity_api_version=int(os_utils.get_keystone_client_version()))
+ compute_quotas = self.os_project.get_compute_quotas()
+ network_quotas = self.os_project.get_network_quotas()
+
+ for key, value in (
+ self.orchestrator['requirements']['compute_quotas'].items()):
+ setattr(compute_quotas, key, value)
+
+ for key, value in (
+ self.orchestrator['requirements']['network_quotas'].items()):
+ setattr(network_quotas, key, value)
+
+ compute_quotas = self.project_ims.update_compute_quotas(compute_quotas)
+ network_quotas = self.project_ims.update_network_quotas(network_quotas)
# needs some images
self.__logger.info("Upload some OS images if it doesn't exist")
@@ -402,12 +407,6 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
self.__logger.warn("Some issue during the undeployment ..")
self.__logger.warn("Tenant clean continue ..")
- self.__logger.info('Remove the cloudify manager OS object ..')
- for creator in reversed(self.created_object):
- try:
- creator.clean()
- except Exception as exc:
- self.logger.error('Unexpected error cleaning - %s', exc)
super(CloudifyIms, self).clean()
@energy.enable_recording
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml b/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
index 280e0a6b..ad7fa70a 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.yaml
@@ -21,6 +21,13 @@ vnf:
flavor:
name: m1.small
ram_min: 2048
+ compute_quotas:
+ cores: 50
+ instances: 15
+ network_quotas:
+ security_group: 20
+ security_group_rule: 100
+ port: 50
inputs:
image_id: 'ubuntu_14.04'
flavor_id: 'm1.small'
diff --git a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
index 216632ee..c924a347 100644
--- a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
+++ b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
@@ -31,7 +31,6 @@ from snaps.openstack.create_network import (
SubnetSettings,
PortSettings)
from snaps.openstack.create_router import OpenStackRouter, RouterSettings
-from snaps.openstack.os_credentials import OSCreds
from snaps.openstack.create_instance import (
VmInstanceSettings,
OpenStackVmInstance)
@@ -208,15 +207,13 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding):
super(ClearwaterImsVnf, self).prepare()
self.logger.info("Additional pre-configuration steps")
- self.logger.info("creds %s", (self.creds))
-
- self.snaps_creds = OSCreds(
- username=self.creds['username'],
- password=self.creds['password'],
- auth_url=self.creds['auth_url'],
- project_name=self.creds['tenant'],
- identity_api_version=int(os_utils.get_keystone_client_version()))
+ self.creds = {
+ "tenant": self.tenant_name,
+ "username": self.tenant_name,
+ "password": self.tenant_name,
+ "auth_url": os_utils.get_credentials()['auth_url']
+ }
self.prepare_images()
self.prepare_flavor()
self.prepare_security_groups()
diff --git a/functest/opnfv_tests/vnf/ims/orchestra_openims.py b/functest/opnfv_tests/vnf/ims/orchestra_openims.py
index 6c9628f7..aae35146 100644
--- a/functest/opnfv_tests/vnf/ims/orchestra_openims.py
+++ b/functest/opnfv_tests/vnf/ims/orchestra_openims.py
@@ -32,7 +32,6 @@ from snaps.openstack.create_network import (
SubnetSettings,
PortSettings)
from snaps.openstack.create_router import OpenStackRouter, RouterSettings
-from snaps.openstack.os_credentials import OSCreds
from snaps.openstack.create_instance import (
VmInstanceSettings, OpenStackVmInstance)
from functest.opnfv_tests.openstack.snaps import snaps_utils
@@ -198,22 +197,18 @@ class OpenImsVnf(vnf.VnfOnBoarding):
self.images = get_config("tenant_images.orchestrator", config_file)
self.images.update(get_config("tenant_images.%s" %
self.case_name, config_file))
- self.snaps_creds = None
def prepare(self):
"""Prepare testscase (Additional pre-configuration steps)."""
super(OpenImsVnf, self).prepare()
self.logger.info("Additional pre-configuration steps")
- self.logger.info("creds %s", (self.creds))
-
- self.snaps_creds = OSCreds(
- username=self.creds['username'],
- password=self.creds['password'],
- auth_url=self.creds['auth_url'],
- project_name=self.creds['tenant'],
- identity_api_version=int(os_utils.get_keystone_client_version()))
-
+ self.creds = {
+ "tenant": self.tenant_name,
+ "username": self.tenant_name,
+ "password": self.tenant_name,
+ "auth_url": os_utils.get_credentials()['auth_url']
+ }
self.prepare_images()
self.prepare_flavor()
self.prepare_security_groups()