CLOUDSTACK-5925: Moved test data from testsuites to marvin/config

Also merged redundant testdata as they were found.
This commit is contained in:
Girish Shilamkar 2014-01-22 05:45:19 +05:30
parent 9393275611
commit 6a2cc9fbd0
32 changed files with 632 additions and 1816 deletions

View File

@ -24,44 +24,6 @@ from marvin.integration.lib.common import *
from marvin.sshClient import SshClient
from nose.plugins.attrib import attr
class Services:
"""Test Account Services
"""
def __init__(self):
self.services = {
"domain": {
"name": "Domain",
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
# in MHz
"memory": 128,
# In MBs
},
"ostype": 'CentOS 5.3 (64-bit)',
"virtual_machine" : {
"affinity": {
"name": "webvms",
"type": "host anti-affinity",
},
"hypervisor" : "XenServer",
}
}
class TestDeployVmWithAffinityGroup(cloudstackTestCase):
"""
This test deploys a virtual machine into a user account
@ -73,7 +35,7 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
cls.test_client = super(TestDeployVmWithAffinityGroup, cls).getClsTestClient()
zone_name = cls.test_client.getZoneForTests()
cls.api_client = cls.test_client.getApiClient()
cls.services = Services().services
cls.services = cls.test_client.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
@ -97,7 +59,7 @@ class TestDeployVmWithAffinityGroup(cloudstackTestCase):
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.ag = AffinityGroup.create(cls.api_client, cls.services["virtual_machine"]["affinity"],

View File

@ -33,46 +33,15 @@ from marvin.integration.lib.common import get_zone, get_domain, get_template
from nose.plugins.attrib import attr
class TestData(object):
"""Test data object that is required to create resources
"""
def __init__(self):
self.testdata = {
#data to create an account
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
#data reqd for virtual machine creation
"virtual_machine" : {
"name" : "testvm",
"displayname" : "Test VM",
},
#small service offering
"service_offering": {
"small": {
"name": "Small Instance",
"displaytext": "Small Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
},
"ostype": 'CentOS 5.3 (64-bit)',
}
class TestDeployVM(cloudstackTestCase):
"""Test deploy a VM into a user account
"""
def setUp(self):
self.testdata = TestData().testdata
self.apiclient = self.testClient.getApiClient()
self.testdata = self.testClient.getConfigParser().parsedDict
# Get Zone, Domain and Default Built-in template
self.domain = get_domain(self.apiclient, self.testdata)
self.zone = get_zone(self.apiclient, self.testdata)
@ -88,7 +57,7 @@ class TestDeployVM(cloudstackTestCase):
#create a service offering
self.service_offering = ServiceOffering.create(
self.apiclient,
self.testdata["service_offering"]["small"]
self.testdata["service_offerings"]["small"]
)
#build cleanup list
self.cleanup = [

View File

@ -26,52 +26,23 @@ from nose.plugins.attrib import attr
import random
import string
class Services:
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"ostype": 'CentOS 5.3 (64-bit)',
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
}
class TestDeployVmWithUserData(cloudstackTestCase):
"""Tests for UserData
"""
@classmethod
def setUpClass(cls):
cls.apiClient = super(TestDeployVmWithUserData, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestDeployVmWithUserData, cls).getClsTestClient()
cls.apiClient = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
cls.zone = get_zone(cls.apiClient, cls.services)
if cls.zone.localstorageenabled:
#For devcloud since localstroage is enabled
cls.services["service_offering"]["storagetype"] = "local"
cls.services["service_offerings"]["storagetype"] = "local"
cls.service_offering = ServiceOffering.create(
cls.apiClient,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.account = Account.create(cls.apiClient, services=cls.services["account"])
cls.cleanup = [cls.account]

View File

@ -21,34 +21,6 @@ from marvin.integration.lib.common import get_zone, get_domain, get_template
from marvin.integration.lib.utils import cleanup_resources
from nose.plugins.attrib import attr
class Services:
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Planner Service Offering",
"displaytext": "Planner Service Offering",
"cpunumber": 1,
"cpuspeed": 100,
# in MHz
"memory": 128,
# In MBs
},
"ostype": 'CentOS 5.3 (64-bit)',
"virtual_machine": {
"hypervisor": "XenServer",
}
}
class TestDeployVmWithVariedPlanners(cloudstackTestCase):
""" Test to create services offerings for deployment planners
- firstfit, userdispersing
@ -56,8 +28,10 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.apiclient = super(TestDeployVmWithVariedPlanners, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestDeployVmWithVariedPlanners, cls).getClsTestClient()
cls.apiclient = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.apiclient, cls.services)
cls.zone = get_zone(cls.apiclient, cls.services)
@ -89,7 +63,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
#FIXME: How do we know that first fit actually happened?
self.service_offering_firstfit = ServiceOffering.create(
self.apiclient,
self.services["service_offering"],
self.services["service_offerings"],
deploymentplanner='FirstFitPlanner'
)
@ -132,7 +106,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
"""
self.service_offering_userdispersing = ServiceOffering.create(
self.apiclient,
self.services["service_offering"],
self.services["service_offerings"],
deploymentplanner='UserDispersingPlanner'
)
@ -191,7 +165,7 @@ class TestDeployVmWithVariedPlanners(cloudstackTestCase):
"""
self.service_offering_userconcentrated = ServiceOffering.create(
self.apiclient,
self.services["service_offering"],
self.services["service_offerings"],
deploymentplanner='UserConcentratedPodPlanner'
)

View File

@ -27,23 +27,10 @@ from nose.plugins.attrib import attr
_multiprocess_shared_ = True
class Services:
"""Test Disk offerings Services
"""
def __init__(self):
self.services = {
"off": {
"name": "Disk offering",
"displaytext": "Disk offering",
"disksize": 1 # in GB
},
}
class TestCreateDiskOffering(cloudstackTestCase):
def setUp(self):
self.services = Services().services
self.services = self.testClient.getConfigParser().parsedDict
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
@ -68,7 +55,7 @@ class TestCreateDiskOffering(cloudstackTestCase):
disk_offering = DiskOffering.create(
self.apiclient,
self.services["off"]
self.services["disk_offering"]
)
self.cleanup.append(disk_offering)
@ -92,12 +79,12 @@ class TestCreateDiskOffering(cloudstackTestCase):
self.assertEqual(
disk_response.displaytext,
self.services["off"]["displaytext"],
self.services["disk_offering"]["displaytext"],
"Check server id in createServiceOffering"
)
self.assertEqual(
disk_response.name,
self.services["off"]["name"],
self.services["disk_offering"]["name"],
"Check name in createServiceOffering"
)
return
@ -122,15 +109,17 @@ class TestDiskOfferings(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.services = Services().services
cls.api_client = super(TestDiskOfferings, cls).getClsTestClient().getApiClient()
cloudstackTestClient = super(TestDiskOfferings, cls).getClsTestClient()
self.api_client = self.cloudstackTestClient.getApiClient()
self.services = self.cloudstackTestClient.getConfigParser().parsedDict
cls.disk_offering_1 = DiskOffering.create(
cls.api_client,
cls.services["off"]
cls.services["disk_offering"]
)
cls.disk_offering_2 = DiskOffering.create(
cls.api_client,
cls.services["off"]
cls.services["disk_offering"]
)
cls._cleanup = [cls.disk_offering_1]
return

View File

@ -26,35 +26,14 @@ from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
import datetime
class Services:
"""Test Dedicating Guest Vlan Ranges
"""
def __init__(self):
self.services = {
"domain": {
"name": "Domain",
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
"name": "testphysicalnetwork",
"vlan": "2118-2120",
}
class TestDedicateGuestVlanRange(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.apiclient = super(TestDedicateGuestVlanRange, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestDedicateGuestVlanRange, cls).getClsTestClient()
cls.apiclient = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain
cls.domain = get_domain(cls.apiclient, cls.services)
cls.zone = get_zone(cls.apiclient, cls.services)

View File

@ -30,79 +30,13 @@ import time
_multiprocess_shared_ = True
class Services:
"""Test Hosts & Clusters Services
"""
def __init__(self):
self.services = {
"clusters": {
0: {
"clustername": "Xen Cluster",
"clustertype": "CloudManaged",
# CloudManaged or ExternalManaged"
"hypervisor": "XenServer",
# Hypervisor type
},
1: {
"clustername": "KVM Cluster",
"clustertype": "CloudManaged",
# CloudManaged or ExternalManaged"
"hypervisor": "KVM",
# Hypervisor type
},
2: {
"hypervisor": 'VMware',
# Hypervisor type
"clustertype": 'ExternalManaged',
# CloudManaged or ExternalManaged"
"username": 'administrator',
"password": 'fr3sca',
"url": 'http://192.168.100.17/CloudStack-Clogeny-Pune/Pune-1',
# Format:http://vCenter Host/Datacenter/Cluster
"clustername": 'VMWare Cluster',
},
},
"hosts": {
"xenserver": {
# Must be name of corresponding Hypervisor type
# in cluster in small letters
"hypervisor": 'XenServer',
# Hypervisor type
"clustertype": 'CloudManaged',
# CloudManaged or ExternalManaged"
"url": 'http://192.168.100.211',
"username": "root",
"password": "fr3sca",
},
"kvm": {
"hypervisor": 'KVM',
# Hypervisor type
"clustertype": 'CloudManaged',
# CloudManaged or ExternalManaged"
"url": 'http://192.168.100.212',
"username": "root",
"password": "fr3sca",
},
"vmware": {
"hypervisor": 'VMware',
# Hypervisor type
"clustertype": 'ExternalManaged',
# CloudManaged or ExternalManaged"
"url": 'http://192.168.100.203',
"username": "administrator",
"password": "fr3sca",
},
},
}
class TestHosts(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.services = Services().services
self.services = self.testClient.getConfigParser().parsedDict
self.zone = get_zone(self.apiclient, self.services)
self.pod = get_pod(self.apiclient, self.zone.id, self.services)
self.cleanup = []

View File

@ -24,73 +24,21 @@ from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
from nose.plugins.attrib import attr
class Services:
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"ostype": 'CentOS 5.3 (64-bit)',
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
"network_offering": {
"name": "Network offering for internal lb service",
"displaytext": "Network offering for internal lb service",
"guestiptype": "Isolated",
"traffictype": "Guest",
"supportedservices": "Vpn,Dhcp,Dns,Lb,UserData,SourceNat,StaticNat,PortForwarding,NetworkACL",
"serviceProviderList": {
"Dhcp": "VpcVirtualRouter",
"Dns": "VpcVirtualRouter",
"Vpn": "VpcVirtualRouter",
"UserData": "VpcVirtualRouter",
"Lb": "InternalLbVM",
"SourceNat": "VpcVirtualRouter",
"StaticNat": "VpcVirtualRouter",
"PortForwarding": "VpcVirtualRouter",
"NetworkACL": "VpcVirtualRouter",
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "peraccount"},
"Lb": {"lbSchemes": "internal", "SupportedLbIsolation": "dedicated"}
}
}
}
class TestInternalLb(cloudstackTestCase):
"""Test Internal LB
"""
@classmethod
def setUpClass(cls):
cls.apiclient = super(TestInternalLb, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestInternalLb, cls).getClsTestClient()
cls.apiclient = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
cls.zone = get_zone(cls.apiclient, cls.services)
cls.domain = get_domain(cls.apiclient)
cls.service_offering = ServiceOffering.create(
cls.apiclient,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.account = Account.create(cls.apiclient, services=cls.services["account"])
cls.template = get_template(
@ -109,7 +57,7 @@ class TestInternalLb(cloudstackTestCase):
"""
#1) Create and enable network offering with Internal Lb vm service
self.networkOffering = NetworkOffering.create(self.apiclient, self.services["network_offering"], conservemode=False)
self.networkOffering = NetworkOffering.create(self.apiclient, self.services["network_offering_internal_lb"], conservemode=False)
self.networkOffering.update(self.apiclient, state="Enabled")
#2) Create VPC and network in it

View File

@ -31,61 +31,10 @@ import time
_multiprocess_shared_ = True
class Services:
"""Test ISO Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended in create account to
# ensure unique username generated each time
"password": "password",
},
"iso_1":
{
"displaytext": "Test ISO 1",
"name": "ISO 1",
"url": "http://people.apache.org/~tsp/dummy.iso",
# Source URL where ISO is located
"isextractable": True,
"isfeatured": True,
"ispublic": True,
"ostype": "CentOS 5.3 (64-bit)",
},
"iso_2":
{
"displaytext": "Test ISO 2",
"name": "ISO 2",
"url": "http://people.apache.org/~tsp/dummy.iso",
# Source URL where ISO is located
"isextractable": True,
"isfeatured": True,
"ispublic": True,
"ostype": "CentOS 5.3 (64-bit)",
"mode": 'HTTP_DOWNLOAD',
# Used in Extract template, value must be HTTP_DOWNLOAD
},
"isfeatured": True,
"ispublic": True,
"isextractable": True,
"bootable": True, # For edit template
"passwordenabled": True,
"sleep": 60,
"timeout": 10,
"ostype": "CentOS 5.3 (64-bit)",
# CentOS 5.3 (64 bit)
}
class TestCreateIso(cloudstackTestCase):
def setUp(self):
self.services = Services().services
self.services = self.testClient.getConfigParser().parsedDict
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
# Get Zone, Domain and templates
@ -189,8 +138,9 @@ class TestISO(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.services = Services().services
cls.api_client = super(TestISO, cls).getClsTestClient().getApiClient()
cloudstackTestClient = super(TestISO, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)

View File

@ -27,87 +27,15 @@ import time
_multiprocess_shared_ = True
class Services:
"""Test Network Services
"""
def __init__(self):
self.services = {
"ostype": "CentOS 5.3 (64-bit)",
# Cent OS 5.3 (64 bit)
"lb_switch_wait": 10,
# Time interval after which LB switches the requests
"sleep": 60,
"timeout":10,
"network_offering": {
"name": 'Test Network offering',
"displaytext": 'Test Network offering',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding',
"traffictype": 'GUEST',
"availability": 'Optional',
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"SourceNat": 'VirtualRouter',
"PortForwarding": 'VirtualRouter',
},
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
# in MHz
"memory": 256,
# In MBs
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
"server":
{
"displayname": "Small Instance",
"username": "root",
"password": "password",
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"ssh_port": 22,
"protocol": 'TCP',
},
"natrule":
{
"privateport": 22,
"publicport": 2222,
"protocol": "TCP"
},
"lbrule":
{
"name": "SSH",
"alg": "roundrobin",
# Algorithm used for load balancing
"privateport": 22,
"publicport": 2222,
"protocol": 'TCP'
}
}
class TestLoadBalance(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestLoadBalance, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestLoadBalance, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
@ -127,7 +55,7 @@ class TestLoadBalance(cloudstackTestCase):
)
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.vm_1 = VirtualMachine.create(
cls.api_client,

View File

@ -38,44 +38,12 @@ from marvin.cloudstackAPI.listNics import listNicsCmd
from nose.plugins.attrib import attr
class TestData(object):
"""Test data object that is required to create resources
"""
def __init__(self):
self.testdata = {
#data to create an account
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
#data reqd for virtual machine creation
"virtual_machine" : {
"name" : "testvm",
"displayname" : "Test VM",
},
#small service offering
"service_offering": {
"small": {
"name": "Small Instance",
"displaytext": "Small Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
},
"ostype": 'CentOS 5.3 (64-bit)',
}
class TestDeployVM(cloudstackTestCase):
"""Test deploy a VM into a user account
"""
def setUp(self):
self.testdata = TestData().testdata
self.testdata = self.testClient.getConfigParser().parsedDict
self.apiclient = self.testClient.getApiClient()
# Get Zone, Domain and Default Built-in template
@ -93,7 +61,7 @@ class TestDeployVM(cloudstackTestCase):
#create a service offering
self.service_offering = ServiceOffering.create(
self.apiclient,
self.testdata["service_offering"]["small"]
self.testdata["service_offerings"]["small"]
)
#build cleanup list
self.cleanup = [

View File

@ -31,80 +31,6 @@ import time
_multiprocess_shared_ = True
class Services:
"""Test Network Services
"""
def __init__(self):
self.services = {
"ostype": "CentOS 5.3 (64-bit)",
# Cent OS 5.3 (64 bit)
"lb_switch_wait": 10,
# Time interval after which LB switches the requests
"sleep": 60,
"timeout":10,
"network_offering": {
"name": 'Test Network offering',
"displaytext": 'Test Network offering',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding',
"traffictype": 'GUEST',
"availability": 'Optional',
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"SourceNat": 'VirtualRouter',
"PortForwarding": 'VirtualRouter',
},
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
# in MHz
"memory": 256,
# In MBs
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
"server":
{
"displayname": "Small Instance",
"username": "root",
"password": "password",
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"ssh_port": 22,
"protocol": 'TCP',
},
"natrule":
{
"privateport": 22,
"publicport": 22,
"protocol": "TCP"
},
"lbrule":
{
"name": "SSH",
"alg": "roundrobin",
# Algorithm used for load balancing
"privateport": 22,
"publicport": 2222,
"protocol": 'TCP'
}
}
class TestPublicIP(cloudstackTestCase):
@ -114,8 +40,10 @@ class TestPublicIP(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestPublicIP, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestPublicIP, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
@ -293,9 +221,10 @@ class TestPortForwarding(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestPortForwarding, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestPortForwarding, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
@ -311,14 +240,14 @@ class TestPortForwarding(cloudstackTestCase):
admin=True,
domainid=cls.domain.id
)
cls.services["server"]["zoneid"] = cls.zone.id
cls.services["virtual_machine"]["zoneid"] = cls.zone.id
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.virtual_machine = VirtualMachine.create(
cls.api_client,
cls.services["server"],
cls.services["virtual_machine"],
templateid=template.id,
accountid=cls.account.name,
domainid=cls.account.domainid,
@ -483,7 +412,7 @@ class TestPortForwarding(cloudstackTestCase):
self.account.name,
self.zone.id,
self.account.domainid,
self.services["server"]
self.services["virtual_machine"]
)
self.cleanup.append(ip_address)
@ -596,7 +525,7 @@ class TestRebootRouter(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.services = Services().services
self.services = self.testClient.cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
self.domain = get_domain(self.apiclient, self.services)
@ -606,7 +535,7 @@ class TestRebootRouter(cloudstackTestCase):
self.zone.id,
self.services["ostype"]
)
self.services["server"]["zoneid"] = self.zone.id
self.services["virtual_machine"]["zoneid"] = self.zone.id
#Create an account, network, VM and IP addresses
self.account = Account.create(
@ -617,11 +546,11 @@ class TestRebootRouter(cloudstackTestCase):
)
self.service_offering = ServiceOffering.create(
self.apiclient,
self.services["service_offering"]
self.services["service_offerings"]
)
self.vm_1 = VirtualMachine.create(
self.apiclient,
self.services["server"],
self.services["virtual_machine"],
templateid=template.id,
accountid=self.account.name,
domainid=self.account.domainid,
@ -646,7 +575,7 @@ class TestRebootRouter(cloudstackTestCase):
self.vm_1.account,
self.vm_1.zoneid,
self.vm_1.domainid,
self.services["server"]
self.services["virtual_machine"]
)
#Open up firewall port for SSH
fw_rule = FireWallRule.create(
@ -762,7 +691,7 @@ class TestReleaseIP(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.services = Services().services
self.services = self.testClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
self.domain = get_domain(self.apiclient, self.services)
@ -772,7 +701,7 @@ class TestReleaseIP(cloudstackTestCase):
self.zone.id,
self.services["ostype"]
)
self.services["server"]["zoneid"] = self.zone.id
self.services["virtual_machine"]["zoneid"] = self.zone.id
#Create an account, network, VM, Port forwarding rule, LB rules
self.account = Account.create(
@ -784,12 +713,12 @@ class TestReleaseIP(cloudstackTestCase):
self.service_offering = ServiceOffering.create(
self.apiclient,
self.services["service_offering"]
self.services["service_offerings"]
)
self.virtual_machine = VirtualMachine.create(
self.apiclient,
self.services["server"],
self.services["virtual_machine"],
templateid=template.id,
accountid=self.account.name,
domainid=self.account.domainid,
@ -899,7 +828,7 @@ class TestDeleteAccount(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.services = Services().services
self.services = self.testClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
self.domain = get_domain(self.apiclient, self.services)
@ -909,7 +838,7 @@ class TestDeleteAccount(cloudstackTestCase):
self.zone.id,
self.services["ostype"]
)
self.services["server"]["zoneid"] = self.zone.id
self.services["virtual_machine"]["zoneid"] = self.zone.id
#Create an account, network, VM and IP addresses
self.account = Account.create(
@ -920,11 +849,11 @@ class TestDeleteAccount(cloudstackTestCase):
)
self.service_offering = ServiceOffering.create(
self.apiclient,
self.services["service_offering"]
self.services["service_offerings"]
)
self.vm_1 = VirtualMachine.create(
self.apiclient,
self.services["server"],
self.services["virtual_machine"],
templateid=template.id,
accountid=self.account.name,
domainid=self.account.domainid,

View File

@ -24,70 +24,19 @@ from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
from nose.plugins.attrib import attr
class Services:
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"ostype": 'CentOS 5.3 (64-bit)',
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
"network_offering": {
"name": "Network offering for internal lb service",
"displaytext": "Network offering for internal lb service",
"guestiptype": "Isolated",
"traffictype": "Guest",
"supportedservices": "Vpn,Dhcp,Dns,Lb,UserData,SourceNat,StaticNat,PortForwarding,NetworkACL",
"serviceProviderList": {
"Dhcp": "VpcVirtualRouter",
"Dns": "VpcVirtualRouter",
"Vpn": "VpcVirtualRouter",
"UserData": "VpcVirtualRouter",
"Lb": "InternalLbVM",
"SourceNat": "VpcVirtualRouter",
"StaticNat": "VpcVirtualRouter",
"PortForwarding": "VpcVirtualRouter",
"NetworkACL": "VpcVirtualRouter",
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "peraccount"},
"Lb": {"lbSchemes": "internal", "SupportedLbIsolation": "dedicated"}
}
}
}
class TestNetworkACL(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.apiclient = super(TestNetworkACL, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestNetworkACL, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
cls.zone = get_zone(cls.apiclient, cls.services)
cls.domain = get_domain(cls.apiclient)
cls.service_offering = ServiceOffering.create(
cls.apiclient,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.account = Account.create(cls.apiclient, services=cls.services["account"])
cls.template = get_template(

View File

@ -28,107 +28,6 @@ import signal
import sys
import time
class Services:
def __init__(self):
self.services = {
"disk_offering":{
"displaytext": "Small",
"name": "Small",
"disksize": 1
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended in create account to
# ensure unique username generated each time
"password": "password",
},
# Create a small virtual machine instance with disk offering
"small": {
"displayname": "testserver",
"username": "root", # VM creds for SSH
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"service_offerings": {
"tiny": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100, # in MHz
"memory": 128, # In MBs
},
},
"network_offering": {
"name": 'Test Network offering',
"displaytext": 'Test Network offering',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding',
"traffictype": 'GUEST',
"availability": 'Optional',
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"SourceNat": 'VirtualRouter',
"PortForwarding": 'VirtualRouter',
},
},
"network_offering_shared": {
"name": 'Test Network offering shared',
"displaytext": 'Test Network offering Shared',
"guestiptype": 'Shared',
"supportedservices": 'Dhcp,Dns,UserData',
"traffictype": 'GUEST',
"specifyVlan" : "True",
"specifyIpRanges" : "True",
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"UserData": 'VirtualRouter',
},
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
"acltype": "Account",
},
"network2": {
"name": "Test Network Shared",
"displaytext": "Test Network Shared",
"vlan" :1201,
"gateway" :"172.16.15.1",
"netmask" :"255.255.255.0",
"startip" :"172.16.15.21",
"endip" :"172.16.15.41",
"acltype": "Account",
},
# ISO settings for Attach/Detach ISO tests
"iso": {
"displaytext": "Test ISO",
"name": "testISO",
"url": "http://people.apache.org/~tsp/dummy.iso",
# Source URL where ISO is located
"ostype": 'CentOS 5.3 (64-bit)',
"mode": 'HTTP_DOWNLOAD', # Downloading existing ISO
},
"template": {
"displaytext": "Cent OS Template",
"name": "Cent OS Template",
"passwordenabled": True,
},
"sleep": 60,
"timeout": 10,
#Migrate VM to hostid
"ostype": 'CentOS 5.3 (64-bit)',
# CentOS 5.3 (64-bit)
}
class TestNic(cloudstackTestCase):
def setUp(self):
@ -145,7 +44,7 @@ class TestNic(cloudstackTestCase):
try:
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.services = Services().services
self.services = self.testClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
domain = get_domain(self.apiclient, self.services)
@ -169,7 +68,7 @@ class TestNic(cloudstackTestCase):
self.services["small"]["zoneid"] = zone.id
self.services["small"]["template"] = template.id
self.services["iso"]["zoneid"] = zone.id
self.services["iso_1"]["zoneid"] = zone.id
self.services["network"]["zoneid"] = zone.id
# Create Account, VMs, NAT Rules etc

View File

@ -23,68 +23,6 @@ from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
from nose.plugins.attrib import attr
class Services:
"""Test Data
"""
def __init__(self):
self.services = {
"domain": {
"name": "Domain",
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
# in MHz
"memory": 128,
# In MBs
},
"network_offering": {
"name": 'Test Network offering',
"displaytext": 'Test Network offering',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding',
"traffictype": 'GUEST',
"availability": 'Optional',
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"SourceNat": 'VirtualRouter',
"PortForwarding": 'VirtualRouter',
},
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
},
"ostype": 'CentOS 5.3 (64-bit)',
"gateway" : "172.1.1.1",
"netmask" : "255.255.255.0",
"startip" : "172.1.1.10",
"endip" : "172.1.1.20",
"regionid" : "1",
"vlan" :"10",
"isportable" : "true",
"virtual_machine" : {
"affinity": {
"name": "webvms",
"type": "host anti-affinity",
},
"hypervisor" : "XenServer",
}
}
class TestPortablePublicIPRange(cloudstackTestCase):
"""
@ -95,8 +33,10 @@ class TestPortablePublicIPRange(cloudstackTestCase):
"""
@classmethod
def setUpClass(cls):
cls.api_client = super(TestPortablePublicIPRange, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestPortablePublicIPRange, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
@ -161,8 +101,10 @@ class TestPortablePublicIPAcquire(cloudstackTestCase):
"""
@classmethod
def setUpClass(cls):
cls.api_client = super(TestPortablePublicIPAcquire, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestPortablePublicIPAcquire, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)

View File

@ -29,31 +29,12 @@ from nose.plugins.attrib import attr
import time
_multiprocess_shared_ = True
class Services:
"""Test Primary storage Services
"""
def __init__(self):
self.services = {
"nfs":
{
"url": "nfs://10.147.28.7/export/home/talluri/testprimary",
# Format: File_System_Type/Location/Path
"name": "Primary XEN"
},
"iscsi": {
"url": "iscsi://192.168.100.21/iqn.2012-01.localdomain.clo-cstack-cos6:iser/1",
# Format : iscsi://IP Address/IQN number/LUN#
"name": "Primary iSCSI"
}
}
class TestPrimaryStorageServices(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.services = Services().services
self.services = self.testClient.getConfigParser().parsedDict
self.cleanup = []
# Get Zone and pod
self.zone = get_zone(self.apiclient, self.services)

View File

@ -26,32 +26,6 @@ from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
import datetime
class Services:
"""Test Dedicating Public IP addresses
"""
def __init__(self):
self.services = {
"domain": {
"name": "Domain",
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
"gateway": "10.102.197.1",
"netmask": "255.255.255.0",
"forvirtualnetwork": "true",
"startip": "10.102.197.70",
"endip": "10.102.197.73",
"zoneid": "1",
"podid": "",
"vlan": "4444",
}
class TestDedicatePublicIPRange(cloudstackTestCase):
@classmethod

View File

@ -22,25 +22,16 @@ from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
from nose.plugins.attrib import attr
class Services:
def __init__(self):
self.services = {
"region": {
"regionid": "2",
"regionname": "Region2",
"regionendpoint": "http://region2:8080/client"
}
}
class TestRegions(cloudstackTestCase):
"""Test Regions - basic region creation
"""
@classmethod
def setUpClass(cls):
cls.api_client = super(TestRegions, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestRegions, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
cls.domain = get_domain(cls.api_client, cls.services)
cls.cleanup = []
@ -90,4 +81,4 @@ class TestRegions(cloudstackTestCase):
list_region = Region.list(cls.api_client, id=cls.services["region"]["regionid"])
assert list_region is None, "Region deletion fails"
except Exception as e:
raise Exception("Warning: Region cleanup/delete fails with : %s" % e)
raise Exception("Warning: Region cleanup/delete fails with : %s" % e)

View File

@ -27,66 +27,12 @@ from nose.plugins.attrib import attr
_multiprocess_shared_ = True
class Services:
"""Test VM Life Cycle Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended in create account to
# ensure unique username generated each time
"password": "password",
},
"small":
# Create a small virtual machine instance with disk offering
{
"displayname": "testserver",
"username": "root", # VM creds for SSH
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"service_offerings":
{
"small":
{
# Small service offering ID to for change VM
# service offering from medium to small
"name": "SmallInstance_volatile",
"displaytext": "SmallInstance_volatile",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
},
#Change this
"template": {
"displaytext": "xs",
"name": "xs",
"passwordenabled": False,
},
"sleep": 60,
"timeout": 10,
#Migrate VM to hostid
"ostype": 'CentOS 5.3 (64-bit)',
# CentOS 5.3 (64-bit)
}
class TestResetVmOnReboot(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestResetVmOnReboot, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestResetVmOnReboot, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
domain = get_domain(cls.api_client, cls.services)

View File

@ -29,81 +29,14 @@ from nose.plugins.attrib import attr
import time
_multiprocess_shared_ = True
class Services:
"""Test VM Life Cycle Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended in create account to
# ensure unique username generated each time
"password": "password",
},
"small":
# Create a small virtual machine instance with disk offering
{
"displayname": "testserver",
"username": "root", # VM creds for SSH
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"disk_offering": {
"displaytext": "Small",
"name": "Small",
"storagetype": "shared",
"disksize": 1
},
"service_offerings":
{
"small":
{
# Small service offering ID to for change VM
# service offering from medium to small
"name": "SmallInstance",
"displaytext": "SmallInstance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
"big":
{
# Big service offering ID to for change VM
"name": "BigInstance",
"displaytext": "BigInstance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 512,
}
},
#Change this
"template": {
"displaytext": "xs",
"name": "xs",
"passwordenabled": False,
},
"sleep": 60,
"timeout": 10,
#Migrate VM to hostid
"ostype": 'CentOS 5.6 (64-bit)',
# CentOS 5.3 (64-bit)
}
class TestResourceDetail(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestResourceDetail, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestResourceDetail, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
domain = get_domain(cls.api_client, cls.services)

View File

@ -30,53 +30,16 @@ import time
_multiprocess_shared_ = True
class Services:
"""Test router Services
"""
def __init__(self):
self.services = {
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100, # in MHz
"memory": 128, # In MBs
},
"virtual_machine":
{
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "testuser",
"password": "password",
},
"ostype": "CentOS 5.3 (64-bit)",
"sleep": 60,
"timeout": 10,
}
class TestRouterServices(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(
TestRouterServices,
cls
).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestRouterServices, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
@ -96,7 +59,7 @@ class TestRouterServices(cloudstackTestCase):
)
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.vm_1 = VirtualMachine.create(
cls.api_client,

View File

@ -27,75 +27,12 @@ from nose.plugins.attrib import attr
_multiprocess_shared_ = True
class Services:
"""Test VM Life Cycle Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended in create account to
# ensure unique username generated each time
"password": "password",
},
"small":
# Create a small virtual machine instance with disk offering
{
"displayname": "testserver",
"username": "root", # VM creds for SSH
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"service_offerings":
{
"small":
{
# Small service offering ID to for change VM
# service offering from medium to small
"name": "SmallInstance",
"displaytext": "SmallInstance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
"big":
{
# Big service offering ID to for change VM
"name": "BigInstance",
"displaytext": "BigInstance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 512,
}
},
#Change this
"template": {
"displaytext": "xs",
"name": "xs",
"passwordenabled": False,
},
"sleep": 60,
"timeout": 10,
#Migrate VM to hostid
"ostype": 'CentOS 5.3 (64-bit)',
# CentOS 5.3 (64-bit)
}
class TestScaleVm(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestScaleVm, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestScaleVm, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
domain = get_domain(cls.api_client, cls.services)

View File

@ -35,93 +35,13 @@ from nose.plugins.attrib import attr
_multiprocess_shared_ = True
class Services:
"""Test Service offerings Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended in create account to
# ensure unique username generated each time
"password": "password",
},
"off":
{
"name": "Service Offering",
"displaytext": "Service Offering",
"cpunumber": 1,
"cpuspeed": 100, # MHz
"memory": 128, # in MBs
},
"small":
# Create a small virtual machine instance with disk offering
{
"displayname": "testserver",
"username": "root", # VM creds for SSH
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"medium": # Create a medium virtual machine instance
{
"displayname": "testserver",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"service_offerings":
{
"tiny":
{
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100, # in MHz
"memory": 128, # In MBs
},
"small":
{
# Small service offering ID to for change VM
# service offering from medium to small
"name": "Small Instance",
"displaytext": "Small Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 128,
},
"medium":
{
# Medium service offering ID to for
# change VM service offering from small to medium
"name": "Medium Instance",
"displaytext": "Medium Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
}
},
"ostype": 'CentOS 5.3 (64-bit)',
}
class TestCreateServiceOffering(cloudstackTestCase):
def setUp(self):
self.apiclient = self.testClient.getApiClient()
self.dbclient = self.testClient.getDbConnection()
self.cleanup = []
self.services = Services().services
self.services = self.testClient.getConfigParser().parsedDict
def tearDown(self):
try:
@ -143,7 +63,7 @@ class TestCreateServiceOffering(cloudstackTestCase):
service_offering = ServiceOffering.create(
self.apiclient,
self.services["off"]
self.services["service_offerings"]
)
self.cleanup.append(service_offering)
@ -168,27 +88,27 @@ class TestCreateServiceOffering(cloudstackTestCase):
self.assertEqual(
list_service_response[0].cpunumber,
self.services["off"]["cpunumber"],
self.services["service_offerings"]["cpunumber"],
"Check server id in createServiceOffering"
)
self.assertEqual(
list_service_response[0].cpuspeed,
self.services["off"]["cpuspeed"],
self.services["service_offerings"]["cpuspeed"],
"Check cpuspeed in createServiceOffering"
)
self.assertEqual(
list_service_response[0].displaytext,
self.services["off"]["displaytext"],
self.services["service_offerings"]["displaytext"],
"Check server displaytext in createServiceOfferings"
)
self.assertEqual(
list_service_response[0].memory,
self.services["off"]["memory"],
self.services["service_offerings"]["memory"],
"Check memory in createServiceOffering"
)
self.assertEqual(
list_service_response[0].name,
self.services["off"]["name"],
self.services["service_offerings"]["name"],
"Check name in createServiceOffering"
)
return
@ -212,19 +132,21 @@ class TestServiceOfferings(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestServiceOfferings, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestServiceOfferings, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
cls.services['mode'] = cls.zone.networktype
cls.service_offering_1 = ServiceOffering.create(
cls.api_client,
cls.services["off"]
cls.services["service_offerings"]
)
cls.service_offering_2 = ServiceOffering.create(
cls.api_client,
cls.services["off"]
cls.services["service_offerings"]
)
template = get_template(
cls.api_client,

View File

@ -22,112 +22,14 @@ from marvin.integration.lib.utils import *
from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
class Services:
"""Test Snapshots Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 200, # in MHz
"memory": 256, # In MBs
},
"disk_offering": {
"displaytext": "Small Disk",
"name": "Small Disk",
"disksize": 1
},
"server_with_disk":
{
"displayname": "Test VM -With Disk",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"server_without_disk":
{
"displayname": "Test VM-No Disk",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
# For NAT rule creation
"publicport": 22,
"protocol": 'TCP',
},
"server": {
"displayname": "TestVM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"mgmt_server": {
"ipaddress": '192.168.100.21',
"username": "root",
"password": "password",
"port": 22,
},
"recurring_snapshot": {
"intervaltype": 'HOURLY',
# Frequency of snapshots
"maxsnaps": 1, # Should be min 2
"schedule": 1,
"timezone": 'US/Arizona',
# Timezone Formats - http://cloud.mindtouch.us/CloudStack_Documentation/Developer's_Guide%3A_CloudStack
},
"templates": {
"displaytext": 'Template',
"name": 'Template',
"ostype": "CentOS 5.3 (64-bit)",
"templatefilter": 'self',
},
"volume": {
"diskname": "APP Data Volume",
"size": 1, # in GBs
"diskdevice": ['/dev/xvdb', '/dev/sdb', '/dev/hdb', '/dev/vdb' ], # Data Disk
},
"paths": {
"mount_dir": "/mnt/tmp",
"sub_dir": "test",
"sub_lvl_dir1": "test1",
"sub_lvl_dir2": "test2",
"random_data": "random.data",
},
"ostype": "CentOS 5.3 (64-bit)",
# Cent OS 5.3 (64 bit)
"sleep": 60,
"timeout": 10,
}
class TestSnapshotRootDisk(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestSnapshotRootDisk, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestSnapshotRootDisk, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
@ -154,7 +56,7 @@ class TestSnapshotRootDisk(cloudstackTestCase):
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.virtual_machine = cls.virtual_machine_with_disk = \
VirtualMachine.create(

View File

@ -31,16 +31,6 @@ import telnetlib
import time
_multiprocess_shared_ = True
class Services:
"""Test SSVM Services
"""
def __init__(self):
self.services = {
"sleep": 60,
"timeout": 10,
}
class TestSSVMs(cloudstackTestCase):
def setUp(self):

View File

@ -32,72 +32,6 @@ import datetime
_multiprocess_shared_ = True
class Services:
"""Test Templates Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100, # in MHz
"memory": 128, # In MBs
},
"disk_offering": {
"displaytext": "Small",
"name": "Small",
"disksize": 1
},
"virtual_machine": {
"displayname": "testVM",
"hypervisor": 'XenServer',
"protocol": 'TCP',
"ssh_port": 22,
"username": "root",
"password": "password",
"privateport": 22,
"publicport": 22,
},
"volume": {
"diskname": "Test Volume",
},
"template_1": {
"displaytext": "Cent OS Template",
"name": "Cent OS Template",
"ostype": "CentOS 5.3 (64-bit)",
},
"template_2": {
"displaytext": "Public Template",
"name": "Public template",
"ostype": "CentOS 5.3 (64-bit)",
"isfeatured": True,
"ispublic": True,
"isextractable": True,
"mode": "HTTP_DOWNLOAD",
},
"templatefilter": 'self',
"isfeatured": True,
"ispublic": True,
"isextractable": False,
"bootable": True,
"passwordenabled": True,
"ostype": "CentOS 5.3 (64-bit)",
"sleep": 30,
"timeout": 10,
}
class TestCreateTemplate(cloudstackTestCase):
def setUp(self):
@ -118,8 +52,10 @@ class TestCreateTemplate(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.services = Services().services
cls.api_client = super(TestCreateTemplate, cls).getClsTestClient().getApiClient()
cloudstackTestClient = super(TestCreateTemplate, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
@ -134,7 +70,7 @@ class TestCreateTemplate(cloudstackTestCase):
cls.zone.id,
cls.services["ostype"]
)
cls.services["template_1"]["ostypeid"] = template.ostypeid
cls.services["template"]["ostypeid"] = template.ostypeid
cls.services["template_2"]["ostypeid"] = template.ostypeid
cls.services["ostypeid"] = template.ostypeid
@ -152,7 +88,7 @@ class TestCreateTemplate(cloudstackTestCase):
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
#create virtual machine
cls.virtual_machine = VirtualMachine.create(
@ -233,7 +169,7 @@ class TestCreateTemplate(cloudstackTestCase):
#Create template from Virtual machine and Volume ID
template = Template.create(
self.apiclient,
self.services["template_1"],
self.services["template"],
self.volume.id,
account=self.account.name,
domainid=self.account.domainid
@ -264,18 +200,18 @@ class TestCreateTemplate(cloudstackTestCase):
self.assertEqual(
template_response.displaytext,
self.services["template_1"]["displaytext"],
self.services["template"]["displaytext"],
"Check display text of newly created template"
)
name = template_response.name
self.assertEqual(
name.count(self.services["template_1"]["name"]),
name.count(self.services["template"]["name"]),
1,
"Check name of newly created template"
)
self.assertEqual(
template_response.ostypeid,
self.services["template_1"]["ostypeid"],
self.services["template"]["ostypeid"],
"Check osTypeID of newly created template"
)
return
@ -286,8 +222,9 @@ class TestTemplates(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.services = Services().services
cls.api_client = super(TestTemplates, cls).getClsTestClient().getApiClient()
cloudstackTestClient = super(TestTemplates, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
@ -314,7 +251,7 @@ class TestTemplates(cloudstackTestCase):
cls.services["template_2"]["zoneid"] = cls.zone.id
cls.services["sourcezoneid"] = cls.zone.id
cls.services["template_1"]["ostypeid"] = template.ostypeid
cls.services["template"]["ostypeid"] = template.ostypeid
cls.services["template_2"]["ostypeid"] = template.ostypeid
cls.services["ostypeid"] = template.ostypeid
@ -335,7 +272,7 @@ class TestTemplates(cloudstackTestCase):
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
#create virtual machine
cls.virtual_machine = VirtualMachine.create(
@ -390,7 +327,7 @@ class TestTemplates(cloudstackTestCase):
#Create templates for Edit, Delete & update permissions testcases
cls.template_1 = Template.create(
cls.api_client,
cls.services["template_1"],
cls.services["template"],
cls.volume.id,
account=cls.account.name,
domainid=cls.account.domainid

View File

@ -28,111 +28,15 @@ from nose.plugins.attrib import attr
import time
_multiprocess_shared_ = True
class Services:
"""Test VM Life Cycle Services
"""
def __init__(self):
self.services = {
"disk_offering":{
"displaytext": "Small",
"name": "Small",
"disksize": 1
},
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended in create account to
# ensure unique username generated each time
"password": "password",
},
"small":
# Create a small virtual machine instance with disk offering
{
"displayname": "testserver",
"username": "root", # VM creds for SSH
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"medium": # Create a medium virtual machine instance
{
"displayname": "testserver",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"service_offerings":
{
"tiny":
{
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100, # in MHz
"memory": 128, # In MBs
},
"small":
{
# Small service offering ID to for change VM
# service offering from medium to small
"name": "Small Instance",
"displaytext": "Small Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
"medium":
{
# Medium service offering ID to for
# change VM service offering from small to medium
"name": "Medium Instance",
"displaytext": "Medium Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
}
},
"iso": # ISO settings for Attach/Detach ISO tests
{
"displaytext": "Test ISO",
"name": "testISO",
"url": "http://people.apache.org/~tsp/dummy.iso",
# Source URL where ISO is located
"ostype": 'CentOS 5.3 (64-bit)',
"mode": 'HTTP_DOWNLOAD', # Downloading existing ISO
},
"template": {
"displaytext": "Cent OS Template",
"name": "Cent OS Template",
"passwordenabled": True,
},
"diskdevice": ['/dev/vdc', '/dev/vdb', '/dev/hdb', '/dev/hdc', '/dev/xvdd', '/dev/cdrom', '/dev/sr0', '/dev/cdrom1' ],
# Disk device where ISO is attached to instance
"mount_dir": "/mnt/tmp",
"sleep": 60,
"timeout": 10,
#Migrate VM to hostid
"ostype": 'CentOS 5.3 (64-bit)',
# CentOS 5.3 (64-bit)
}
class TestDeployVM(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.services = Services().services
cls.apiclient = super(TestDeployVM, cls).getClsTestClient().getApiClient()
cloudstackTestClient = super(TestDeployVM, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
domain = get_domain(cls.apiclient, cls.services)
cls.zone = get_zone(cls.apiclient, cls.services)
@ -156,7 +60,7 @@ class TestDeployVM(cloudstackTestCase):
cls.services["medium"]["zoneid"] = cls.zone.id
cls.services["medium"]["template"] = template.id
cls.services["iso"]["zoneid"] = cls.zone.id
cls.services["iso1"]["zoneid"] = cls.zone.id
cls.account = Account.create(
cls.apiclient,
@ -287,8 +191,9 @@ class TestVMLifeCycle(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestVMLifeCycle, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestVMLifeCycle, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
domain = get_domain(cls.api_client, cls.services)
@ -313,7 +218,7 @@ class TestVMLifeCycle(cloudstackTestCase):
cls.services["medium"]["zoneid"] = cls.zone.id
cls.services["medium"]["template"] = template.id
cls.services["iso"]["zoneid"] = cls.zone.id
cls.services["iso1"]["zoneid"] = cls.zone.id
# Create VMs, NAT Rules etc
cls.account = Account.create(
@ -710,7 +615,7 @@ class TestVMLifeCycle(cloudstackTestCase):
iso = Iso.create(
self.apiclient,
self.services["iso"],
self.services["iso1"],
account=self.account.name,
domainid=self.account.domainid
)
@ -737,12 +642,13 @@ class TestVMLifeCycle(cloudstackTestCase):
except Exception as e:
self.fail("SSH failed for virtual machine: %s - %s" %
(self.virtual_machine.ipaddress, e))
cmds = "mkdir -p %s" % self.services["mount_dir"]
mount_dir = "/mnt/tmp"
cmds = "mkdir -p %s" % mount_dir
self.assert_(ssh_client.execute(cmds) == [], "mkdir failed within guest")
for diskdevice in self.services["diskdevice"]:
res = ssh_client.execute("mount -rt iso9660 {} {}".format(diskdevice, self.services["mount_dir"]))
res = ssh_client.execute("mount -rt iso9660 {} {}".format(diskdevice, mount_dir))
if res == []:
self.services["mount"] = diskdevice
break
@ -767,7 +673,7 @@ class TestVMLifeCycle(cloudstackTestCase):
try:
#Unmount ISO
command = "umount %s" % self.services["mount_dir"]
command = "umount %s" % "mount_dir
ssh_client.execute(command)
except Exception as e:
self.fail("SSH failed for virtual machine: %s - %s" %

View File

@ -24,60 +24,6 @@ from marvin.integration.lib.utils import *
from marvin.integration.lib.base import *
from marvin.integration.lib.common import *
class Services:
"""Test Snapshots Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 200, # in MHz
"memory": 256, # In MBs
},
"server": {
"displayname": "TestVM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"mgmt_server": {
"ipaddress": '1.2.2.152',
"username": "root",
"password": "password",
"port": 22,
},
"templates": {
"displaytext": 'Template',
"name": 'Template',
"ostype": "CentOS 5.3 (64-bit)",
"templatefilter": 'self',
},
"test_dir": "/tmp",
"random_data": "random.data",
"snapshot_name": "TestSnapshot",
"snapshot_displaytext": "Test",
"ostype": "CentOS 5.3 (64-bit)",
"sleep": 60,
"timeout": 10,
"mode": 'advanced', # Networking mode: Advanced, Basic
}
class TestVmSnapshot(cloudstackTestCase):
@classmethod
@ -109,7 +55,7 @@ class TestVmSnapshot(cloudstackTestCase):
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.virtual_machine = VirtualMachine.create(
cls.api_client,
@ -121,6 +67,8 @@ class TestVmSnapshot(cloudstackTestCase):
mode=cls.services["mode"]
)
cls.random_data_0 = random_gen(size=100)
cls.test_dir = "/tmp"
cls.random_data = "random.data"
cls._cleanup = [
cls.service_offering,
cls.account,
@ -160,8 +108,8 @@ class TestVmSnapshot(cloudstackTestCase):
ssh_client = self.virtual_machine.get_ssh_client()
cmds = [
"echo %s > %s/%s" % (self.random_data_0, self.services["test_dir"], self.services["random_data"]),
"cat %s/%s" % (self.services["test_dir"], self.services["random_data"])
"echo %s > %s/%s" % (self.random_data_0, self.test_dir, self.random_data),
"cat %s/%s" % (self.test_dir, self.random_data)
]
for c in cmds:
@ -184,8 +132,8 @@ class TestVmSnapshot(cloudstackTestCase):
self.apiclient,
self.virtual_machine.id,
"false",
self.services["snapshot_name"],
self.services["snapshot_displaytext"]
"TestSnapshot",
"Dsiplay Text"
)
self.assertEqual(
vm_snapshot.state,
@ -203,8 +151,8 @@ class TestVmSnapshot(cloudstackTestCase):
ssh_client = self.virtual_machine.get_ssh_client()
cmds = [
"rm -rf %s/%s" % (self.services["test_dir"], self.services["random_data"]),
"ls %s/%s" % (self.services["test_dir"], self.services["random_data"])
"rm -rf %s/%s" % (self.test_dir, self.random_data),
"ls %s/%s" % (self.test_dir, self.random_data)
]
for c in cmds:
@ -263,7 +211,7 @@ class TestVmSnapshot(cloudstackTestCase):
ssh_client = self.virtual_machine.get_ssh_client(reconnect=True)
cmds = [
"cat %s/%s" % (self.services["test_dir"], self.services["random_data"])
"cat %s/%s" % (self.test_dir, self.random_data)
]
for c in cmds:

View File

@ -34,65 +34,13 @@ import tempfile
_multiprocess_shared_ = True
class Services:
"""Test Volume Services
"""
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
# Random characters are appended for unique
# username
"password": "password",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100, # in MHz
"memory": 260 # In MBs
},
"disk_offering": {
"displaytext": "Small",
"name": "Small",
"disksize": 1
},
'resized_disk_offering': {
"displaytext": "Resized",
"name": "Resized",
"disksize": 3
},
"volume_offerings": {
0: {
"diskname": "TestDiskServ",
},
},
"customdisksize": 1, # GBs
"username": "root", # Creds for SSH to VM
"password": "password",
"ssh_port": 22,
"diskname": "TestDiskServ",
"hypervisor": 'KVM',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
"ostype": 'CentOS 5.5 (64-bit)',
"sleep": 10,
"timeout": 600,
}
class TestCreateVolume(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestCreateVolume, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestCreateVolume, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
@ -127,7 +75,7 @@ class TestCreateVolume(cloudstackTestCase):
cls.services["account"] = cls.account.name
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.virtual_machine = VirtualMachine.create(
cls.api_client,
@ -280,8 +228,10 @@ class TestVolumes(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.api_client = super(TestVolumes, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestVolumes, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
# Get Zone, Domain and templates
cls.domain = get_domain(cls.api_client, cls.services)
cls.zone = get_zone(cls.api_client, cls.services)
@ -322,7 +272,7 @@ class TestVolumes(cloudstackTestCase):
cls.services["account"] = cls.account.name
cls.service_offering = ServiceOffering.create(
cls.api_client,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.virtual_machine = VirtualMachine.create(
cls.api_client,

View File

@ -26,96 +26,19 @@ from nose.plugins.attrib import attr
import time
class Services:
def __init__(self):
self.services = {
"account": {
"email": "test@test.com",
"firstname": "Test",
"lastname": "User",
"username": "test",
"password": "password",
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"ostype": 'CentOS 5.3 (64-bit)',
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
"network_offering": {
"name": "Network offering for internal vpc",
"displaytext": "Network offering for internal vpc",
"guestiptype": "Isolated",
"traffictype": "Guest",
"supportedservices": "Vpn,Dhcp,Dns,Lb,UserData,SourceNat,StaticNat,PortForwarding,NetworkACL",
"serviceProviderList": {
"Dhcp": "VpcVirtualRouter",
"Dns": "VpcVirtualRouter",
"Vpn": "VpcVirtualRouter",
"UserData": "VpcVirtualRouter",
"Lb": "InternalLbVM",
"SourceNat": "VpcVirtualRouter",
"StaticNat": "VpcVirtualRouter",
"PortForwarding": "VpcVirtualRouter",
"NetworkACL": "VpcVirtualRouter",
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "peraccount"},
"Lb": {"lbSchemes": "internal", "SupportedLbIsolation": "dedicated"}
}
},
"vpn_user": {
"username": "test",
"password": "password",
},
"vpc": {
"name": "vpc_vpn",
"displaytext": "vpc-vpn",
"cidr": "10.1.1.0/24"
},
"ntwk": {
"name": "tier1",
"displaytext": "vpc-tier1",
"gateway" : "10.1.1.1",
"netmask" : "255.255.255.192"
},
"vpc2": {
"name": "vpc2_vpn",
"displaytext": "vpc2-vpn",
"cidr": "10.2.1.0/24"
},
"ntwk2": {
"name": "tier2",
"displaytext": "vpc-tier2",
"gateway" : "10.2.1.1",
"netmask" : "255.255.255.192"
}
}
class TestVpcRemoteAccessVpn(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.apiclient = super(TestVpcRemoteAccessVpn, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestVpcRemoteAccessVpn, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
cls.zone = get_zone(cls.apiclient, cls.services)
cls.domain = get_domain(cls.apiclient)
cls.service_offering = ServiceOffering.create(
cls.apiclient,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.account = Account.create(cls.apiclient, services=cls.services["account"])
cls.template = get_template(
@ -211,13 +134,15 @@ class TestVpcSite2SiteVpn(cloudstackTestCase):
@classmethod
def setUpClass(cls):
cls.apiclient = super(TestVpcSite2SiteVpn, cls).getClsTestClient().getApiClient()
cls.services = Services().services
cloudstackTestClient = super(TestVpcSite2SiteVpn, cls).getClsTestClient()
cls.api_client = cloudstackTestClient.getApiClient()
cls.services = cloudstackTestClient.getConfigParser().parsedDict
cls.zone = get_zone(cls.apiclient, cls.services)
cls.domain = get_domain(cls.apiclient)
cls.service_offering = ServiceOffering.create(
cls.apiclient,
cls.services["service_offering"]
cls.services["service_offerings"]
)
cls.account = Account.create(cls.apiclient, services=cls.services["account"])
cls.template = get_template(

View File

@ -24,7 +24,7 @@
}
,
"project":
{
{
"name": "Project",
"displaytext": "Test project"
},
@ -35,6 +35,15 @@
"username": "test-account",
"password": "password"
},
"user": {
"email": "user@test.com",
"firstname": "User",
"lastname": "User",
"username": "User",
# Random characters are appended for unique
# username
"password": "fr3sca",
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
@ -74,6 +83,18 @@
"publicport": 22,
"protocol": "TCP"
},
"template": {
"displaytext": "Public Template",
"name": "Public template",
"ostype": 'CentOS 5.3 (64-bit)',
"url": "",
"hypervisor": '',
"format": '',
"isfeatured": True,
"ispublic": True,
"isextractable": True,
"templatefilter": "self"
},
"shared_network": {
"name": "Test Shared Network",
"displaytext": "Test Shared Network",
@ -137,6 +158,11 @@
}
},
"security_group" : { "name": "custom_Sec_Grp" },
"natrule": {
"publicport": 22,
"privateport": 22,
"protocol": 'TCP',
},
"ingress_rule": {
"protocol": "TCP",
"startport": "22",

View File

@ -18,143 +18,437 @@
# Use the common configs added such as account, network_offerings, domain, project,
# or add your own data if required separately for any test case
{
"region": {
"regionid": "2",
"regionname": "Region2",
"regionendpoint": "http://region2:8080/client"
},
"zone": "NA",
"domain":
{
"name": "domain"
}
,
"project":
{
"name": "Project",
"displaytext": "Test project"
},
"domain": { "name": "domain" },
"project": {
"name": "Project",
"displaytext": "Test project"
},
"account": {
"email": "test-account@test.com",
"firstname": "test",
"lastname": "test",
"username": "test-account",
"password": "password"
},
"service_offering": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 128
},
"email": "test-account@test.com",
"firstname": "test",
"lastname": "test",
"username": "test-account",
"password": "password"
},
"small": {
# Create a small virtual machine instance with disk offering
"displayname": "testserver",
"username": "root", # VM creds for SSH
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"medium": {
# Create a medium virtual machine instance
"displayname": "testserver",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
"publicport": 22,
"protocol": 'TCP',
},
"service_offerings": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 128,
"tiny": {
"name": "Tiny Instance",
"displaytext": "Tiny Instance",
"cpunumber": 1,
"cpuspeed": 100, # in MHz
"memory": 128, # In MBs
},
"small": {
"name": "Small Instance",
"displaytext": "Small Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256
},
"medium": {
"name": "Medium Instance",
"displaytext": "Medium Instance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 256,
},
"big": {
"name": "BigInstance",
"displaytext": "BigInstance",
"cpunumber": 1,
"cpuspeed": 100,
"memory": 512,
}
},
"disk_offering": {
"name": "Disk offering",
"displaytext": "Disk offering",
"disksize": 1 # in GB
},
'resized_disk_offering': {
"displaytext": "Resized",
"name": "Resized",
"disksize": 3
},
"network": {
"name": "Test Network",
"displaytext": "Test Network",
acltype": "Account",
},
"network2": {
"name": "Test Network Shared",
"displaytext": "Test Network Shared",
"vlan" :1201,
"gateway" :"172.16.15.1",
"netmask" :"255.255.255.0",
"startip" :"172.16.15.21",
"endip" :"172.16.15.41",
"acltype": "Account",
},
"network_offering": {
"name": 'Test Network offering',
"displaytext": 'Test Network offering',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding',
"traffictype": 'GUEST',
"availability": 'Optional',
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"SourceNat": 'VirtualRouter',
"PortForwarding": 'VirtualRouter',
},
},
"isolated_network_offering": {
"name": "Network offering-DA services",
"displaytext": "Network offering-DA services",
"guestiptype": "Isolated",
"supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
"traffictype": "GUEST",
"availability": "Optional'",
"serviceProviderList": {
"Dhcp": "VirtualRouter",
"Dns": "VirtualRouter",
"SourceNat": "VirtualRouter",
"PortForwarding": "VirtualRouter",
"Vpn": "VirtualRouter",
"Firewall": "VirtualRouter",
"Lb": "VirtualRouter",
"UserData": "VirtualRouter",
"StaticNat": "VirtualRouter"
}
},
"name": "Network offering-DA services",
"displaytext": "Network offering-DA services",
"guestiptype": "Isolated",
"supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat",
"traffictype": "GUEST",
"availability": "Optional'",
"serviceProviderList": {
"Dhcp": "VirtualRouter",
"Dns": "VirtualRouter",
"SourceNat": "VirtualRouter",
"PortForwarding": "VirtualRouter",
"Vpn": "VirtualRouter",
"Firewall": "VirtualRouter",
"Lb": "VirtualRouter",
"UserData": "VirtualRouter",
"StaticNat": "VirtualRouter"
}
},
"isolated_network": {
"name": "Isolated Network",
"displaytext": "Isolated Network"
},
"name": "Isolated Network",
"displaytext": "Isolated Network"
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"privateport": 22,
"publicport": 22,
"protocol": "TCP"
},
"displayname": "Test VM",
"username": "root",
"password": "password",
"ssh_port": 22,
"privateport": 22,
"publicport": 22,
"protocol": "TCP",
"affinity": {
"name": "webvms",
"type": "host anti-affinity",
},
},
"server_without_disk": {
"displayname": "Test VM-No Disk",
"username": "root",
"password": "password",
"ssh_port": 22,
"hypervisor": 'XenServer',
"privateport": 22,
# For NAT rule creation
"publicport": 22,
"protocol": 'TCP',
},
"shared_network": {
"name": "MySharedNetwork - Test",
"displaytext": "MySharedNetwork",
"vlan" : "",
"gateway" :"",
"netmask" :"",
"startip" :"",
"endip" :"",
"acltype" : "Domain",
"scope":"all"
},
"name": "MySharedNetwork - Test",
"displaytext": "MySharedNetwork",
"vlan" : "",
"gateway" :"",
"netmask" :"",
"startip" :"",
"endip" :"",
"acltype" : "Domain",
"scope":"all"
},
"shared_network_offering_sg": {
"name": "MySharedOffering-sg",
"displaytext": "MySharedOffering-sg",
"guestiptype": "Shared",
"supportedservices": "Dhcp,Dns,UserData,SecurityGroup",
"specifyVlan" : "False",
"specifyIpRanges" : "False",
"traffictype": "GUEST",
"serviceProviderList" : {
"Dhcp": "VirtualRouter",
"Dns": "VirtualRouter",
"UserData": "VirtualRouter",
"SecurityGroup": "SecurityGroupProvider"
}
},
"name": "MySharedOffering-sg",
"displaytext": "MySharedOffering-sg",
"guestiptype": "Shared",
"supportedservices": "Dhcp,Dns,UserData,SecurityGroup",
"specifyVlan" : "False",
"specifyIpRanges" : "False",
"traffictype": "GUEST",
"serviceProviderList" : {
"Dhcp": "VirtualRouter",
"Dns": "VirtualRouter",
"UserData": "VirtualRouter",
"SecurityGroup": "SecurityGroupProvider"
}
},
"shared_network_sg": {
"name": "Shared-Network-SG-Test",
"displaytext": "Shared-Network_SG-Test",
"networkofferingid":"1",
"vlan" : "",
"gateway" :"",
"netmask" :"255.255.255.0",
"startip" :"",
"endip" :"",
"acltype" : "Domain",
"scope":"all"
},
"name": "Shared-Network-SG-Test",
"displaytext": "Shared-Network_SG-Test",
"networkofferingid":"1",
"vlan" : "",
"gateway" :"",
"netmask" :"255.255.255.0",
"startip" :"",
"endip" :"",
"acltype" : "Domain",
"scope":"all"
},
"vpc_offering": {
"name": "VPC off",
"displaytext": "VPC off",
"supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat,NetworkACL"
},
"name": "VPC off",
"displaytext": "VPC off",
"supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat,NetworkACL"
},
"vpc": {
"name": "TestVPC",
"displaytext": "TestVPC",
"cidr": "10.0.0.1/24"
},
"shared_network_offering": {
"name": "MySharedOffering",
"displaytext": "MySharedOffering",
"guestiptype": "Shared",
"supportedservices": "Dhcp,Dns,UserData",
"specifyVlan" : "False",
"specifyIpRanges" : "False",
"traffictype": "GUEST",
"serviceProviderList" : {
"Dhcp": "VirtualRouter",
"Dns": "VirtualRouter",
"UserData": "VirtualRouter"
}
},
"name": "TestVPC",
"displaytext": "TestVPC",
"cidr": "10.0.0.1/24"
},
"clusters": {
0: {
"clustername": "Xen Cluster",
"clustertype": "CloudManaged",
# CloudManaged or ExternalManaged"
"hypervisor": "XenServer",
# Hypervisor type
},
1: {
"clustername": "KVM Cluster",
"clustertype": "CloudManaged",
# CloudManaged or ExternalManaged"
"hypervisor": "KVM",
# Hypervisor type
},
2: {
"hypervisor": 'VMware',
# Hypervisor type
"clustertype": 'ExternalManaged',
# CloudManaged or ExternalManaged"
"username": 'administrator',
"password": 'fr3sca',
"url": 'http://192.168.100.17/CloudStack-Clogeny-Pune/Pune-1',
# Format:http://vCenter Host/Datacenter/Cluster
"clustername": 'VMWare Cluster',
},
},
"hosts": {
"xenserver": {
# Must be name of corresponding Hypervisor type
# in cluster in small letters
"hypervisor": 'XenServer',
# Hypervisor type
"clustertype": 'CloudManaged',
# CloudManaged or ExternalManaged"
"url": 'http://192.168.100.211',
"username": "root",
"password": "fr3sca",
},
"kvm": {
"hypervisor": 'KVM',
# Hypervisor type
"clustertype": 'CloudManaged',
# CloudManaged or ExternalManaged"
"url": 'http://192.168.100.212',
"username": "root",
"password": "fr3sca",
},
"vmware": {
"hypervisor": 'VMware',
# Hypervisor type
"clustertype": 'ExternalManaged',
# CloudManaged or ExternalManaged"
"url": 'http://192.168.100.203',
"username": "administrator",
"password": "fr3sca",
},
},
"network_offering_shared": {
"name": 'Test Network offering shared',
"displaytext": 'Test Network offering Shared',
"guestiptype": 'Shared',
"supportedservices": 'Dhcp,Dns,UserData',
"traffictype": 'GUEST',
"specifyVlan" : "True",
"specifyIpRanges" : "True",
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"UserData": 'VirtualRouter',
},
},
"network_offering_internal_lb": {
"name": "Network offering for internal lb service",
"displaytext": "Network offering for internal lb service",
"guestiptype": "Isolated",
"traffictype": "Guest",
"supportedservices": "Vpn,Dhcp,Dns,Lb,UserData,SourceNat,StaticNat,PortForwarding,NetworkACL",
"serviceProviderList": {
"Dhcp": "VpcVirtualRouter",
"Dns": "VpcVirtualRouter",
"Vpn": "VpcVirtualRouter",
"UserData": "VpcVirtualRouter",
"Lb": "InternalLbVM",
"SourceNat": "VpcVirtualRouter",
"StaticNat": "VpcVirtualRouter",
"PortForwarding": "VpcVirtualRouter",
"NetworkACL": "VpcVirtualRouter",
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "peraccount"},
"Lb": {"lbSchemes": "internal", "SupportedLbIsolation": "dedicated"}
}
},
"natrule": {
"privateport": 22,
"publicport": 2222,
"protocol": "TCP"
},
"lbrule": {
"name": "SSH",
"alg": "roundrobin",
# Algorithm used for load balancing
"privateport": 22,
"publicport": 2222,
"protocol": 'TCP'
},
# ISO related test data
"iso1": {
"displaytext": "Test ISO 1",
"name": "ISO 1",
"url": "http://people.apache.org/~tsp/dummy.iso",
# Source URL where ISO is located
"isextractable": True,
"isfeatured": True,
"ispublic": True,
"ostype": "CentOS 5.3 (64-bit)",
},
"iso2": {
"displaytext": "Test ISO 2",
"name": "ISO 2",
"url": "http://people.apache.org/~tsp/dummy.iso",
# Source URL where ISO is located
"isextractable": True,
"isfeatured": True,
"ispublic": True,
"ostype": "CentOS 5.3 (64-bit)",
"mode": 'HTTP_DOWNLOAD',
# Used in Extract template, value must be HTTP_DOWNLOAD
},
"isfeatured": True,
"ispublic": True,
"isextractable": True,
"bootable": True, # For edit template
"passwordenabled": True,
"template": {
"displaytext": "xs",
"name": "xs",
"passwordenabled": False,
},
"template_2": {
"displaytext": "Public Template",
"name": "Public template",
"ostype": "CentOS 5.3 (64-bit)",
"isfeatured": True,
"ispublic": True,
"isextractable": True,
"mode": "HTTP_DOWNLOAD",
},
"templatefilter": 'self',
"security_group" : { "name": "custom_Sec_Grp" },
"ingress_rule": {
"protocol": "TCP",
"startport": "22",
"endport": "22",
"cidrlist": "0.0.0.0/0"
},
"protocol": "TCP",
startport": "22",
"endport": "22",
"cidrlist": "0.0.0.0/0"
},
"ostype": "CentOS 5.3 (64-bit)",
"sleep": 90,
"timeout": 10,
"advanced_sg": {
"zone": {
"name": "",
"dns1": "8.8.8.8",
"internaldns1": "192.168.100.1",
"networktype": "Advanced",
"securitygroupenabled": "true"
},
"securitygroupenabled": "true"
}
"zone": {
"name": "",
"dns1": "8.8.8.8",
"internaldns1": "192.168.100.1",
"networktype": "Advanced",
"securitygroupenabled": "true"
},
"securitygroupenabled": "true"
},
"vlan": {
"part": ["4090-4091", "4092-4095"],
"full": "4090-4095",
},
nfs": {
"url": "nfs://10.147.28.7/export/home/talluri/testprimary",
# Format: File_System_Type/Location/Path
"name": "Primary XEN"
},
"iscsi": {
"url": "iscsi://192.168.100.21/iqn.2012-01.localdomain.clo-cstack-cos6:iser/1",
# Format : iscsi://IP Address/IQN number/LUN#
"name": "Primary iSCSI"
},
"volume": {"diskname": "Test Volume"},
"volume_offerings": {
0: {"diskname": "TestDiskServ"},
},
"diskdevice": ['/dev/vdc', '/dev/vdb', '/dev/hdb', '/dev/hdc', '/dev/xvdd', '/dev/cdrom', '/dev/sr0', '/dev/cdrom1' ],
#test_vpc_vpn.py
"vpn_user": {
"username": "test",
"password": "password",
},
"vpc": {
"name": "vpc_vpn",
"displaytext": "vpc-vpn",
"cidr": "10.1.1.0/24"
},
"ntwk": {
"name": "tier1",
"displaytext": "vpc-tier1",
"gateway" : "10.1.1.1",
"netmask" : "255.255.255.192"
},
"vpc2": {
"name": "vpc2_vpn",
"displaytext": "vpc2-vpn",
"cidr": "10.2.1.0/24"
},
"ntwk2": {
"name": "tier2",
"displaytext": "vpc-tier2",
"gateway" : "10.2.1.1",
"netmask" : "255.255.255.192"
}
}