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

Method setUpClass

test/integration/smoke/test_volumes.py:1101–1176  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

1099
1100 @classmethod
1101 def setUpClass(cls):
1102 cls.testClient = super(TestVolumeEncryption, cls).getClsTestClient()
1103 cls.apiclient = cls.testClient.getApiClient()
1104 cls.services = cls.testClient.getParsedTestDataConfig()
1105 cls._cleanup = []
1106
1107 cls.unsupportedHypervisor = False
1108 cls.hypervisor = cls.testClient.getHypervisorInfo()
1109 if cls.hypervisor.lower() not in ['kvm']:
1110 # Volume Encryption currently supported for KVM hypervisor
1111 cls.unsupportedHypervisor = True
1112 return
1113
1114 # Get Zone and Domain
1115 cls.domain = get_domain(cls.apiclient)
1116 cls.zone = get_zone(cls.apiclient, cls.testClient.getZoneForTests())
1117
1118 cls.services['mode'] = cls.zone.networktype
1119 cls.services["virtual_machine"]["zoneid"] = cls.zone.id
1120 cls.services["domainid"] = cls.domain.id
1121 cls.services["zoneid"] = cls.zone.id
1122
1123 # Get template
1124 template = get_suitable_test_template(
1125 cls.apiclient,
1126 cls.zone.id,
1127 cls.services["ostype"],
1128 cls.hypervisor
1129 )
1130 if template == FAILED:
1131 assert False, "get_suitable_test_template() failed to return template with description %s" % cls.services["ostype"]
1132
1133 cls.services["template"] = template.id
1134 cls.services["diskname"] = cls.services["volume"]["diskname"]
1135
1136 cls.hostConfig = cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][0].__dict__
1137
1138 # Create Account
1139 cls.account = Account.create(
1140 cls.apiclient,
1141 cls.services["account"],
1142 domainid=cls.domain.id
1143 )
1144 cls._cleanup.append(cls.account)
1145
1146 # Create Service Offering
1147 cls.service_offering = ServiceOffering.create(
1148 cls.apiclient,
1149 cls.services["service_offerings"]["small"]
1150 )
1151 cls._cleanup.append(cls.service_offering)
1152
1153 # Create Service Offering with encryptRoot true
1154 cls.service_offering_encrypt = ServiceOffering.create(
1155 cls.apiclient,
1156 cls.services["service_offerings"]["small"],
1157 name="Small Encrypted Instance",
1158 encryptroot=True

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected