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

Method setUpClass

test/integration/smoke/test_list_volumes.py:40–134  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

38
39 @classmethod
40 def setUpClass(cls):
41 testClient = super(TestListVolumes, cls).getClsTestClient()
42 cls.apiclient = testClient.getApiClient()
43 cls.services = testClient.getParsedTestDataConfig()
44 cls.hypervisor = testClient.getHypervisorInfo()
45 cls.domain = get_domain(cls.apiclient)
46 cls.zones = list_zones(cls.apiclient)
47 cls.zone = cls.zones[0]
48 cls.clusters = list_clusters(cls.apiclient)
49 cls.cluster = cls.clusters[0]
50 cls.hosts = list_hosts(cls.apiclient)
51 cls.account = list_accounts(cls.apiclient, name="admin")[0]
52 cls._cleanup = []
53
54 cls.service_offering = ServiceOffering.create(
55 cls.apiclient,
56 cls.services["service_offerings"]["tiny"]
57 )
58 cls._cleanup.append(cls.service_offering)
59
60 template = get_suitable_test_template(
61 cls.apiclient,
62 cls.zone.id,
63 cls.services["ostype"],
64 cls.hypervisor
65 )
66 if template == FAILED:
67 assert False, "get_test_template() failed to return template"
68
69 cls.services["template"]["ostypeid"] = template.ostypeid
70 cls.services["template_2"]["ostypeid"] = template.ostypeid
71 cls.services["ostypeid"] = template.ostypeid
72 cls.services["virtual_machine"]["zoneid"] = cls.zone.id
73 cls.services["mode"] = cls.zone.networktype
74
75 cls.disk_offering = DiskOffering.create(cls.apiclient,
76 cls.services["disk_offering"])
77 cls._cleanup.append(cls.disk_offering)
78
79 # Create VM
80 cls.virtual_machine = VirtualMachine.create(
81 cls.apiclient,
82 cls.services["virtual_machine"],
83 templateid=template.id,
84 accountid=cls.account.name,
85 domainid=cls.account.domainid,
86 clusterid=cls.cluster.id,
87 serviceofferingid=cls.service_offering.id,
88 mode=cls.services["mode"]
89 )
90
91 cls.child_domain = Domain.create(
92 cls.apiclient,
93 cls.services["domain"])
94 cls._cleanup.append(cls.child_domain)
95
96 cls.child_account = Account.create(
97 cls.apiclient,

Callers

nothing calls this directly

Calls 13

get_domainFunction · 0.90
list_zonesFunction · 0.90
list_clustersFunction · 0.90
list_hostsFunction · 0.90
list_accountsFunction · 0.90
getClsTestClientMethod · 0.80
getApiClientMethod · 0.80
getHypervisorInfoMethod · 0.80
createMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected