cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [36/53] [abbrv] git commit: updated refs/heads/reporter to 5c99784
Date Wed, 15 Apr 2015 08:05:36 GMT
CLOUDSTACK-8380: Adding script to testSetupSuccess.py to check VCenter port groups are created
for storage, management and public traffic as soon as zone is deployed


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

Branch: refs/heads/reporter
Commit: 469270ab0c6ee2df4d1ece0aa2b8d68fd281cd9a
Parents: ccf13ec
Author: Gaurav Aradhye <gaurav.aradhye@clogeny.com>
Authored: Mon Apr 13 16:50:38 2015 +0530
Committer: Gaurav Aradhye <gaurav.aradhye@clogeny.com>
Committed: Mon Apr 13 16:50:38 2015 +0530

----------------------------------------------------------------------
 setup/dev/advanced.cfg                  |  6 ++++
 tools/marvin/marvin/testSetupSuccess.py | 46 ++++++++++++++++++++++------
 2 files changed, 43 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/469270ab/setup/dev/advanced.cfg
----------------------------------------------------------------------
diff --git a/setup/dev/advanced.cfg b/setup/dev/advanced.cfg
index 18dee31..53a8221 100644
--- a/setup/dev/advanced.cfg
+++ b/setup/dev/advanced.cfg
@@ -55,6 +55,12 @@
                     ]
                 }
             ],
+            "vmwaredc": {
+                "username": "",
+                "vcenter": "",
+                "password": "",
+                "name": ""
+            },
             "ipranges": [
                 {
                     "startip": "192.168.2.2",

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/469270ab/tools/marvin/marvin/testSetupSuccess.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/testSetupSuccess.py b/tools/marvin/marvin/testSetupSuccess.py
index 8b000f9..c79ecda 100644
--- a/tools/marvin/marvin/testSetupSuccess.py
+++ b/tools/marvin/marvin/testSetupSuccess.py
@@ -15,10 +15,15 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import marvin
-import unittest
-from marvin.cloudstackTestCase import *
-from marvin.cloudstackAPI import *
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.cloudstackAPI import listSystemVms, listZones, listTemplates
+from marvin.lib.vcenter import Vcenter
+from marvin.lib.common import verifyVCenterPortGroups
+from marvin.codes import (PUBLIC_TRAFFIC,
+                          MANAGEMENT_TRAFFIC,
+                          STORAGE_TRAFFIC,
+                          PASS,
+                          VMWAREDVS)
 from time import sleep as delay
 
 
@@ -33,10 +38,11 @@ class TestSetupSuccess(cloudstackTestCase):
     def setUpClass(cls):
         testClient = super(TestSetupSuccess, cls).getClsTestClient()
         cls.apiClient = testClient.getApiClient()
+        cls.hypervisor = testClient.getHypervisorInfo()
 
         zones = listZones.listZonesCmd()
         cls.zones_list = cls.apiClient.listZones(zones)
-        cls.retry = 2
+        cls.retry = 50
 
     def test_systemVmReady(self):
         """
@@ -89,10 +95,32 @@ class TestSetupSuccess(cloudstackTestCase):
                                 "builtIn templates not ready in zone %s" %
                                 z.name)
 
-    def test_deployVmWithBuiltIn(self):
-        """
-        Deploys a VM with the built-in CentOS template
-        """
+    def test_VCenterPorts(self):
+        """  Test if correct VCenter ports are created for all traffic types """
+
+        if self.hypervisor.lower() != "vmware":
+            self.skipTest("This test is intended only for vmware")
+
+        zoneDict = {}
+        for zone in self.config.zones:
+            zoneDict[zone.name] = zone.vmwaredc
+
+        for zone in self.zones_list:
+            vmwaredc = zoneDict[zone.name]
+            vcenterObj = Vcenter(
+                vmwaredc.vcenter,
+                vmwaredc.username,
+                vmwaredc.password)
+            response = verifyVCenterPortGroups(
+                self.apiClient,
+                vcenterObj,
+                traffic_types_to_validate=[
+                    PUBLIC_TRAFFIC,
+                    MANAGEMENT_TRAFFIC,
+                    STORAGE_TRAFFIC],
+                zoneid=zone.id,
+                switchTypes=[VMWAREDVS])
+            self.assertEqual(response[0], PASS, response[1])
 
     @classmethod
     def tearDownClass(cls):


Mime
View raw message