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

Method setUpClass

test/integration/smoke/test_vm_life_cycle.py:268–346  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

266
267 @classmethod
268 def setUpClass(cls):
269 testClient = super(TestVMLifeCycle, cls).getClsTestClient()
270 cls.apiclient = testClient.getApiClient()
271 cls.services = testClient.getParsedTestDataConfig()
272 cls.hypervisor = testClient.getHypervisorInfo()
273
274 # Get Zone, Domain and templates
275 cls.domain = get_domain(cls.apiclient)
276 cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
277 cls.services['mode'] = cls.zone.networktype
278
279 # if local storage is enabled, alter the offerings to use localstorage
280 # this step is needed for devcloud
281 if cls.zone.localstorageenabled == True:
282 cls.services["service_offerings"]["tiny"]["storagetype"] = 'local'
283 cls.services["service_offerings"]["small"]["storagetype"] = 'local'
284 cls.services["service_offerings"]["medium"]["storagetype"] = 'local'
285
286 template = get_suitable_test_template(
287 cls.apiclient,
288 cls.zone.id,
289 cls.services["ostype"],
290 cls.hypervisor
291 )
292 if template == FAILED:
293 assert False, "get_suitable_test_template() failed to return template with description %s" % cls.services["ostype"]
294
295 # Set Zones and disk offerings
296 cls.services["small"]["zoneid"] = cls.zone.id
297 cls.services["small"]["template"] = template.id
298
299 cls.services["iso1"]["zoneid"] = cls.zone.id
300
301 # Create VMs, NAT Rules etc
302 cls.account = Account.create(
303 cls.apiclient,
304 cls.services["account"],
305 domainid=cls.domain.id
306 )
307
308 cls.small_offering = ServiceOffering.create(
309 cls.apiclient,
310 cls.services["service_offerings"]["small"]
311 )
312
313 cls.medium_offering = ServiceOffering.create(
314 cls.apiclient,
315 cls.services["service_offerings"]["medium"]
316 )
317 # create small and large virtual machines
318 cls.small_virtual_machine = VirtualMachine.create(
319 cls.apiclient,
320 cls.services["small"],
321 accountid=cls.account.name,
322 domainid=cls.account.domainid,
323 serviceofferingid=cls.small_offering.id,
324 mode=cls.services["mode"]
325 )

Callers

nothing calls this directly

Calls 9

get_domainFunction · 0.90
get_zoneFunction · 0.90
getClsTestClientMethod · 0.80
getApiClientMethod · 0.80
getHypervisorInfoMethod · 0.80
getZoneForTestsMethod · 0.80
createMethod · 0.65

Tested by

no test coverage detected