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

Method setUpClass

test/integration/smoke/test_snapshots.py:49–106  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

47
48 @classmethod
49 def setUpClass(cls):
50 testClient = super(TestSnapshotRootDisk, cls).getClsTestClient()
51 cls.apiclient = testClient.getApiClient()
52 cls.services = testClient.getParsedTestDataConfig()
53
54 # Get Zone, Domain and templates
55 cls.domain = get_domain(cls.apiclient)
56 cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
57 cls.pod = get_pod(cls.apiclient, cls.zone.id)
58 cls.services['mode'] = cls.zone.networktype
59
60 cls.hypervisorNotSupported = False
61 cls.hypervisor = cls.testClient.getHypervisorInfo()
62 if cls.hypervisor.lower() in ['hyperv', 'lxc'] or 'kvm-centos6' in cls.testClient.getZoneForTests():
63 cls.hypervisorNotSupported = True
64
65 cls._cleanup = []
66 if not cls.hypervisorNotSupported:
67 cls.template = get_test_template(cls.apiclient, cls.zone.id, cls.hypervisor)
68 if cls.template == FAILED:
69 assert False, "get_test_template() failed to return template"
70
71 cls.services["domainid"] = cls.domain.id
72 cls.services["small"]["zoneid"] = cls.zone.id
73 cls.services["templates"]["ostypeid"] = cls.template.ostypeid
74 cls.services["zoneid"] = cls.zone.id
75
76 # Create VMs, NAT Rules etc
77 cls.account = Account.create(
78 cls.apiclient,
79 cls.services["account"],
80 domainid=cls.domain.id
81 )
82 cls.service_offering = ServiceOffering.create(
83 cls.apiclient,
84 cls.services["service_offerings"]["tiny"]
85 )
86 cls.disk_offering = DiskOffering.create(
87 cls.apiclient,
88 cls.services["disk_offering"]
89 )
90 cls.virtual_machine = cls.virtual_machine_with_disk = \
91 VirtualMachine.create(
92 cls.apiclient,
93 cls.services["small"],
94 templateid=cls.template.id,
95 accountid=cls.account.name,
96 domainid=cls.account.domainid,
97 zoneid=cls.zone.id,
98 serviceofferingid=cls.service_offering.id,
99 mode=cls.services["mode"]
100 )
101
102 cls._cleanup.append(cls.virtual_machine_with_disk)
103 cls._cleanup.append(cls.service_offering)
104 cls._cleanup.append(cls.account)
105 cls._cleanup.append(cls.disk_offering)
106 return

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected