summaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf/ims/cloudify_ims.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/vnf/ims/cloudify_ims.py')
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py83
1 files changed, 42 insertions, 41 deletions
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index f9548eb2c..d97a0bcda 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -24,20 +24,22 @@ 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.create_network import (NetworkSettings, SubnetSettings,
- OpenStackNetwork)
-from snaps.openstack.create_security_group import (SecurityGroupSettings,
- SecurityGroupRuleSettings,
- Direction, Protocol,
- OpenStackSecurityGroup)
-from snaps.openstack.create_router import RouterSettings, OpenStackRouter
-from snaps.openstack.create_instance import (VmInstanceSettings,
- FloatingIpSettings,
- OpenStackVmInstance)
-from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
-from snaps.openstack.create_image import ImageSettings, OpenStackImage
-from snaps.openstack.create_keypairs import KeypairSettings, OpenStackKeypair
-from snaps.openstack.create_network import PortSettings
+from snaps.config.flavor import FlavorConfig
+from snaps.config.image import ImageConfig
+from snaps.config.keypair import KeypairConfig
+from snaps.config.network import NetworkConfig, PortConfig, SubnetConfig
+from snaps.config.router import RouterConfig
+from snaps.config.security_group import (
+ Direction, Protocol, SecurityGroupConfig, SecurityGroupRuleConfig)
+from snaps.config.vm_inst import FloatingIpConfig, VmInstanceConfig
+
+from snaps.openstack.create_flavor import OpenStackFlavor
+from snaps.openstack.create_image import OpenStackImage
+from snaps.openstack.create_instance import OpenStackVmInstance
+from snaps.openstack.create_keypairs import OpenStackKeypair
+from snaps.openstack.create_network import OpenStackNetwork
+from snaps.openstack.create_router import OpenStackRouter
+from snaps.openstack.create_security_group import OpenStackSecurityGroup
__author__ = "Valentin Boucher <valentin.boucher@orange.com>"
@@ -120,10 +122,9 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
if image_file and image_name:
image_creator = OpenStackImage(
self.snaps_creds,
- ImageSettings(name=image_name,
- image_user='cloud',
- img_format='qcow2',
- image_file=image_file))
+ ImageConfig(
+ name=image_name, image_user='cloud',
+ img_format='qcow2', image_file=image_file))
image_creator.create()
# self.created_object.append(image_creator)
@@ -138,24 +139,24 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
start_time = time.time()
self.__logger.info("Creating keypair ...")
kp_file = os.path.join(self.data_dir, "cloudify_ims.pem")
- keypair_settings = KeypairSettings(name='cloudify_ims_kp',
- private_filepath=kp_file)
+ keypair_settings = KeypairConfig(name='cloudify_ims_kp',
+ private_filepath=kp_file)
keypair_creator = OpenStackKeypair(self.snaps_creds, keypair_settings)
keypair_creator.create()
self.created_object.append(keypair_creator)
self.__logger.info("Creating full network ...")
- subnet_settings = SubnetSettings(name='cloudify_ims_subnet',
- cidr='10.67.79.0/24')
- network_settings = NetworkSettings(name='cloudify_ims_network',
- subnet_settings=[subnet_settings])
+ subnet_settings = SubnetConfig(name='cloudify_ims_subnet',
+ cidr='10.67.79.0/24')
+ network_settings = NetworkConfig(name='cloudify_ims_network',
+ subnet_settings=[subnet_settings])
network_creator = OpenStackNetwork(self.snaps_creds, network_settings)
network_creator.create()
self.created_object.append(network_creator)
ext_net_name = snaps_utils.get_ext_net_name(self.snaps_creds)
router_creator = OpenStackRouter(
self.snaps_creds,
- RouterSettings(
+ RouterConfig(
name='cloudify_ims_router',
external_gateway=ext_net_name,
internal_subnets=[subnet_settings.name]))
@@ -166,19 +167,19 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
self.__logger.info("Creating security group for cloudify manager vm")
sg_rules = list()
sg_rules.append(
- SecurityGroupRuleSettings(sec_grp_name="sg-cloudify-manager",
- direction=Direction.ingress,
- protocol=Protocol.tcp, port_range_min=1,
- port_range_max=65535))
+ SecurityGroupRuleConfig(
+ sec_grp_name="sg-cloudify-manager",
+ direction=Direction.ingress, protocol=Protocol.tcp,
+ port_range_min=1, port_range_max=65535))
sg_rules.append(
- SecurityGroupRuleSettings(sec_grp_name="sg-cloudify-manager",
- direction=Direction.ingress,
- protocol=Protocol.udp, port_range_min=1,
- port_range_max=65535))
+ SecurityGroupRuleConfig(
+ sec_grp_name="sg-cloudify-manager",
+ direction=Direction.ingress, protocol=Protocol.udp,
+ port_range_min=1, port_range_max=65535))
securit_group_creator = OpenStackSecurityGroup(
self.snaps_creds,
- SecurityGroupSettings(
+ SecurityGroupConfig(
name="sg-cloudify-manager",
rule_settings=sg_rules))
@@ -188,7 +189,7 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
# orchestrator VM flavor
self.__logger.info("Get or create flavor for cloudify manager vm ...")
- flavor_settings = FlavorSettings(
+ flavor_settings = FlavorConfig(
name=self.orchestrator['requirements']['flavor']['name'],
ram=self.orchestrator['requirements']['flavor']['ram_min'],
disk=50,
@@ -196,20 +197,20 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
flavor_creator = OpenStackFlavor(self.snaps_creds, flavor_settings)
flavor_creator.create()
self.created_object.append(flavor_creator)
- image_settings = ImageSettings(
+ image_settings = ImageConfig(
name=self.orchestrator['requirements']['os_image'],
image_user='centos',
exists=True)
- port_settings = PortSettings(name='cloudify_manager_port',
- network_name=network_settings.name)
+ port_settings = PortConfig(name='cloudify_manager_port',
+ network_name=network_settings.name)
- manager_settings = VmInstanceSettings(
+ manager_settings = VmInstanceConfig(
name='cloudify_manager',
flavor=flavor_settings.name,
port_settings=[port_settings],
security_group_names=[securit_group_creator.sec_grp_settings.name],
- floating_ip_settings=[FloatingIpSettings(
+ floating_ip_settings=[FloatingIpConfig(
name='cloudify_manager_fip',
port_name=port_settings.name,
router_name=router_creator.router_settings.name)])
@@ -301,7 +302,7 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase):
descriptor.get('file_name'))
self.__logger.info("Get or create flavor for all clearwater vm")
- flavor_settings = FlavorSettings(
+ flavor_settings = FlavorConfig(
name=self.vnf['requirements']['flavor']['name'],
ram=self.vnf['requirements']['flavor']['ram_min'],
disk=25,