CLOUDSTACK-10380: Refactoring of test_configdrive

This commit is contained in:
Frank Maximus 2018-06-26 12:14:32 +02:00
parent 8d7a1d6943
commit 604158220d
16 changed files with 1975 additions and 2379 deletions

File diff suppressed because it is too large Load Diff

View File

@ -258,7 +258,8 @@ class nuageTestCase(cloudstackTestCase):
address=cls.nuage_vsp_device.hostname,
user=cls.nuage_vsp_device.username,
password=cls.nuage_vsp_device.password,
version=cls.nuage_vsp_device.apiversion[1] + "." + cls.nuage_vsp_device.apiversion[3]
version=cls.nuage_vsp_device.apiversion[1] +
"." + cls.nuage_vsp_device.apiversion[3]
)
vsd_api_client.new_session()
cls.vsd = VSDHelpers(vsd_api_client)
@ -358,7 +359,7 @@ class nuageTestCase(cloudstackTestCase):
# create_Vpc - Creates VPC with the given VPC offering
@needscleanup
def create_Vpc(cls, vpc_offering, cidr='10.1.0.0/16', testdata=None,
def create_vpc(cls, vpc_offering, cidr='10.1.0.0/16', testdata=None,
account=None, networkDomain=None):
"""Creates VPC with the given VPC offering
:param vpc_offering: vpc offering
@ -433,7 +434,8 @@ class nuageTestCase(cloudstackTestCase):
@needscleanup
def create_Network(cls, nw_off, gateway="10.1.1.1",
netmask="255.255.255.0", vpc=None, acl_list=None,
testdata=None, account=None, vlan=None, externalid=None):
testdata=None, account=None, vlan=None,
externalid=None):
"""Creates Network with the given Network offering
:param nw_off: Network offering
:type nw_off: NetworkOffering
@ -469,7 +471,7 @@ class nuageTestCase(cloudstackTestCase):
vlan=vlan,
externalid=externalid,
vpcid=vpc.id if vpc else cls.vpc.id
if hasattr(cls, "vpc") else None,
if hasattr(cls, "vpc") and cls.vpc else None,
aclid=acl_list.id if acl_list else None
)
cls.debug("Created network with ID - %s" % network.id)
@ -480,12 +482,14 @@ class nuageTestCase(cloudstackTestCase):
if not hasattr(nw_off, "id"):
nw_off = self.create_NetworkOffering(nw_off)
self.debug("Updating Network with ID - %s" % network.id)
network.update(self.api_client,
networkofferingid=nw_off.id,
changecidr=False,
forced=forced
)
updated_network =\
network.update(self.api_client,
networkofferingid=nw_off.id,
changecidr=False,
forced=forced
)
self.debug("Updated network with ID - %s" % network.id)
return updated_network
# delete_Network - Deletes the given network
def delete_Network(self, network):
@ -607,7 +611,8 @@ class nuageTestCase(cloudstackTestCase):
networkid=network.id
if vpc is None else None,
vpcid=vpc.id if vpc else self.vpc.id
if hasattr(self, "vpc") else None
if hasattr(self, "vpc") and self.vpc
else None
)
self.debug("Associated public IP address - %s with network with ID - "
"%s" % (public_ip.ipaddress.ipaddress, network.id))
@ -700,7 +705,8 @@ class nuageTestCase(cloudstackTestCase):
traffictype=traffic_type
)
def ssh_into_VM(self, vm, public_ip, reconnect=True, negative_test=False, keypair=None):
def ssh_into_VM(self, vm, public_ip, reconnect=True, negative_test=False,
keypair=None):
"""Creates a SSH connection to the VM
:returns: the SSH connection
@ -720,7 +726,8 @@ class nuageTestCase(cloudstackTestCase):
ipaddress=public_ip.ipaddress.ipaddress,
reconnect=reconnect,
retries=3 if negative_test else 30,
keyPairFileLocation=keypair.private_key_file if keypair else None
keyPairFileLocation=keypair.private_key_file
if keypair else None
)
self.debug("Successful to SSH into VM with ID - %s on "
"public IP address - %s" %
@ -748,7 +755,6 @@ class nuageTestCase(cloudstackTestCase):
self.debug("SSH client executed command result is None")
return ret_data
def wget_from_server(self, public_ip, port=80, file_name="index.html",
disable_system_proxies=True):
"""Fetches file with the given file name from a web server
@ -793,9 +799,8 @@ class nuageTestCase(cloudstackTestCase):
physicalnetworkid=self.vsp_physical_network.id
)
self.assertIsInstance(providers, list,
"List Network Service Provider should return a "
"valid list"
)
"List Network Service Provider should return a "
"valid list")
self.assertEqual(provider_name, providers[0].name,
"Name of the Network Service Provider should match "
"with the returned list data"
@ -840,7 +845,7 @@ class nuageTestCase(cloudstackTestCase):
self.debug("Successfully validated the creation and state of VPC "
"offering - %s" % vpc_offering.name)
def validate_Vpc(self, vpc, state=None):
def validate_vpc(self, vpc, state=None):
"""Validates the VPC
Fetches the vpc by id,
@ -956,7 +961,7 @@ class nuageTestCase(cloudstackTestCase):
self.debug("Successfully validated the deployment and state of VM - %s"
% vm.name)
def check_Router_state(self, router, state=None):
def check_Router_state(self, router=None, network=None, state=None):
"""Validates the Router state
:param router: cs object
:type router: Router
@ -964,12 +969,17 @@ class nuageTestCase(cloudstackTestCase):
:raise AssertionError when router isn't found,
or has an incorrect state."""
self.debug("Validating the deployment and state of Router - %s" %
router.name)
routers = Router.list(self.api_client,
id=router.id,
listall=True
)
if router:
self.debug("Validating the deployment and state of Router - %s" %
router.name)
routers = Router.list(self.api_client, id=router.id,
listall=True)
elif network:
routers = Router.list(self.api_client, networkid=network.id,
listall=True)
else:
raise AttributeError("Either router or network "
"has to be specified")
self.assertEqual(isinstance(routers, list), True,
"List router should return a valid list"
)
@ -978,7 +988,9 @@ class nuageTestCase(cloudstackTestCase):
"Virtual router is not in the expected state"
)
self.debug("Successfully validated the deployment and state of Router "
"- %s" % router.name)
"- %s" % routers[0].name)
return routers[0]
def validate_PublicIPAddress(self, public_ip, network, static_nat=False,
vm=None):
@ -1212,7 +1224,6 @@ class nuageTestCase(cloudstackTestCase):
self.debug("Failed to get the subnet id due to %s" % e)
self.fail("Unable to get the subnet id, failing the test case")
def verify_vsd_shared_network(self, domain_id, network,
gateway="10.1.1.1"):
"""Verifies the given CloudStack domain and

View File

@ -48,6 +48,19 @@ class MySSHKeyPair:
apiclient.deleteSSHKeyPair(cmd)
class GherkinMetaClass(type):
def __new__(mcs, name, bases, namespace):
namespace = {
k: gherkin(v)
if k.startswith('given_') or
k.startswith('when_') or
k.startswith('then_')
else v for k, v in namespace.items()
}
return super(GherkinMetaClass, mcs)\
.__new__(mcs, name, bases, namespace)
class gherkin(object):
"""Decorator to mark a method as Gherkin style.
Add extra colored logging
@ -66,7 +79,12 @@ class gherkin(object):
def __get__(self, obj=None, objtype=None):
@functools.wraps(self.method)
def _wrapper(*args, **kwargs):
gherkin_step = self.method.__name__.replace("_", " ").capitalize()
if self.method.__doc__:
gherkin_step = self.method.__doc__.format(*args, **kwargs)
else:
gherkin_step = self.method.__name__\
.replace("_", " ")\
.capitalize()
obj.info("=G= %s%s%s" % (self.BOLDBLUE, gherkin_step, self.NORMAL))
try:
result = self.method(obj, *args, **kwargs)
@ -77,4 +95,4 @@ class gherkin(object):
obj.info("=G= %s%s: [FAILED]%s%s" %
(self.RED, gherkin_step, self.NORMAL, e))
raise
return _wrapper
return _wrapper

File diff suppressed because it is too large Load Diff

View File

@ -20,11 +20,10 @@ Nuage VSP SDN plugin
"""
# Import Local Modules
from nuageTestCase import (nuageTestCase)
from plugins.nuagevsp.nuage_lib import gherkin
from nuage_lib import gherkin
from marvin.cloudstackAPI import updateVirtualMachine, updateZone
from marvin.lib.base import (Account,
Network,
VirtualMachine,
Configurations,
NetworkOffering)
# Import System Modules
@ -57,7 +56,7 @@ class TestNuageExtraDhcp(nuageTestCase):
cls.api_client.updateZone(cmd)
cls.vpc_offering = cls.create_VpcOffering(
cls.test_data["nuagevsp"]["vpc_offering_nuage_dhcp"])
cls.vpc1 = cls.create_Vpc(cls.vpc_offering, cidr="10.0.0.0/16",
cls.vpc1 = cls.create_vpc(cls.vpc_offering, cidr="10.0.0.0/16",
networkDomain="testvpc.com")
cls.vpc_network_offering = cls.create_NetworkOffering(
@ -424,7 +423,8 @@ class TestNuageExtraDhcp(nuageTestCase):
def verify_dhcp_on_vm(
self, dhcpleasefile, dhcp_option_map, ssh_client, cleanlease=True):
if self.isSimulator:
self.debug("Simulator Environment: Skipping VM DHCP option verification")
self.debug("Simulator Environment: "
"Skipping VM DHCP option verification")
return
cmd = 'cat /var/lib/dhclient/'+dhcpleasefile
@ -492,7 +492,7 @@ class TestNuageExtraDhcp(nuageTestCase):
def validate_vpc(self, vpc, vpc_offering):
self.debug("Validating vpc...")
self.validate_Vpc(vpc)
self.validate_vpc(vpc)
self.validate_VpcOffering(vpc_offering)
def verify_dhcp_options_on_vm(
@ -591,18 +591,18 @@ class TestNuageExtraDhcp(nuageTestCase):
self.validate_NetworkOffering(network_offering, state="Enabled")
return network_offering
def create_vpc(self, vpc_offering, cidr="10.0.0.0/16"):
def create_and_validate_vpc(self, vpc_offering, cidr="10.0.0.0/16"):
# Creating a VPC
self.debug("Creating a VPC with Nuage VSP VPC offering...")
vpc = self.create_Vpc(vpc_offering, cidr=cidr,
vpc = self.create_vpc(vpc_offering, cidr=cidr,
networkDomain="testvpc.com")
self.validate_Vpc(vpc, state="Enabled")
self.validate_vpc(vpc, state="Enabled")
return vpc
def create_vpc_with_tier(self, domain_name="testvpc.com"):
vpc_offering = self.create_vpc_offering_with_nuage_dhcp()
vpc = self.create_vpc(vpc_offering)
vpc = self.create_and_validate_vpc(vpc_offering)
vpc_network_offering = self.create_vpc_network_offering()
acl_list = self.create_acl_list_with_item(vpc)

View File

@ -23,7 +23,6 @@ from marvin.cloudstackAPI import updateZone
from marvin.lib.base import Account, Network
# Import System Modules
from nose.plugins.attrib import attr
import time
UPDATED_DOMAIN_NAME = "update.com"
@ -124,7 +123,8 @@ class TestNuageInternalDns(nuageTestCase):
self.debug("command is executed properly " + cmd)
completeoutput = str(outputlist).strip('[]')
self.debug("complete output is " + completeoutput)
expectedlist = ['2 received', dst_vm.name + '.' + domain_name, dst_vm.ipaddress]
expectedlist = ['2 received', dst_vm.name + '.' + domain_name,
dst_vm.ipaddress]
for item in expectedlist:
if item in completeoutput:
self.debug("excepted value found in vm: " + item)
@ -163,7 +163,8 @@ class TestNuageInternalDns(nuageTestCase):
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -204,7 +205,8 @@ class TestNuageInternalDns(nuageTestCase):
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -264,7 +266,8 @@ class TestNuageInternalDns(nuageTestCase):
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, ISOLATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -373,7 +376,8 @@ class TestNuageInternalDns(nuageTestCase):
"Network Domain is not updated as expected"
)
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -432,7 +436,8 @@ class TestNuageInternalDns(nuageTestCase):
"Network Domain is not updated as expected"
)
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, UPDATED_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(
@ -484,7 +489,7 @@ class TestNuageInternalDns(nuageTestCase):
vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"])
self.validate_VpcOffering(vpc_off, state="Enabled")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
self.debug("Creating Nuage Vsp VPC Network offering...")
network_offering = self.create_NetworkOffering(
@ -501,10 +506,12 @@ class TestNuageInternalDns(nuageTestCase):
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
@attr(tags=["advanced", "nuagevsp"], required_hardware="true")
@ -527,7 +534,7 @@ class TestNuageInternalDns(nuageTestCase):
vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"])
self.validate_VpcOffering(vpc_off, state="Enabled")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
self.debug("Creating Nuage Vsp VPC Network offering...")
network_offering = self.create_NetworkOffering(
@ -546,7 +553,8 @@ class TestNuageInternalDns(nuageTestCase):
self.verify_vsd_dhcp_option(self.DOMAINNAME, "vpc.com", network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
self.test_data["virtual_machine"]["displayname"] = "vm2"
@ -557,7 +565,8 @@ class TestNuageInternalDns(nuageTestCase):
self.verify_vsd_vm(vm_2)
for nic in vm_2.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True)
public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc)
@ -594,7 +603,7 @@ class TestNuageInternalDns(nuageTestCase):
vpc_off = self.create_VpcOffering(self.dnsdata["vpc_offering"])
self.validate_VpcOffering(vpc_off, state="Enabled")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16', cleanup=False)
self.debug("Creating Nuage Vsp VPC Network offering...")
network_offering = self.create_NetworkOffering(
@ -610,10 +619,12 @@ class TestNuageInternalDns(nuageTestCase):
self.verify_vsd_vm(vm_1)
# Internal DNS check point on VSD
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, network_1)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
network_1)
for nic in vm_1.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm1", nic, True)
self.test_data["virtual_machine"]["displayname"] = "vm2"
@ -624,7 +635,8 @@ class TestNuageInternalDns(nuageTestCase):
self.verify_vsd_vm(vm_2)
for nic in vm_2.nic:
self.verify_vsd_dhcp_option(self.DNS, "10.1.1.2", nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME, nic, True)
self.verify_vsd_dhcp_option(self.DOMAINNAME, VPC_DOMAIN_NAME,
nic, True)
self.verify_vsd_dhcp_option(self.HOSTNAME, "vm2", nic, True)
public_ip_1 = self.acquire_PublicIPAddress(network_1, vpc)

View File

@ -1154,7 +1154,7 @@ class TestNuageMigration(nuageTestCase):
@attr(tags=["migrateACS", "vpcnovms"],
required_hardware="false")
def test_10_migrate_native_vpc(self):
vpc = self.create_Vpc(self.native_vpc_offering)
vpc = self.create_vpc(self.native_vpc_offering)
network = self.create_Network(self.native_vpc_network_offering,
vpc=vpc)
self.create_VM(network)
@ -1222,8 +1222,8 @@ class TestNuageMigration(nuageTestCase):
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
self.debug("Creating native VPC Network Tier offering "
"with Static NAT service provider as VPCVR")
@ -1484,8 +1484,8 @@ class TestNuageMigration(nuageTestCase):
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
self.debug("Creating native VPC Network Tier offering "
"with Static NAT service provider as VPCVR")
@ -1802,8 +1802,8 @@ class TestNuageMigration(nuageTestCase):
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
self.debug("Creating native VPC Network Tier offering "
"with Static NAT service provider as VPCVR")
@ -1922,8 +1922,8 @@ class TestNuageMigration(nuageTestCase):
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(native_vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
self.debug("Creating native VPC Network Tier offering "
"with Static NAT service provider as VPCVR")

View File

@ -139,8 +139,8 @@ class TestNuagePasswordReset(nuageTestCase):
# (SSH client)
def install_cloud_set_guest_password_script(self, ssh_client):
if self.isSimulator:
self.debug( "Simulator Environment: Skipping installing"
" cloud-set-guest-password script")
self.debug("Simulator Environment: Skipping installing"
" cloud-set-guest-password script")
return
self.debug("Installing cloud-set-guest-password script")
cmd = "cd /etc/init.d;wget http://people.apache.org/~tsp/" \
@ -268,8 +268,7 @@ class TestNuagePasswordReset(nuageTestCase):
self.debug("Actual user data - " + actual_user_data +
", Expected user data - " + expected_user_data)
self.assertEqual(actual_user_data, expected_user_data,
"Un-expected VM (VM_1) user data"
)
"Un-expected VM (VM_1) user data")
self.debug("Checking for cloud-set-guest-password script in the "
"VM for testing password reset functionality...")

View File

@ -460,19 +460,19 @@ class TestNuageSourceNat(nuageTestCase):
# Creating VPCs
self.debug("Creating a VPC with Source NAT service provider as "
"NuageVsp...")
vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_1, state="Enabled")
vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_vpc(vpc_1, state="Enabled")
self.debug("Creating a VPC with Source NAT service provider as "
"VpcVirtualRouter...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_2, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support provider VpcVirtualRouter for "
"service Source NAT for VPCs")
self.debug("Creating a VPC without Source NAT service...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_3, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support VPCs without Source NAT "
"service")
@ -714,8 +714,8 @@ class TestNuageSourceNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Source NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offering
self.debug("Creating Nuage VSP VPC Network offering with Source NAT "
@ -887,8 +887,8 @@ class TestNuageSourceNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Source NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating VPC network offering
self.debug("Creating Nuage VSP VPC Network offering with Source NAT "
@ -1321,8 +1321,8 @@ class TestNuageSourceNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Source NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating VPC network offering
self.debug("Creating Nuage VSP VPC Network offering with Source NAT "

View File

@ -849,19 +849,19 @@ class TestNuageStaticNat(nuageTestCase):
# Creating VPCs
self.debug("Creating a VPC with Static NAT service provider as "
"NuageVsp...")
vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_1, state="Enabled")
vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_vpc(vpc_1, state="Enabled")
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_2, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support provider VpcVirtualRouter for "
"service Static NAT for VPCs")
self.debug("Creating a VPC without Static NAT service...")
vpc_2 = self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_2, state="Enabled")
vpc_2 = self.create_vpc(vpc_off_3, cidr='10.1.0.0/16')
self.validate_vpc(vpc_2, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Static NAT "
@ -1194,8 +1194,8 @@ class TestNuageStaticNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Static NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offering
self.debug("Creating Nuage VSP VPC Network offering with Static NAT "
@ -1406,8 +1406,8 @@ class TestNuageStaticNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Static NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offering
self.debug("Creating Nuage VSP VPC Network offering with Static NAT "
@ -1696,7 +1696,8 @@ class TestNuageStaticNat(nuageTestCase):
# from the deployed VM
if not self.isSimulator:
with self.assertRaises(Exception):
self.verify_StaticNAT_Internet_traffic(vm, network_1, public_ip_1)
self.verify_StaticNAT_Internet_traffic(vm, network_1,
public_ip_1)
self.debug("Static NAT rule not enabled in this VM NIC")
self.verify_StaticNAT_Internet_traffic(vm, network_2, public_ip_2)
@ -1991,8 +1992,8 @@ class TestNuageStaticNat(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Static NAT service provider as "
"NuageVsp...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating VPC network offering
self.debug("Creating Nuage VSP VPC Network offering with Static NAT "

View File

@ -375,25 +375,25 @@ class TestNuageInternalLb(nuageTestCase):
# Creating VPCs
self.debug("Creating a VPC with LB service provider as "
"InternalLbVm...")
vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_1, state="Enabled")
vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_vpc(vpc_1, state="Enabled")
self.debug("Creating a VPC with LB service provider as "
"VpcVirtualRouter...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_2, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support provider VpcVirtualRouter for "
"service LB for VPCs")
self.debug("Creating a VPC with LB service provider as Netscaler...")
with self.assertRaises(Exception):
self.create_Vpc(vpc_off_3, cidr='10.1.0.0/16')
self.create_vpc(vpc_off_3, cidr='10.1.0.0/16')
self.debug("Nuage VSP does not support provider Netscaler for service "
"LB for VPCs")
self.debug("Creating a VPC without LB service...")
vpc_2 = self.create_Vpc(vpc_off_4, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_2, state="Enabled")
vpc_2 = self.create_vpc(vpc_off_4, cidr='10.1.0.0/16')
self.validate_vpc(vpc_2, state="Enabled")
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_02_nuage_internallb_vpc_network_offering(self):
@ -438,8 +438,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with LB Service "
@ -594,12 +594,12 @@ class TestNuageInternalLb(nuageTestCase):
# Creating VPCs
self.debug("Creating a VPC with Internal LB service...")
vpc_1 = self.create_Vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_1, state="Enabled")
vpc_1 = self.create_vpc(vpc_off_1, cidr='10.1.0.0/16')
self.validate_vpc(vpc_1, state="Enabled")
self.debug("Creating a VPC without Internal LB service...")
vpc_2 = self.create_Vpc(vpc_off_2, cidr='10.1.0.0/16')
self.validate_Vpc(vpc_2, state="Enabled")
vpc_2 = self.create_vpc(vpc_off_2, cidr='10.1.0.0/16')
self.validate_vpc(vpc_2, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -794,8 +794,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -1148,8 +1148,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -1477,8 +1477,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -1742,8 +1742,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -1881,8 +1881,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vsd_firewall_rule(public_ssh_rule)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restart Internal tier (cleanup = false)
# InternalLbVm gets destroyed and deployed again in the Internal tier
@ -1921,8 +1922,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restart Internal tier (cleanup = true)
# InternalLbVm gets destroyed and deployed again in the Internal tier
self.debug("Restarting the Internal tier with cleanup...")
@ -1961,8 +1963,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restart Public tier (cleanup = false)
# This restart has no effect on the InternalLbVm functionality
@ -2042,8 +2045,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Stopping VMs in the Internal tier
# wget traffic test fails as all the VMs in the Internal tier are in
@ -2074,8 +2078,10 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vsd_lb_device(int_lb_vm)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm, should_fail=True)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=True)
# Starting VMs in the Internal tier
# wget traffic test succeeds as all the VMs in the Internal tier are
@ -2114,8 +2120,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restarting VPC (cleanup = false)
# VPC VR gets destroyed and deployed again in the VPC
@ -2162,8 +2169,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Restarting VPC (cleanup = true)
# VPC VR gets destroyed and deployed again in the VPC
@ -2219,9 +2227,13 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_lb_wget_file(
wget_file, [internal_vm, internal_vm_1, internal_vm_2])
def verify_internal_lb_wget_traffic(self, int_lb_rule_1, internal_vm, internal_vm_1, internal_vm_2, public_ip, public_vm, should_fail=False):
def verify_internal_lb_wget_traffic(self, int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=False):
if self.isSimulator:
self.debug("Simulator Environment: not running wget traffic tests.")
self.debug("Simulator Environment: "
"not running wget traffic tests.")
return
ssh_client = self.ssh_into_VM(public_vm, public_ip)
tries = 0
@ -2242,8 +2254,8 @@ class TestNuageInternalLb(nuageTestCase):
with self.assertRaises(Exception):
self.verify_lb_wget_file(
wget_file, [internal_vm, internal_vm_1, internal_vm_2])
self.debug("Failed to wget file as all the VMs in the Internal tier "
"are in stopped state")
self.debug("Failed to wget file as all the VMs in the Internal "
"tier are in stopped state")
else:
self.verify_lb_wget_file(
wget_file, [internal_vm, internal_vm_1, internal_vm_2])
@ -2280,8 +2292,8 @@ class TestNuageInternalLb(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Internal LB service...")
vpc = self.create_Vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_off, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating network offerings
self.debug("Creating Nuage VSP VPC Network offering with Internal LB "
@ -2431,8 +2443,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vsd_firewall_rule(public_ssh_rule)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# # Stopping the InternalLbVm when the VPC VR is in Stopped state
self.stop_InternalLbVm(int_lb_vm)
@ -2451,8 +2464,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm,
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=True)
# # Starting the InternalLbVm when the VPC VR is in Stopped state
@ -2473,8 +2487,9 @@ class TestNuageInternalLb(nuageTestCase):
# Internal LB (wget) traffic test
# Bug CLOUDSTACK-9837
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# Starting the VPC VR
# VPC VR has no effect on the InternalLbVm functionality
@ -2505,48 +2520,9 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm, should_fail=True)
# # Starting the InternalLbVm when the VPC VR is in Running state
self.start_InternalLbVm(int_lb_vm)
self.check_InternalLbVm_state(
internal_tier, int_lb_rule_1.sourceipaddress, state="Running")
# VSD Verification
self.verify_vsd_lb_device(int_lb_vm)
# Verifying Internal Load Balanced VMs ingress traffic
# (SSH into VM via Static NAT rule)
self.debug("Verifying Internal Load Balanced VMs ingress traffic "
"(SSH into VM via Static NAT rule)...")
self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
# # Force Stopping the InternalLbVm when the VPC VR is in Running state
self.stop_InternalLbVm(int_lb_vm, force=True)
self.check_InternalLbVm_state(
internal_tier, int_lb_rule_1.sourceipaddress, state="Stopped")
# VSD Verification
self.verify_vsd_lb_device(int_lb_vm, stopped=True)
# Verifying Internal Load Balanced VMs ingress traffic
# (SSH into VM via Static NAT rule)
self.debug("Verifying Internal Load Balanced VMs ingress traffic "
"(SSH into VM via Static NAT rule)...")
self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm,
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=True)
# # Starting the InternalLbVm when the VPC VR is in Running state
@ -2566,5 +2542,49 @@ class TestNuageInternalLb(nuageTestCase):
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm, internal_vm_1,
internal_vm_2, public_ip, public_vm)
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)
# # Force Stopping the InternalLbVm when the VPC VR is in Running state
self.stop_InternalLbVm(int_lb_vm, force=True)
self.check_InternalLbVm_state(
internal_tier, int_lb_rule_1.sourceipaddress, state="Stopped")
# VSD Verification
self.verify_vsd_lb_device(int_lb_vm, stopped=True)
# Verifying Internal Load Balanced VMs ingress traffic
# (SSH into VM via Static NAT rule)
self.debug("Verifying Internal Load Balanced VMs ingress traffic "
"(SSH into VM via Static NAT rule)...")
self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm,
should_fail=True)
# # Starting the InternalLbVm when the VPC VR is in Running state
self.start_InternalLbVm(int_lb_vm)
self.check_InternalLbVm_state(
internal_tier, int_lb_rule_1.sourceipaddress, state="Running")
# VSD Verification
self.verify_vsd_lb_device(int_lb_vm)
# Verifying Internal Load Balanced VMs ingress traffic
# (SSH into VM via Static NAT rule)
self.debug("Verifying Internal Load Balanced VMs ingress traffic "
"(SSH into VM via Static NAT rule)...")
self.verify_vpc_vm_ingress_traffic(internal_vm, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_1, internal_tier, vpc)
self.verify_vpc_vm_ingress_traffic(internal_vm_2, internal_tier, vpc)
# Internal LB (wget) traffic test
self.verify_internal_lb_wget_traffic(int_lb_rule_1, internal_vm,
internal_vm_1, internal_vm_2,
public_ip, public_vm)

View File

@ -20,7 +20,7 @@ Nuage VSP SDN plugin
"""
# Import Local Modules
from nuageTestCase import nuageTestCase
from marvin.lib.base import Account, VPC
from marvin.lib.base import Account
# Import System Modules
from nose.plugins.attrib import attr
@ -75,8 +75,8 @@ class TestNuageVpcNetwork(nuageTestCase):
# Creating a VPC
self.debug("Creating a VPC with Nuage VSP VPC offering...")
vpc = self.create_Vpc(vpc_offering, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(vpc_offering, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
# Creating a network offering
self.debug("Creating Nuage VSP VPC Network offering...")

View File

@ -158,7 +158,7 @@ class TestNuageDomainTemplate(nuageTestCase):
for i in range(0, 3):
cls.domain_template_list.append("domain_template_" + str(i))
for account in [cls.account_root, cls.account_d1, cls.account_d11]:
vpc = cls.create_Vpc(
vpc = cls.create_vpc(
cls.vpc_offering, cidr='10.1.0.0/16', account=account)
cls.create_Network(
cls.network_offering,
@ -350,7 +350,7 @@ class TestNuageDomainTemplate(nuageTestCase):
# 7. Delete all the created objects (cleanup).
# Creating VPC
vpc_1 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_1 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
# Associating pre-configured Nuage VSP Domain Template to VPC
with self.assertRaises(Exception):
@ -426,7 +426,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[0])
# Creating VPC
vpc_2 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_2 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
# Associating pre-configured Nuage VSP Domain Template to VPC
self.validate_NuageVspDomainTemplate(self.domain_template_list[0])
@ -481,7 +481,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[1])
# Creating VPC
vpc_3 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_3 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
# Associating pre-configured Nuage VSP Domain Template to VPC
self.validate_NuageVspDomainTemplate(self.domain_template_list[0])
@ -523,7 +523,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[0])
# Creating VPC and VPC network (tier)
vpc = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_tier = self.create_Network(self.network_offering, vpc=vpc)
# VSD verification
@ -669,7 +669,7 @@ class TestNuageDomainTemplate(nuageTestCase):
# Creating VPC
with self.assertRaises(Exception):
self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
self.debug("VPC creation fails as there is no domain template with "
"name invalid_domain_template in VSD as mentioned in "
"global setting nuagevsp.vpc.domaintemplate.name")
@ -685,7 +685,7 @@ class TestNuageDomainTemplate(nuageTestCase):
self.validate_NuageVspDomainTemplate(self.domain_template_list[0])
# Creating VPC and VPC networks (tiers)
vpc_1 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_1 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_1_tier_1 = self.create_Network(
self.network_offering, gateway='10.1.1.1', vpc=vpc_1)
vpc_1_tier_2 = self.create_Network(
@ -700,7 +700,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[0])
# Creating VPC and VPC networks (tiers)
vpc_2 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_2 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_2_tier_1 = self.create_Network(
self.network_offering, gateway='10.1.1.1', vpc=vpc_2)
vpc_2_tier_2 = self.create_Network(
@ -715,7 +715,7 @@ class TestNuageDomainTemplate(nuageTestCase):
domain_template_name=self.domain_template_list[0])
# Creating VPC
vpc_3 = self.create_Vpc(self.vpc_offering, cidr='10.1.0.0/16')
vpc_3 = self.create_vpc(self.vpc_offering, cidr='10.1.0.0/16')
# Associating pre-configured Nuage VSP Domain Template to VPC
self.validate_NuageVspDomainTemplate(self.domain_template_list[1])

View File

@ -343,8 +343,8 @@ class TestNuageManagedSubnets(nuageTestCase):
self.api_client.updateZone(cmd)
self.debug("Creating a VPC with Static NAT service provider as "
"VpcVirtualRouter")
vpc = self.create_Vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16')
self.validate_Vpc(vpc, state="Enabled")
vpc = self.create_vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16')
self.validate_vpc(vpc, state="Enabled")
acl_list = self.create_NetworkAclList(
name="acl", description="acl", vpc=vpc)
self.create_NetworkAclRule(
@ -354,8 +354,8 @@ class TestNuageManagedSubnets(nuageTestCase):
self.debug("Creating another VPC with Static NAT service provider "
"as VpcVirtualRouter")
vpc2 = self.create_Vpc(self.nuage_vpc_offering, cidr='10.2.0.0/16')
self.validate_Vpc(vpc2, state="Enabled")
vpc2 = self.create_vpc(self.nuage_vpc_offering, cidr='10.2.0.0/16')
self.validate_vpc(vpc2, state="Enabled")
acl_list2 = self.create_NetworkAclList(
name="acl", description="acl", vpc=vpc2)
self.create_NetworkAclRule(
@ -447,8 +447,8 @@ class TestNuageManagedSubnets(nuageTestCase):
self.debug("Creating another VPC with Static NAT service provider "
"as VpcVirtualRouter With same CIDR")
vpc3 = self.create_Vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16')
self.validate_Vpc(vpc3, state="Enabled")
vpc3 = self.create_vpc(self.nuage_vpc_offering, cidr='10.1.0.0/16')
self.validate_vpc(vpc3, state="Enabled")
acl_list3 = self.create_NetworkAclList(
name="acl", description="acl", vpc=vpc3)
self.create_NetworkAclRule(

View File

@ -350,10 +350,13 @@ class VirtualMachine:
self.username = services["username"]
else:
self.username = 'root'
if "password" in services:
self.password = services["password"]
else:
self.password = 'password'
if "password" not in items:
if "password" in services:
self.password = services["password"]
else:
self.password = 'password'
if "ssh_port" in services:
self.ssh_port = services["ssh_port"]
else:

View File

@ -54,10 +54,12 @@ setup(name="Marvin",
"pyvmomi >= 5.5.0",
"netaddr >= 0.7.14",
"dnspython",
"ipmisim >= 0.7"
"ipmisim >= 0.7",
"retries",
"PyCrypt"
],
extras_require={
"nuagevsp": ["vspk", "PyYAML", "futures", "netaddr", "retries", "jpype1"]
"nuagevsp": ["vspk", "PyYAML", "futures", "netaddr", "jpype1"]
},
py_modules=['marvin.marvinPlugin'],
zip_safe=False,