aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/openstack')
-rw-r--r--functest/opnfv_tests/openstack/rally/rally.py22
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py22
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_base.py17
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_ssh.py50
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_userdata.py12
5 files changed, 63 insertions, 60 deletions
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py
index a4970fc2..0117e69c 100644
--- a/functest/opnfv_tests/openstack/rally/rally.py
+++ b/functest/opnfv_tests/openstack/rally/rally.py
@@ -29,10 +29,12 @@ from functest.opnfv_tests.openstack.snaps import snaps_utils
from functest.opnfv_tests.openstack.tempest import conf_utils
from functest.utils.constants import CONST
-from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
-from snaps.openstack.create_image import ImageSettings
-from snaps.openstack.create_network import NetworkSettings, SubnetSettings
-from snaps.openstack.create_router import RouterSettings
+from snaps.config.flavor import FlavorConfig
+from snaps.config.image import ImageConfig
+from snaps.config.network import NetworkConfig, SubnetConfig
+from snaps.config.router import RouterConfig
+
+from snaps.openstack.create_flavor import OpenStackFlavor
from snaps.openstack.tests import openstack_tests
from snaps.openstack.utils import deploy_utils
@@ -478,7 +480,7 @@ class RallyBase(testcase.TestCase):
LOGGER.debug("Creating image '%s'...", self.image_name)
image_creator = deploy_utils.create_image(
- self.os_creds, ImageSettings(
+ self.os_creds, ImageConfig(
name=self.image_name,
image_file=self.GLANCE_IMAGE_PATH,
img_format=self.GLANCE_IMAGE_FORMAT,
@@ -491,10 +493,10 @@ class RallyBase(testcase.TestCase):
LOGGER.debug("Creating network '%s'...", network_name)
network_creator = deploy_utils.create_network(
- self.os_creds, NetworkSettings(
+ self.os_creds, NetworkConfig(
name=network_name,
shared=True,
- subnet_settings=[SubnetSettings(
+ subnet_settings=[SubnetConfig(
name=subnet_name,
cidr=self.RALLY_PRIVATE_SUBNET_CIDR)
]))
@@ -505,7 +507,7 @@ class RallyBase(testcase.TestCase):
LOGGER.debug("Creating router '%s'...", router_name)
router_creator = deploy_utils.create_router(
- self.os_creds, RouterSettings(
+ self.os_creds, RouterConfig(
name=router_name,
external_gateway=self.ext_net_name,
internal_subnets=[subnet_name]))
@@ -515,7 +517,7 @@ class RallyBase(testcase.TestCase):
LOGGER.debug("Creating flavor '%s'...", self.flavor_name)
flavor_creator = OpenStackFlavor(
- self.os_creds, FlavorSettings(
+ self.os_creds, FlavorConfig(
name=self.flavor_name, ram=512, disk=1, vcpus=1,
metadata=self.FLAVOR_EXTRA_SPECS))
if flavor_creator is None or flavor_creator.create() is None:
@@ -524,7 +526,7 @@ class RallyBase(testcase.TestCase):
LOGGER.debug("Creating flavor '%s'...", self.flavor_alt_name)
flavor_alt_creator = OpenStackFlavor(
- self.os_creds, FlavorSettings(
+ self.os_creds, FlavorConfig(
name=self.flavor_alt_name, ram=1024, disk=1, vcpus=1,
metadata=self.FLAVOR_EXTRA_SPECS))
if flavor_alt_creator is None or flavor_alt_creator.create() is None:
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index f4b77936..bede02fb 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -26,11 +26,13 @@ from functest.opnfv_tests.openstack.tempest import conf_utils
from functest.utils.constants import CONST
import functest.utils.functest_utils as ft_utils
+from snaps.config.flavor import FlavorConfig
+from snaps.config.network import NetworkConfig, SubnetConfig
+from snaps.config.project import ProjectConfig
+from snaps.config.user import UserConfig
+
from snaps.openstack import create_flavor
-from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
-from snaps.openstack.create_project import ProjectSettings
-from snaps.openstack.create_network import NetworkSettings, SubnetSettings
-from snaps.openstack.create_user import UserSettings
+from snaps.openstack.create_flavor import OpenStackFlavor
from snaps.openstack.tests import openstack_tests
from snaps.openstack.utils import deploy_utils
@@ -335,7 +337,7 @@ class TempestResourcesManager(object):
project_name = CONST.__getattribute__(
'tempest_identity_tenant_name') + self.guid
project_creator = deploy_utils.create_project(
- self.os_creds, ProjectSettings(
+ self.os_creds, ProjectConfig(
name=project_name,
description=CONST.__getattribute__(
'tempest_identity_tenant_description')))
@@ -347,7 +349,7 @@ class TempestResourcesManager(object):
logger.debug("Creating user for Tempest suite")
user_creator = deploy_utils.create_user(
- self.os_creds, UserSettings(
+ self.os_creds, UserConfig(
name=CONST.__getattribute__(
'tempest_identity_user_name') + self.guid,
password=CONST.__getattribute__(
@@ -364,11 +366,11 @@ class TempestResourcesManager(object):
logger.debug("Creating private network for Tempest suite")
network_creator = deploy_utils.create_network(
- self.os_creds, NetworkSettings(
+ self.os_creds, NetworkConfig(
name=CONST.__getattribute__(
'tempest_private_net_name') + self.guid,
project_name=project_name,
- subnet_settings=[SubnetSettings(
+ subnet_settings=[SubnetConfig(
name=CONST.__getattribute__(
'tempest_private_subnet_name') + self.guid,
cidr=CONST.__getattribute__('tempest_private_subnet_cidr'))
@@ -421,7 +423,7 @@ class TempestResourcesManager(object):
if 'ovs' in scenario or 'fdio' in scenario:
flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE
flavor_creator = OpenStackFlavor(
- self.os_creds, FlavorSettings(
+ self.os_creds, FlavorConfig(
name=CONST.__getattribute__(
'openstack_flavor_name') + self.guid,
ram=CONST.__getattribute__('openstack_flavor_ram'),
@@ -441,7 +443,7 @@ class TempestResourcesManager(object):
if 'ovs' in scenario or 'fdio' in scenario:
flavor_metadata_alt = create_flavor.MEM_PAGE_SIZE_LARGE
flavor_creator_alt = OpenStackFlavor(
- self.os_creds, FlavorSettings(
+ self.os_creds, FlavorConfig(
name=CONST.__getattribute__(
'openstack_flavor_name_alt') + self.guid,
ram=CONST.__getattribute__('openstack_flavor_ram'),
diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py
index e719145b..de431fe1 100644
--- a/functest/opnfv_tests/openstack/vping/vping_base.py
+++ b/functest/opnfv_tests/openstack/vping/vping_base.py
@@ -16,10 +16,11 @@ from functest.core import testcase
from functest.opnfv_tests.openstack.snaps import snaps_utils
from functest.utils.constants import CONST
+from snaps.config.flavor import FlavorConfig
+from snaps.config.network import NetworkConfig, SubnetConfig
+from snaps.config.router import RouterConfig
from snaps.openstack import create_flavor
-from snaps.openstack.create_flavor import FlavorSettings, OpenStackFlavor
-from snaps.openstack.create_network import NetworkSettings, SubnetSettings
-from snaps.openstack.create_router import RouterSettings
+from snaps.openstack.create_flavor import OpenStackFlavor
from snaps.openstack.tests import openstack_tests
from snaps.openstack.utils import deploy_utils
@@ -130,12 +131,12 @@ class VPingBase(testcase.TestCase):
"Creating network with name: '%s'" % private_net_name)
self.network_creator = deploy_utils.create_network(
self.os_creds,
- NetworkSettings(
+ NetworkConfig(
name=private_net_name,
network_type=vping_network_type,
physical_network=vping_physical_network,
segmentation_id=vping_segmentation_id,
- subnet_settings=[SubnetSettings(
+ subnet_settings=[SubnetConfig(
name=private_subnet_name,
cidr=private_subnet_cidr)]))
self.creators.append(self.network_creator)
@@ -146,7 +147,7 @@ class VPingBase(testcase.TestCase):
ext_net_name = snaps_utils.get_ext_net_name(self.os_creds)
self.router_creator = deploy_utils.create_router(
self.os_creds,
- RouterSettings(
+ RouterConfig(
name=self.router_name,
external_gateway=ext_net_name,
internal_subnets=[private_subnet_name]))
@@ -160,8 +161,8 @@ class VPingBase(testcase.TestCase):
flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE
flavor_creator = OpenStackFlavor(
self.os_creds,
- FlavorSettings(name=self.flavor_name, ram=512, disk=1, vcpus=1,
- metadata=flavor_metadata))
+ FlavorConfig(name=self.flavor_name, ram=512, disk=1, vcpus=1,
+ metadata=flavor_metadata))
flavor_creator.create()
self.creators.append(flavor_creator)
diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py
index 1a04ad02..0d92a7e1 100644
--- a/functest/opnfv_tests/openstack/vping/vping_ssh.py
+++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py
@@ -22,13 +22,13 @@ from functest.core.testcase import TestCase
from functest.energy import energy
from functest.opnfv_tests.openstack.vping import vping_base
from functest.utils.constants import CONST
-from snaps.openstack.create_instance import FloatingIpSettings, \
- VmInstanceSettings
-from snaps.openstack.create_keypairs import KeypairSettings
-from snaps.openstack.create_network import PortSettings
-from snaps.openstack.create_security_group import Direction, Protocol, \
- SecurityGroupSettings, SecurityGroupRuleSettings
+from snaps.config.keypair import KeypairConfig
+from snaps.config.network import PortConfig
+from snaps.config.security_group import (
+ Direction, Protocol, SecurityGroupConfig, SecurityGroupRuleConfig)
+from snaps.config.vm_inst import FloatingIpConfig, VmInstanceConfig
+
from snaps.openstack.utils import deploy_utils
@@ -68,16 +68,16 @@ class VPingSSH(vping_base.VPingBase):
self.logger.info(log)
kp_creator = deploy_utils.create_keypair(
self.os_creds,
- KeypairSettings(name=self.kp_name,
- private_filepath=self.kp_priv_file,
- public_filepath=self.kp_pub_file))
+ KeypairConfig(
+ name=self.kp_name, private_filepath=self.kp_priv_file,
+ public_filepath=self.kp_pub_file))
self.creators.append(kp_creator)
# Creating Instance 1
- port1_settings = PortSettings(
+ port1_settings = PortConfig(
name=self.vm1_name + '-vPingPort',
network_name=self.network_creator.network_settings.name)
- instance1_settings = VmInstanceSettings(
+ instance1_settings = VmInstanceConfig(
name=self.vm1_name, flavor=self.flavor_name,
vm_boot_timeout=self.vm_boot_timeout,
vm_delete_timeout=self.vm_delete_timeout,
@@ -98,17 +98,17 @@ class VPingSSH(vping_base.VPingBase):
sg_creator = self.__create_security_group()
self.creators.append(sg_creator)
- port2_settings = PortSettings(
+ port2_settings = PortConfig(
name=self.vm2_name + '-vPingPort',
network_name=self.network_creator.network_settings.name)
- instance2_settings = VmInstanceSettings(
+ instance2_settings = VmInstanceConfig(
name=self.vm2_name, flavor=self.flavor_name,
vm_boot_timeout=self.vm_boot_timeout,
vm_delete_timeout=self.vm_delete_timeout,
ssh_connect_timeout=self.vm_ssh_connect_timeout,
port_settings=[port2_settings],
security_group_names=[sg_creator.sec_grp_settings.name],
- floating_ip_settings=[FloatingIpSettings(
+ floating_ip_settings=[FloatingIpConfig(
name=self.vm2_name + '-FIPName',
port_name=port2_settings.name,
router_name=self.router_creator.router_settings.name)])
@@ -218,24 +218,22 @@ class VPingSSH(vping_base.VPingBase):
"""
sg_rules = list()
sg_rules.append(
- SecurityGroupRuleSettings(sec_grp_name=self.sg_name,
- direction=Direction.ingress,
- protocol=Protocol.icmp))
+ SecurityGroupRuleConfig(
+ sec_grp_name=self.sg_name, direction=Direction.ingress,
+ protocol=Protocol.icmp))
sg_rules.append(
- SecurityGroupRuleSettings(sec_grp_name=self.sg_name,
- direction=Direction.ingress,
- protocol=Protocol.tcp, port_range_min=22,
- port_range_max=22))
+ SecurityGroupRuleConfig(
+ sec_grp_name=self.sg_name, direction=Direction.ingress,
+ protocol=Protocol.tcp, port_range_min=22, port_range_max=22))
sg_rules.append(
- SecurityGroupRuleSettings(sec_grp_name=self.sg_name,
- direction=Direction.egress,
- protocol=Protocol.tcp, port_range_min=22,
- port_range_max=22))
+ SecurityGroupRuleConfig(
+ sec_grp_name=self.sg_name, direction=Direction.egress,
+ protocol=Protocol.tcp, port_range_min=22, port_range_max=22))
log = "Security group with name: '%s'" % self.sg_name
self.logger.info(log)
return deploy_utils.create_security_group(self.os_creds,
- SecurityGroupSettings(
+ SecurityGroupConfig(
name=self.sg_name,
description=self.sg_desc,
rule_settings=sg_rules))
diff --git a/functest/opnfv_tests/openstack/vping/vping_userdata.py b/functest/opnfv_tests/openstack/vping/vping_userdata.py
index deaacfcc..4cc8f42f 100644
--- a/functest/opnfv_tests/openstack/vping/vping_userdata.py
+++ b/functest/opnfv_tests/openstack/vping/vping_userdata.py
@@ -9,9 +9,9 @@
import time
+from snaps.config.network import PortConfig
+from snaps.config.vm_inst import VmInstanceConfig
from snaps.openstack.utils import deploy_utils
-from snaps.openstack.create_instance import VmInstanceSettings
-from snaps.openstack.create_network import PortSettings
from functest.core.testcase import TestCase
from functest.opnfv_tests.openstack.vping import vping_base
@@ -37,10 +37,10 @@ class VPingUserdata(vping_base.VPingBase):
super(VPingUserdata, self).run()
# Creating Instance 1
- port1_settings = PortSettings(
+ port1_settings = PortConfig(
name=self.vm1_name + '-vPingPort',
network_name=self.network_creator.network_settings.name)
- instance1_settings = VmInstanceSettings(
+ instance1_settings = VmInstanceConfig(
name=self.vm1_name,
flavor=self.flavor_name,
vm_boot_timeout=self.vm_boot_timeout,
@@ -58,10 +58,10 @@ class VPingUserdata(vping_base.VPingBase):
self.vm1_creator.get_port_ip(port1_settings.name))
if userdata:
# Creating Instance 2
- port2_settings = PortSettings(
+ port2_settings = PortConfig(
name=self.vm2_name + '-vPingPort',
network_name=self.network_creator.network_settings.name)
- instance2_settings = VmInstanceSettings(
+ instance2_settings = VmInstanceConfig(
name=self.vm2_name,
flavor=self.flavor_name,
vm_boot_timeout=self.vm_boot_timeout,