You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2016/11/16 05:35:52 UTC
[3/7] git commit: updated refs/heads/master to 3638965
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a97d54f3/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py b/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
index 7dec5a6..ca16efb 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
@@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.
-""" Component tests for basic VPC Network functionality with Nuage VSP SDN plugin
+""" Component tests for basic VPC Network functionality with
+Nuage VSP SDN plugin
"""
# Import Local Modules
from nuageTestCase import nuageTestCase
@@ -30,7 +31,7 @@ class TestNuageVpcNetwork(nuageTestCase):
@classmethod
def setUpClass(cls, zone=None):
- super(TestNuageVpcNetwork, cls).setUpClass(zone=zone)
+ super(TestNuageVpcNetwork, cls).setUpClass()
return
def setUp(self):
@@ -48,20 +49,26 @@ class TestNuageVpcNetwork(nuageTestCase):
""" Test basic VPC Network functionality with Nuage VSP SDN plugin
"""
- # 1. Create Nuage VSP VPC offering, check if it is successfully created and enabled.
- # 2. Create a VPC with Nuage VSP VPC offering, check if it is successfully created and enabled.
- # 3. Create Nuage VSP VPC Network offering, check if it is successfully created and enabled.
+ # 1. Create Nuage VSP VPC offering, check if it is successfully
+ # created and enabled.
+ # 2. Create a VPC with Nuage VSP VPC offering, check if it is
+ # successfully created and enabled.
+ # 3. Create Nuage VSP VPC Network offering, check if it is successfully
+ # created and enabled.
# 4. Create an ACL list in the created VPC, and add an ACL item to it.
- # 5. Create a VPC Network with Nuage VSP VPC Network offering and the created ACL list, check if it is
- # successfully created, is in the "Implemented" state, and is added to the VPC VR.
- # 6. Deploy a VM in the created VPC network, check if the VM is successfully deployed and is in the "Running"
- # state.
- # 7. Verify that the created ACL item is successfully implemented in Nuage VSP.
+ # 5. Create a VPC Network with Nuage VSP VPC Network offering and the
+ # created ACL list, check if it is successfully created, is in the
+ # "Implemented" state, and is added to the VPC VR.
+ # 6. Deploy a VM in the created VPC network, check if the VM is
+ # successfully deployed and is in the "Running" state.
+ # 7. Verify that the created ACL item is successfully implemented in
+ # Nuage VSP.
# 8. Delete all the created objects (cleanup).
# Creating a VPC offering
self.debug("Creating Nuage VSP VPC offering...")
- vpc_offering = self.create_VpcOffering(self.test_data["nuagevsp"]["vpc_offering"])
+ vpc_offering = self.create_VpcOffering(
+ self.test_data["nuagevsp"]["vpc_offering"])
self.validate_VpcOffering(vpc_offering, state="Enabled")
# Creating a VPC
@@ -71,18 +78,23 @@ class TestNuageVpcNetwork(nuageTestCase):
# Creating a network offering
self.debug("Creating Nuage VSP VPC Network offering...")
- network_offering = self.create_NetworkOffering(self.test_data["nuagevsp"]["vpc_network_offering"])
+ network_offering = self.create_NetworkOffering(
+ self.test_data["nuagevsp"]["vpc_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
# Creating an ACL list
- acl_list = self.create_NetworkAclList(name="acl", description="acl", vpc=vpc)
+ acl_list = self.create_NetworkAclList(
+ name="acl", description="acl", vpc=vpc)
# Creating an ACL item
- acl_item = self.create_NetworkAclRule(self.test_data["ingress_rule"], acl_list=acl_list)
+ acl_item = self.create_NetworkAclRule(
+ self.test_data["ingress_rule"], acl_list=acl_list)
# Creating a VPC network in the VPC
- self.debug("Creating a VPC network with Nuage VSP VPC Network offering...")
- vpc_network = self.create_Network(network_offering, vpc=vpc, acl_list=acl_list)
+ self.debug("Creating a VPC network with Nuage VSP VPC Network "
+ "offering...")
+ vpc_network = self.create_Network(
+ network_offering, vpc=vpc, acl_list=acl_list)
self.validate_Network(vpc_network, state="Implemented")
vr = self.get_Router(vpc_network)
self.check_Router_state(vr, state="Running")
@@ -99,18 +111,25 @@ class TestNuageVpcNetwork(nuageTestCase):
# VSD verification for ACL item
self.verify_vsd_firewall_rule(acl_item)
- @attr(tags=["advanced", "nuagevsp", "multizone"], required_hardware="false")
+ @attr(
+ tags=["advanced", "nuagevsp", "multizone"], required_hardware="false")
def test_nuage_vpc_network_multizone(self):
- """ Test basic VPC Network functionality with Nuage VSP SDN plugin on multiple zones
+ """ Test basic VPC Network functionality with Nuage VSP SDN plugin on
+ multiple zones
"""
- # Repeat the tests in the above testcase "test_nuage_vpc_network" on multiple zones
+ # Repeat the tests in the above testcase "test_nuage_vpc_network" on
+ # multiple zones
- self.debug("Testing basic VPC Network functionality with Nuage VSP SDN plugin on multiple zones...")
+ self.debug("Testing basic VPC Network functionality with Nuage VSP "
+ "SDN plugin on multiple zones...")
zones = Zone.list(self.api_client)
if len(zones) == 1:
self.skipTest("There is only one Zone configured: skipping test")
for zone in zones:
self.debug("Zone - %s" % zone.name)
- self.setUpClass(zone=zone)
+ # Get Zone details
+ self.getZoneDetails()
+ # Configure VSD sessions
+ self.configureVSDSessions()
self.test_nuage_vpc_network()
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a97d54f3/test/integration/plugins/nuagevsp/test_nuage_vsp.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/test_nuage_vsp.py b/test/integration/plugins/nuagevsp/test_nuage_vsp.py
index d71d0c1..38b5b23 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_vsp.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_vsp.py
@@ -45,89 +45,110 @@ class TestNuageVsp(nuageTestCase):
self.cleanup = [self.account]
return
- # validate_NuageVspDevice - Validates the addition of Nuage VSP device in the Nuage VSP Physical Network
+ # validate_NuageVspDevice - Validates the addition of Nuage VSP device in
+ # the Nuage VSP Physical Network
def validate_NuageVspDevice(self):
- """Validates the addition of Nuage VSP device in the Nuage VSP Physical Network"""
- self.debug("Validating the addition of Nuage VSP device in the Nuage VSP Physical Network - %s" %
- self.vsp_physical_network.id)
- nuage_vsp_device = Nuage.list(self.api_client,
- physicalnetworkid=self.vsp_physical_network.id
- )
+ """Validates the addition of Nuage VSP device in the
+ Nuage VSP Physical Network"""
+ self.debug("Validating the addition of Nuage VSP device in the Nuage "
+ "VSP Physical Network - %s" % self.vsp_physical_network.id)
+ nuage_vsp_device = Nuage.list(
+ self.api_client,
+ physicalnetworkid=self.vsp_physical_network.id
+ )
self.assertEqual(isinstance(nuage_vsp_device, list), True,
"List Nuage VSP device should return a valid list"
)
- self.debug("Successfully validated the addition of Nuage VSP device in the Nuage VSP Physical Network - %s" %
+ self.debug("Successfully validated the addition of Nuage VSP device "
+ "in the Nuage VSP Physical Network - %s" %
self.vsp_physical_network.id)
- # delete_NuageVspDevice - Deletes the Nuage VSP device in the Nuage VSP Physical Network
+ # delete_NuageVspDevice - Deletes the Nuage VSP device in the Nuage VSP
+ # Physical Network
def delete_NuageVspDevice(self):
"""Deletes the Nuage VSP device in the Nuage VSP Physical Network"""
- self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical Network - %s" %
- self.vsp_physical_network.id)
- nuage_vsp_device = Nuage.list(self.api_client,
- physicalnetworkid=self.vsp_physical_network.id
- )[0]
+ self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical "
+ "Network - %s" % self.vsp_physical_network.id)
+ nuage_vsp_device = Nuage.list(
+ self.api_client,
+ physicalnetworkid=self.vsp_physical_network.id)[0]
cmd = deleteNuageVspDevice.deleteNuageVspDeviceCmd()
cmd.vspdeviceid = nuage_vsp_device.vspdeviceid
self.api_client.deleteNuageVspDevice(cmd)
- self.debug("Successfully deleted the Nuage VSP device in the Nuage VSP Physical Network - %s" %
- self.vsp_physical_network.id)
+ self.debug("Successfully deleted the Nuage VSP device in the Nuage "
+ "VSP Physical Network - %s" % self.vsp_physical_network.id)
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
def test_nuage_vsp_device(self):
""" Test Nuage VSP device in the Nuage VSP Physical Network
"""
- # 1. Verify that the Nuage VSP network service provider is successfully created and enabled in the Nuage VSP
- # Physical Network.
- # 2. Verify that the Nuage VSP device is successfully created in the Nuage VSP Physical Network.
- # 3. Delete the Nuage VSP device in the Nuage VSP Physical Network, verify that the Nuage VSP device is
- # successfully deleted in the Nuage VSP Physical Network.
- # 4. Add the Nuage VSP device in the Nuage VSP Physical Network with invalid VSD credentials, verify that the
- # Nuage VSP device failed to add in the Nuage VSP Physical Network.
- # 5. Add the Nuage VSP device in the Nuage VSP Physical Network with valid VSD credentials, verify that the
- # Nuage VSP device is successfully added in the Nuage VSP Physical Network.
+ # 1. Verify that the Nuage VSP network service provider is successfully
+ # created and enabled in the Nuage VSP Physical Network.
+ # 2. Verify that the Nuage VSP device is successfully created in the
+ # Nuage VSP Physical Network.
+ # 3. Delete the Nuage VSP device in the Nuage VSP Physical Network,
+ # verify that the Nuage VSP device is successfully deleted in the
+ # Nuage VSP Physical Network.
+ # 4. Add the Nuage VSP device in the Nuage VSP Physical Network with
+ # invalid VSD credentials, verify that the Nuage VSP device failed
+ # to add in the Nuage VSP Physical Network.
+ # 5. Add the Nuage VSP device in the Nuage VSP Physical Network with
+ # valid VSD credentials, verify that the Nuage VSP device is
+ # successfully added in the Nuage VSP Physical Network.
# Nuage VSP network service provider validation
- self.debug("Validating the Nuage VSP network service provider in the Nuage VSP Physical Network...")
+ self.debug("Validating the Nuage VSP network service provider in the "
+ "Nuage VSP Physical Network...")
self.validate_NetworkServiceProvider("NuageVsp", state="Enabled")
# Nuage VSP device validation
- self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
+ self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
+ "Network...")
self.validate_NuageVspDevice()
# Nuage VSP device deletion
- self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical Network...")
+ self.debug("Deleting the Nuage VSP device in the Nuage VSP Physical "
+ "Network...")
self.delete_NuageVspDevice()
# Nuage VSP device validation
- self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
+ self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
+ "Network...")
with self.assertRaises(Exception):
self.validate_NuageVspDevice()
- self.debug("Successfully deleted the Nuage VSP device in the Nuage VSP Physical Network")
+ self.debug("Successfully deleted the Nuage VSP device in the Nuage "
+ "VSP Physical Network")
# Adding the Nuage VSP device with invalid VSD credentials
- self.debug("Adding the Nuage VSP device in the Nuage VSP Physical Network with invalid VSD credentials...")
+ self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
+ "Network with invalid VSD credentials...")
vsd_info = self.nuage_vsp_device.__dict__
invalid_vsd_info = copy.deepcopy(vsd_info)
invalid_vsd_info["password"] = ""
with self.assertRaises(Exception):
- Nuage.add(self.api_client, invalid_vsd_info, self.vsp_physical_network.id)
- self.debug("Failed to add the Nuage VSP device in the Nuage VSP Physical Network due to invalid VSD "
- "credentials")
+ Nuage.add(
+ self.api_client, invalid_vsd_info,
+ self.vsp_physical_network.id)
+ self.debug("Failed to add the Nuage VSP device in the Nuage VSP "
+ "Physical Network due to invalid VSD credentials")
# Nuage VSP device validation
- self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
+ self.debug("Validating the Nuage VSP device in the Nuage VSP "
+ "Physical Network...")
with self.assertRaises(Exception):
self.validate_NuageVspDevice()
- self.debug("The Nuage VSP device is not added in the Nuage VSP Physical Network")
+ self.debug("The Nuage VSP device is not added in the Nuage VSP "
+ "Physical Network")
# Adding the Nuage VSP device with valid VSD credentials
- self.debug("Adding the Nuage VSP device in the Nuage VSP Physical Network with valid VSD credentials...")
+ self.debug("Adding the Nuage VSP device in the Nuage VSP Physical "
+ "Network with valid VSD credentials...")
Nuage.add(self.api_client, vsd_info, self.vsp_physical_network.id)
# Nuage VSP device validation
- self.debug("Validating the Nuage VSP device in the Nuage VSP Physical Network...")
+ self.debug("Validating the Nuage VSP device in the Nuage VSP Physical "
+ "Network...")
self.validate_NuageVspDevice()
@attr(tags=["advanced", "nuagevsp"], required_hardware="false")
@@ -135,26 +156,32 @@ class TestNuageVsp(nuageTestCase):
""" Test Nuage VSP SDN plugin with basic Isolated Network functionality
"""
- # 1. Verify that the Nuage VSP network service provider is successfully created and enabled.
- # 2. Create and enable Nuage VSP Isolated Network offering, check if it is successfully created and enabled.
- # 3. Create an Isolated Network with Nuage VSP Isolated Network offering, check if it is successfully created
- # and is in the "Allocated" state.
- # 4. Deploy a VM in the created Isolated network, check if the Isolated network state is changed to
- # "Implemented", and both the VM & VR are successfully deployed and are in the "Running" state.
- # 5. Deploy one more VM in the created Isolated network, check if the VM is successfully deployed and is in the
- # "Running" state.
- # 6. Delete the created Isolated Network after destroying its VMs, check if the Isolated network is successfully
- # deleted.
+ # 1. Verify that the Nuage VSP network service provider is successfully
+ # created and enabled.
+ # 2. Create and enable Nuage VSP Isolated Network offering, check if it
+ # is successfully created and enabled.
+ # 3. Create an Isolated Network with Nuage VSP Isolated Network
+ # offering, check if it is successfully created and is in the
+ # "Allocated" state.
+ # 4. Deploy a VM in the created Isolated network, check if the Isolated
+ # network state is changed to "Implemented", and both the VM & VR
+ # are successfully deployed and are in the "Running" state.
+ # 5. Deploy one more VM in the created Isolated network, check if the
+ # VM is successfully deployed and is in the "Running" state.
+ # 6. Delete the created Isolated Network after destroying its VMs,
+ # check if the Isolated network is successfully deleted.
# 7. Delete all the created objects (cleanup).
# Creating a network offering
- self.debug("Creating and enabling Nuage VSP Isolated Network offering...")
+ self.debug("Creating and enabling Nuage VSP Isolated Network "
+ "offering...")
network_offering = self.create_NetworkOffering(
self.test_data["nuagevsp"]["isolated_network_offering"])
self.validate_NetworkOffering(network_offering, state="Enabled")
# Creating a network
- self.debug("Creating an Isolated Network with Nuage VSP Isolated Network offering...")
+ self.debug("Creating an Isolated Network with Nuage VSP Isolated "
+ "Network offering...")
network = self.create_Network(network_offering)
self.validate_Network(network, state="Allocated")
@@ -178,7 +205,8 @@ class TestNuageVsp(nuageTestCase):
self.verify_vsd_vm(vm_2)
# Deleting the network
- self.debug("Deleting the Isolated Network with Nuage VSP Isolated Network offering...")
+ self.debug("Deleting the Isolated Network with Nuage VSP Isolated "
+ "Network offering...")
self.delete_VM(vm_1)
self.delete_VM(vm_2)
self.delete_Network(network)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a97d54f3/tools/marvin/marvin/cloudstackTestCase.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackTestCase.py b/tools/marvin/marvin/cloudstackTestCase.py
index 692e817..2939d12 100644
--- a/tools/marvin/marvin/cloudstackTestCase.py
+++ b/tools/marvin/marvin/cloudstackTestCase.py
@@ -37,7 +37,7 @@ def user(Name, DomainName, AcctType):
class cloudstackTestCase(unittest.case.TestCase):
clstestclient = None
- def assertElementInList(inp, toverify, responsevar=None, pos=0,
+ def assertElementInList(self, inp, toverify, responsevar=None, pos=0,
assertmsg="TC Failed for reason"):
'''
@Name: assertElementInList
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a97d54f3/tools/marvin/marvin/config/test_data.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py
index c9bb7c6..7612989 100644
--- a/tools/marvin/marvin/config/test_data.py
+++ b/tools/marvin/marvin/config/test_data.py
@@ -1731,7 +1731,7 @@ test_data = {
"name": 'nuage_marvin',
"displaytext": 'nuage_marvin',
"guestiptype": 'Isolated',
- "supportedservices": 'Dhcp,SourceNat,Connectivity,StaticNat,UserData,Firewall',
+ "supportedservices": 'Dhcp,SourceNat,Connectivity,StaticNat,UserData,Firewall,Dns',
"traffictype": 'GUEST',
"availability": 'Optional',
"serviceProviderList": {
@@ -1740,7 +1740,8 @@ test_data = {
"SourceNat": 'NuageVsp',
"Firewall": 'NuageVsp',
"Connectivity": 'NuageVsp',
- "UserData": 'VirtualRouter'
+ "UserData": 'VirtualRouter',
+ "Dns": 'VirtualRouter'
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "perzone"}
@@ -1751,7 +1752,7 @@ test_data = {
"name": 'nuage_vpc_marvin',
"displaytext": 'nuage_vpc_marvin',
"guestiptype": 'Isolated',
- "supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
+ "supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,Connectivity,UserData,Dns',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
@@ -1762,7 +1763,8 @@ test_data = {
"SourceNat": "NuageVsp",
"NetworkACL": "NuageVsp",
"Connectivity": "NuageVsp",
- "UserData": "VpcVirtualRouter"
+ "UserData": "VpcVirtualRouter",
+ "Dns": "VpcVirtualRouter"
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "perzone"}
@@ -1772,7 +1774,7 @@ test_data = {
"name": "nuage_vpc_marvin_internal_lb",
"displaytext": "nuage_vpc_marvin_internal_lb",
"guestiptype": 'Isolated',
- "supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
+ "supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData,Dns',
"traffictype": 'GUEST',
"availability": 'Optional',
"useVpc": 'on',
@@ -1784,7 +1786,8 @@ test_data = {
"SourceNat": "NuageVsp",
"NetworkACL": "NuageVsp",
"Connectivity": "NuageVsp",
- "UserData": "VpcVirtualRouter"
+ "UserData": "VpcVirtualRouter",
+ "Dns": "VpcVirtualRouter"
},
"serviceCapabilityList": {
"SourceNat": {"SupportedSourceNatTypes": "perzone"},
@@ -1795,20 +1798,21 @@ test_data = {
"vpc_offering": {
"name": 'Nuage VSP VPC offering',
"displaytext": 'Nuage VSP VPC offering',
- "supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
+ "supportedservices": 'Dhcp,StaticNat,SourceNat,NetworkACL,Connectivity,UserData,Dns',
"serviceProviderList": {
"Dhcp": "NuageVsp",
"StaticNat": "NuageVsp",
"SourceNat": "NuageVsp",
"NetworkACL": "NuageVsp",
"Connectivity": "NuageVsp",
- "UserData": "VpcVirtualRouter"
+ "UserData": "VpcVirtualRouter",
+ "Dns": "VpcVirtualRouter"
}
},
"vpc_offering_lb": {
"name": 'Nuage VSP VPC offering with Lb',
"displaytext": 'Nuage VSP VPC offering with Lb',
- "supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData',
+ "supportedservices": 'Dhcp,Lb,StaticNat,SourceNat,NetworkACL,Connectivity,UserData,Dns',
"serviceProviderList": {
"Dhcp": "NuageVsp",
"Lb": "InternalLbVm",
@@ -1816,7 +1820,8 @@ test_data = {
"SourceNat": "NuageVsp",
"NetworkACL": "NuageVsp",
"Connectivity": "NuageVsp",
- "UserData": "VpcVirtualRouter"
+ "UserData": "VpcVirtualRouter",
+ "Dns": "VpcVirtualRouter"
}
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a97d54f3/tools/marvin/setup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py
index 335ba71..3b32b07 100644
--- a/tools/marvin/setup.py
+++ b/tools/marvin/setup.py
@@ -56,6 +56,9 @@ setup(name="Marvin",
"dnspython",
"ipmisim >= 0.7"
],
+ extras_require={
+ "nuagevsp": ["libVSD", "PyYAML", "futures", "netaddr", "retries"]
+ },
py_modules=['marvin.marvinPlugin'],
zip_safe=False,
entry_points={