CLOUDSTACK-6282-Added Automated testes for Networks and VPC API's

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
vinayvarmav 2014-05-23 16:21:04 +05:30 committed by Abhinandan Prateek
parent d9066f8d29
commit 7dc0fca2e9
3 changed files with 2711 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,14 @@ test_data = {
"name": "Project",
"displaytext": "Test project"
},
"private_gateway": {
"ipaddress": "172.16.1.2",
"gateway": "172.16.1.1",
"netmask": "255.255.255.0",
"vlan":"10",
"name":"test_private_gateway"
},
"account": {
"email": "test-account@test.com",
"firstname": "test",
@ -214,6 +222,34 @@ test_data = {
"StaticNat": "VirtualRouter"
}
},
"network_offering_vlan": {
"name": 'Test Network offering',
"displaytext": 'Test Network offering',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding',
"traffictype": 'GUEST',
"specifyvlan": 'False',
"availability": 'Optional',
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"SourceNat": 'VirtualRouter',
"PortForwarding": 'VirtualRouter',
},
},
"network_offering_without_sourcenat": {
"name": 'Test Network offering',
"displaytext": 'Test Network offering',
"guestiptype": 'Isolated',
"supportedservices": 'Dhcp,Dns,UserData',
"traffictype": 'GUEST',
"availability": 'Optional',
"serviceProviderList" : {
"Dhcp": 'VirtualRouter',
"Dns": 'VirtualRouter',
"UserData": 'VirtualRouter',
},
},
"isolated_network": {
"name": "Isolated Network",
"displaytext": "Isolated Network"
@ -230,6 +266,10 @@ test_data = {
"lbdevicecapacity": 2,
"port": 22
},
"network_without_acl": {
"name": "TestNetwork",
"displaytext": "TestNetwork",
},
"virtual_machine": {
"displayname": "Test VM",
"username": "root",
@ -345,6 +385,12 @@ test_data = {
"displaytext": "TestVPC",
"cidr": "10.0.0.1/24"
},
"vpc_network_domain": {
"name": "TestVPC",
"displaytext": "TestVPC",
"cidr": '10.0.0.1/24',
"network_domain": "TestVPC"
},
"clusters": {
0: {
"clustername": "Xen Cluster",
@ -592,6 +638,13 @@ test_data = {
},
},
"network_acl_rule": {
"protocol":"TCP",
"traffictype":"ingress",
"cidrlist":"0.0.0.0/0",
"startport":"1",
"endport":"1"
},
"network_offering_internal_lb": {
"name": "Network offering for internal lb service",
"displaytext": "Network offering for internal lb service",

View File

@ -2702,6 +2702,52 @@ class Vpn:
if openfirewall:
cmd.openfirewall = openfirewall
return Vpn(apiclient.createRemoteAccessVpn(cmd).__dict__)
@classmethod
def createVpnGateway(cls, apiclient, vpcid):
"""Create VPN Gateway """
cmd = createVpnGateway.createVpnGatewayCmd()
cmd.vpcid = vpcid
return (apiclient.createVpnGateway(cmd).__dict__)
@classmethod
def createVpnConnection(cls, apiclient, s2scustomergatewayid,s2svpngatewayid):
"""Create VPN Connection """
cmd = createVpnConnection.createVpnConnectionCmd()
cmd.s2scustomergatewayid = s2scustomergatewayid
cmd.s2svpngatewayid = s2svpngatewayid
return (apiclient.createVpnGateway(cmd).__dict__)
@classmethod
def resetVpnConnection(cls, apiclient,id):
"""Reset VPN Connection """
cmd = resetVpnConnection.resetVpnConnectionCmd()
cmd.id = id
return (apiclient.resetVpnConnection(cmd).__dict__)
@classmethod
def deleteVpnConnection(cls, apiclient,id):
"""Delete VPN Connection """
cmd = deleteVpnConnection.deleteVpnConnectionCmd()
cmd.id = id
return (apiclient.deleteVpnConnection(cmd).__dict__)
@classmethod
def listVpnGateway(cls, apiclient, **kwargs):
"""List all VPN Gateways matching criteria"""
cmd = listVpnGateways.listVpnGatewaysCmd()
[setattr(cmd, k, v) for k, v in kwargs.items()]
return(apiclient.listVpnGateways(cmd))
@classmethod
def listVpnConnection(cls, apiclient, **kwargs):
"""List all VPN Connections matching criteria"""
cmd = listVpnConnections.listVpnConnectionsCmd()
[setattr(cmd, k, v) for k, v in kwargs.items()]
return(apiclient.listVpnConnections(cmd))
def delete(self, apiclient):
"""Delete remote VPN access"""
@ -3465,7 +3511,14 @@ class Configurations:
if 'account' in kwargs.keys() and 'domainid' in kwargs.keys():
cmd.listall=True
return(apiclient.listConfigurations(cmd))
@classmethod
def listCapabilities(cls, apiclient, **kwargs):
"""Lists capabilities"""
cmd = listCapabilities.listCapabilitiesCmd()
[setattr(cmd, k, v) for k, v in kwargs.items()]
return(apiclient.listCapabilities(cmd))
class NetScaler:
@ -3832,7 +3885,7 @@ class PrivateGateway:
@classmethod
def create(cls, apiclient, gateway, ipaddress, netmask, vlan, vpcid,
physicalnetworkid=None):
physicalnetworkid=None, ,aclid=None):
"""Create private gateway"""
cmd = createPrivateGateway.createPrivateGatewayCmd()
@ -3843,6 +3896,8 @@ class PrivateGateway:
cmd.vpcid = vpcid
if physicalnetworkid:
cmd.physicalnetworkid = physicalnetworkid
if aclid:
cmd.aclid = aclid
return PrivateGateway(apiclient.createPrivateGateway(cmd).__dict__)