mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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
This commit is contained in:
parent
ccf13ec04e
commit
469270ab0c
@ -55,6 +55,12 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"vmwaredc": {
|
||||||
|
"username": "",
|
||||||
|
"vcenter": "",
|
||||||
|
"password": "",
|
||||||
|
"name": ""
|
||||||
|
},
|
||||||
"ipranges": [
|
"ipranges": [
|
||||||
{
|
{
|
||||||
"startip": "192.168.2.2",
|
"startip": "192.168.2.2",
|
||||||
|
|||||||
@ -15,10 +15,15 @@
|
|||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import marvin
|
from marvin.cloudstackTestCase import cloudstackTestCase
|
||||||
import unittest
|
from marvin.cloudstackAPI import listSystemVms, listZones, listTemplates
|
||||||
from marvin.cloudstackTestCase import *
|
from marvin.lib.vcenter import Vcenter
|
||||||
from marvin.cloudstackAPI import *
|
from marvin.lib.common import verifyVCenterPortGroups
|
||||||
|
from marvin.codes import (PUBLIC_TRAFFIC,
|
||||||
|
MANAGEMENT_TRAFFIC,
|
||||||
|
STORAGE_TRAFFIC,
|
||||||
|
PASS,
|
||||||
|
VMWAREDVS)
|
||||||
from time import sleep as delay
|
from time import sleep as delay
|
||||||
|
|
||||||
|
|
||||||
@ -33,10 +38,11 @@ class TestSetupSuccess(cloudstackTestCase):
|
|||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
testClient = super(TestSetupSuccess, cls).getClsTestClient()
|
testClient = super(TestSetupSuccess, cls).getClsTestClient()
|
||||||
cls.apiClient = testClient.getApiClient()
|
cls.apiClient = testClient.getApiClient()
|
||||||
|
cls.hypervisor = testClient.getHypervisorInfo()
|
||||||
|
|
||||||
zones = listZones.listZonesCmd()
|
zones = listZones.listZonesCmd()
|
||||||
cls.zones_list = cls.apiClient.listZones(zones)
|
cls.zones_list = cls.apiClient.listZones(zones)
|
||||||
cls.retry = 2
|
cls.retry = 50
|
||||||
|
|
||||||
def test_systemVmReady(self):
|
def test_systemVmReady(self):
|
||||||
"""
|
"""
|
||||||
@ -89,10 +95,32 @@ class TestSetupSuccess(cloudstackTestCase):
|
|||||||
"builtIn templates not ready in zone %s" %
|
"builtIn templates not ready in zone %s" %
|
||||||
z.name)
|
z.name)
|
||||||
|
|
||||||
def test_deployVmWithBuiltIn(self):
|
def test_VCenterPorts(self):
|
||||||
"""
|
""" Test if correct VCenter ports are created for all traffic types """
|
||||||
Deploys a VM with the built-in CentOS template
|
|
||||||
"""
|
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
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user