Nuage VSP : Extending Marvin test coverage
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2ca0d9b0 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2ca0d9b0 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2ca0d9b0 Branch: refs/heads/master Commit: 2ca0d9b0e105e9b6d5462319e0ada716d3b66e55 Parents: d862a09 Author: Prashanth Manthena <prashanth.manth...@alcatel-lucent.com> Authored: Mon May 2 10:16:34 2016 +0200 Committer: Nick Livens <nick.liv...@nuagenetworks.net> Committed: Tue May 24 11:12:19 2016 +0200 ---------------------------------------------------------------------- .../plugins/nuagevsp/nuageTestCase.py | 8 +++--- .../plugins/nuagevsp/test_nuage_vpc_network.py | 28 +++++++++++++++----- tools/marvin/marvin/deployDataCenter.py | 17 +++++++++++- 3 files changed, 43 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2ca0d9b0/test/integration/plugins/nuagevsp/nuageTestCase.py ---------------------------------------------------------------------- diff --git a/test/integration/plugins/nuagevsp/nuageTestCase.py b/test/integration/plugins/nuagevsp/nuageTestCase.py index 9d0d077..11032a6 100644 --- a/test/integration/plugins/nuagevsp/nuageTestCase.py +++ b/test/integration/plugins/nuagevsp/nuageTestCase.py @@ -50,7 +50,7 @@ import socket class nuageTestCase(cloudstackTestCase): @classmethod - def setUpClass(cls): + def setUpClass(cls, zone=None): cls.debug("setUpClass nuageTestCase") # We want to fail quicker, if it's a failure @@ -60,9 +60,11 @@ class nuageTestCase(cloudstackTestCase): cls.api_client = test_client.getApiClient() cls.db_client = test_client.getDbConnection() cls.test_data = test_client.getParsedTestDataConfig() - # Get Zone, Domain and templates - cls.zone = get_zone(cls.api_client) + cls.zone = get_zone(cls.api_client, + zone_name=zone.name if zone else None, + zone_id=zone.id if zone else None + ) cls.domain = get_domain(cls.api_client) cls.template = get_template(cls.api_client, cls.zone.id, http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2ca0d9b0/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 a8361d0..15134b6 100644 --- a/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py +++ b/test/integration/plugins/nuagevsp/test_nuage_vpc_network.py @@ -15,22 +15,22 @@ # specific language governing permissions and limitations # under the License. -""" 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 -from marvin.lib.base import Account +from marvin.lib.base import Account, Zone # Import System Modules from nose.plugins.attrib import attr -class TestVpcNetworkNuage(nuageTestCase): +class TestNuageVpcNetwork(nuageTestCase): """ Test basic VPC Network functionality with Nuage VSP SDN plugin """ @classmethod - def setUpClass(cls): - super(TestVpcNetworkNuage, cls).setUpClass() + def setUpClass(cls, zone=None): + super(TestNuageVpcNetwork, cls).setUpClass(zone=zone) return def setUp(self): @@ -45,7 +45,7 @@ class TestVpcNetworkNuage(nuageTestCase): @attr(tags=["advanced", "nuagevsp"], required_hardware="false") def test_nuage_vpc_network(self): - """ Test Basic VPC Network Functionality with Nuage VSP SDN plugin + """ Test basic VPC Network functionality with Nuage VSP SDN plugin """ # 1. Create Nuage VSP VPC offering, check if it is successfully created and enabled. @@ -97,3 +97,19 @@ class TestVpcNetworkNuage(nuageTestCase): # VSD verification for ACL item self.verify_vsp_firewall_rule(acl_item) + + @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 + """ + + # 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...") + 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) + self.test_nuage_vpc_network() http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2ca0d9b0/tools/marvin/marvin/deployDataCenter.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py index 889aab5..2413328 100644 --- a/tools/marvin/marvin/deployDataCenter.py +++ b/tools/marvin/marvin/deployDataCenter.py @@ -561,7 +561,7 @@ class DeployDataCenters(object): netprov.physicalnetworkid = phynetwrk.id result = self.__apiClient.addNetworkServiceProvider(netprov) self.enableProvider(result.id) - elif provider.name in ['Netscaler', 'JuniperSRX', 'F5BigIp', 'NiciraNvp']: + elif provider.name in ['Netscaler', 'JuniperSRX', 'F5BigIp', 'NiciraNvp', 'NuageVsp']: netprov = addNetworkServiceProvider.\ addNetworkServiceProviderCmd() netprov.name = provider.name @@ -631,6 +631,21 @@ class DeployDataCenters(object): self.__tcRunLogger.\ debug("==== AddNiciraNvp Successful =====") self.__addToCleanUp("NiciraNvp", ret.id) + elif provider.name == 'NuageVsp': + dev = addNuageVspDevice.addNuageVspDeviceCmd() + dev.hostname = device.hostname + dev.port = device.port + dev.username = device.username + dev.password = device.password + dev.retrycount = device.retrycount + dev.retryinterval = device.retryinterval + dev.physicalnetworkid = phynetwrk.id + ret = self.__apiClient.addNuageVspDevice(dev) + if ret.id: + self.__tcRunLogger.\ + debug("==== addNuageVspDevice " + "Successful=====") + self.__addToCleanUp("addNuageVspDevice", ret.id) else: raise InvalidParameterException( "Device %s doesn't match "