diff options
Diffstat (limited to 'functest/opnfv_tests/vnf')
-rw-r--r-- | functest/opnfv_tests/vnf/ims/cloudify_ims.py | 27 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/cloudify_ims.yaml | 7 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py | 20 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/ims/orchestra_openims.py | 22 |
4 files changed, 38 insertions, 38 deletions
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index 8ed7f0dd..c8c2c509 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.vnf['requirements']['compute_quotas'].items()): + setattr(compute_quotas, key, value) + + for key, value in ( + self.vnf['requirements']['network_quotas'].items()): + setattr(network_quotas, key, value) + + compute_quotas = self.os_project.update_compute_quotas(compute_quotas) + network_quotas = self.os_project.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 5154dea2..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() @@ -661,8 +658,9 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): try: neutron_client = os_utils.get_neutron_client(self.creds) self.logger.info("Deleting Open Baton Port...") - port = snaps_utils.neutron_utils.get_port_by_name( - neutron_client, '%s_port' % self.case_name) + port = snaps_utils.neutron_utils.get_port( + neutron_client, + port_name='%s_port' % self.case_name) snaps_utils.neutron_utils.delete_port(neutron_client, port) time.sleep(10) except Exception as exc: diff --git a/functest/opnfv_tests/vnf/ims/orchestra_openims.py b/functest/opnfv_tests/vnf/ims/orchestra_openims.py index 45440704..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() @@ -697,8 +692,9 @@ class OpenImsVnf(vnf.VnfOnBoarding): try: neutron_client = os_utils.get_neutron_client(self.creds) self.logger.info("Deleting Open Baton Port...") - port = snaps_utils.neutron_utils.get_port_by_name( - neutron_client, '%s_port' % self.case_name) + port = snaps_utils.neutron_utils.get_port( + neutron_client, + port_name='%s_port' % self.case_name) snaps_utils.neutron_utils.delete_port(neutron_client, port) time.sleep(10) except Exception as exc: |