cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [47/53] [abbrv] git commit: updated refs/heads/reporter to 5c99784
Date Wed, 15 Apr 2015 08:05:47 GMT
CLOUDSTACK-8374: Adding tests for guest traffic port group verification - Shared and Isolated
networks


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9777e905
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9777e905
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9777e905

Branch: refs/heads/reporter
Commit: 9777e90504841b4fd95ba87edade707fec66dc89
Parents: c0d3e6f
Author: Gaurav Aradhye <gaurav.aradhye@clogeny.com>
Authored: Tue Apr 14 13:22:07 2015 +0530
Committer: Gaurav Aradhye <gaurav.aradhye@clogeny.com>
Committed: Tue Apr 14 18:17:17 2015 +0530

----------------------------------------------------------------------
 .../component/test_shared_networks.py           | 79 +++++++++++++++++++-
 test/integration/smoke/test_network.py          | 18 ++++-
 2 files changed, 94 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9777e905/test/integration/component/test_shared_networks.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_shared_networks.py b/test/integration/component/test_shared_networks.py
index dde5983..3b21d8d 100644
--- a/test/integration/component/test_shared_networks.py
+++ b/test/integration/component/test_shared_networks.py
@@ -40,7 +40,8 @@ from marvin.lib.common import (get_domain,
                                get_template,
                                get_free_vlan,
                                wait_for_cleanup,
-                               verifyRouterState)
+                               verifyRouterState,
+                               verifyGuestTrafficPortGroups)
 from marvin.sshClient import SshClient
 from marvin.codes import PASS
 from ddt import ddt, data
@@ -61,6 +62,7 @@ class TestSharedNetworks(cloudstackTestCase):
         # Get Zone, Domain and templates
         cls.domain = get_domain(cls.api_client)
         cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests())
+        cls.hypervisor = cls.testClient.getHypervisorInfo()
         cls.template = get_template(
             cls.api_client,
             cls.zone.id,
@@ -3672,3 +3674,78 @@ class TestSharedNetworks(cloudstackTestCase):
             "Check if disassociated IP Address is no longer available"
         )
         return
+
+    @attr(tags=["advanced", "dvs"], required_hardware="true")
+    def test_guest_traffic_port_groups_shared_network(self):
+        """ Verify vcenter port groups are created for shared network
+
+        # Steps,
+        #  1. Create a shared network
+        #  2. Deploy a VM in shared network so that router is
+        #     created
+        #  3. Verify that corresponding port groups are created
+              for guest traffic
+        """
+
+        if self.hypervisor.lower() != "vmware":
+            self.skipTest("This test is intended for only vmware")
+
+        physical_network, shared_vlan = get_free_vlan(
+            self.api_client, self.zone.id)
+        if shared_vlan is None:
+            self.fail("Failed to get free vlan id for shared network")
+
+        self.testdata["shared_network_offering"]["specifyVlan"] = "True"
+        self.testdata["shared_network_offering"]["specifyIpRanges"] = "True"
+
+        # Create Network Offering
+        self.shared_network_offering = NetworkOffering.create(
+            self.api_client,
+            self.testdata["shared_network_offering"],
+            conservemode=False
+        )
+
+        # Update network offering state from disabled to enabled.
+        NetworkOffering.update(
+            self.shared_network_offering,
+            self.api_client,
+            id=self.shared_network_offering.id,
+            state="enabled"
+        )
+
+        # create network using the shared network offering created
+        self.testdata["shared_network"]["acltype"] = "Domain"
+        self.testdata["shared_network"][
+            "networkofferingid"] = self.shared_network_offering.id
+        self.testdata["shared_network"][
+            "physicalnetworkid"] = physical_network.id
+        self.testdata["shared_network"]["vlan"] = shared_vlan
+
+        self.network = Network.create(
+            self.api_client,
+            self.testdata["shared_network"],
+            networkofferingid=self.shared_network_offering.id,
+            zoneid=self.zone.id,
+        )
+        self.cleanup_networks.append(self.network)
+
+        vm = VirtualMachine.create(
+            self.api_client,
+            self.testdata["virtual_machine"],
+            networkids=self.network.id,
+            serviceofferingid=self.service_offering.id
+        )
+        self.cleanup_vms.append(vm)
+
+        routers = Router.list(self.api_client,
+                    networkid=self.network.id,
+                    listall=True)
+
+        self.assertEqual(validateList(routers)[0], PASS,
+                "No Router associated with the network found")
+
+        response = verifyGuestTrafficPortGroups(self.api_client,
+                                                self.config,
+                                                self.zone)
+        self.assertEqual(response[0], PASS, response[1])
+        return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9777e905/test/integration/smoke/test_network.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py
index b1c5805..00d2029 100644
--- a/test/integration/smoke/test_network.py
+++ b/test/integration/smoke/test_network.py
@@ -17,7 +17,8 @@
 """ BVT tests for Network Life Cycle
 """
 # Import Local Modules
-from marvin.codes import FAILED, STATIC_NAT_RULE, LB_RULE, NAT_RULE
+from marvin.codes import (FAILED, STATIC_NAT_RULE, LB_RULE,
+                          NAT_RULE, PASS)
 from marvin.cloudstackTestCase import cloudstackTestCase
 from marvin.cloudstackException import CloudstackAPIException
 from marvin.cloudstackAPI import rebootRouter
@@ -43,7 +44,8 @@ from marvin.lib.common import (get_domain,
                                list_routers,
                                list_virtual_machines,
                                list_lb_rules,
-                               list_configurations)
+                               list_configurations,
+                               verifyGuestTrafficPortGroups)
 from nose.plugins.attrib import attr
 from ddt import ddt, data
 # Import System modules
@@ -247,6 +249,7 @@ class TestPortForwarding(cloudstackTestCase):
         testClient = super(TestPortForwarding, cls).getClsTestClient()
         cls.apiclient = testClient.getApiClient()
         cls.services = testClient.getParsedTestDataConfig()
+        cls.hypervisor = testClient.getHypervisorInfo()
         # Get Zone, Domain and templates
         cls.domain = get_domain(cls.apiclient)
         cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
@@ -551,6 +554,17 @@ class TestPortForwarding(cloudstackTestCase):
             )
         return
 
+    @attr(tags=["advanced", "dvs"], required_hardware="true")
+    def test_guest_traffic_port_groups_isolated_network(self):
+        """ Verify port groups are created for guest traffic
+        used by isolated network """
+
+        if self.hypervisor.lower() == "vmware":
+            response = verifyGuestTrafficPortGroups(self.apiclient,
+                                                    self.config,
+                                                    self.zone)
+            assert response[0] == PASS, response[1]
+
 
 class TestRebootRouter(cloudstackTestCase):
 


Mime
View raw message