MCPcopy Create free account
hub / github.com/apache/cloudstack / test_02_list_cpvm_vm

Method test_02_list_cpvm_vm

test/integration/smoke/test_ssvm.py:271–407  ·  view source on GitHub ↗

Test List console proxy VMs

(self)

Source from the content-addressed store, hash-verified

269 "sg"],
270 required_hardware="false")
271 def test_02_list_cpvm_vm(self):
272 """Test List console proxy VMs
273 """
274
275 # Validate the following:
276 # 1. listSystemVM (systemvmtype=consoleproxy) should return
277 # at least ONE CPVM per zone
278 # 2. The returned ConsoleProxyVM should be in Running state
279 # 3. listSystemVM for console proxy should list publicip, privateip,
280 # link-localip and service offering id/name
281 # 4. The gateway programmed on the console proxy should be the same
282 # as the gateway returned by listZones
283 # 5. DNS entries must match those given for the zone
284
285 list_cpvm_response = list_ssvms(
286 self.apiclient,
287 systemvmtype='consoleproxy',
288 state='Running',
289 )
290 self.assertEqual(
291 isinstance(list_cpvm_response, list),
292 True,
293 "Check list response returns a valid list"
294 )
295 # Verify CPVM response
296 self.assertNotEqual(
297 len(list_cpvm_response),
298 0,
299 "Check list System VMs response"
300 )
301 list_zones_response = list_zones(self.apiclient)
302 # Number of Console Proxy VMs = No of Zones
303
304 self.assertEqual(
305 isinstance(list_zones_response, list),
306 True,
307 "Check list response returns a valid list"
308 )
309
310 self.debug("Number of zones: %s" % len(list_zones_response))
311 self.debug("Number of CPVMs: %s" % len(list_cpvm_response))
312
313 self.assertEqual(
314 len(list_cpvm_response),
315 len(list_zones_response),
316 "Check number of CPVMs with number of zones"
317 )
318 # For each CPVM check private IP, public IP, link local IP and DNS
319 for cpvm in list_cpvm_response:
320
321 self.debug("CPVM state: %s" % cpvm.state)
322 self.assertEqual(
323 cpvm.state,
324 'Running',
325 "Check whether state of CPVM is running"
326 )
327
328 self.assertEqual(

Callers 1

test_06_stop_cpvmMethod · 0.95

Calls 7

list_ssvmsFunction · 0.90
list_zonesFunction · 0.90
list_vlan_iprangesFunction · 0.90
assertEqualMethod · 0.80
debugMethod · 0.80
assertTrueMethod · 0.80
listMethod · 0.65

Tested by

no test coverage detected