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

Method setUpClass

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

Source from the content-addressed store, hash-verified

63
64 @classmethod
65 def setUpClass(cls):
66 testClient = super(TestDeployVM, cls).getClsTestClient()
67 cls.apiclient = testClient.getApiClient()
68 cls.services = testClient.getParsedTestDataConfig()
69
70 # Get Zone, Domain and templates
71 cls.domain = get_domain(cls.apiclient)
72 cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
73 cls.services['mode'] = cls.zone.networktype
74 cls.hypervisor = testClient.getHypervisorInfo()
75
76 # If local storage is enabled, alter the offerings to use localstorage
77 # this step is needed for devcloud
78 if cls.zone.localstorageenabled == True:
79 cls.services["service_offerings"]["tiny"]["storagetype"] = 'local'
80 cls.services["service_offerings"]["small"]["storagetype"] = 'local'
81 cls.services["service_offerings"]["medium"]["storagetype"] = 'local'
82
83 template = get_suitable_test_template(
84 cls.apiclient,
85 cls.zone.id,
86 cls.services["ostype"],
87 cls.hypervisor
88 )
89 if template == FAILED:
90 assert False, "get_suitable_test_template() failed to return template with description %s" % cls.services["ostype"]
91
92 # Set Zones and disk offerings
93 cls.services["small"]["zoneid"] = cls.zone.id
94 cls.services["small"]["template"] = template.id
95
96 cls.services["iso1"]["zoneid"] = cls.zone.id
97
98 cls._cleanup = []
99
100 cls.account = Account.create(
101 cls.apiclient,
102 cls.services["account"],
103 domainid=cls.domain.id
104 )
105 cls._cleanup.append(cls.account)
106 cls.debug(cls.account.id)
107
108 cls.service_offering = ServiceOffering.create(
109 cls.apiclient,
110 cls.services["service_offerings"]["tiny"]
111 )
112 cls._cleanup.append(cls.service_offering)
113
114 cls.virtual_machine = VirtualMachine.create(
115 cls.apiclient,
116 cls.services["small"],
117 accountid=cls.account.name,
118 domainid=cls.account.domainid,
119 serviceofferingid=cls.service_offering.id,
120 mode=cls.services['mode']
121 )
122

Callers

nothing calls this directly

Calls 11

get_domainFunction · 0.90
get_zoneFunction · 0.90
getClsTestClientMethod · 0.80
getApiClientMethod · 0.80
getZoneForTestsMethod · 0.80
getHypervisorInfoMethod · 0.80
debugMethod · 0.80
createMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected