(cls)
| 274 | |
| 275 | @classmethod |
| 276 | def setUpClass(cls): |
| 277 | testClient = super(TestVolumes, cls).getClsTestClient() |
| 278 | cls.apiclient = testClient.getApiClient() |
| 279 | cls.services = testClient.getParsedTestDataConfig() |
| 280 | cls._cleanup = [] |
| 281 | # Get Zone, Domain and templates |
| 282 | cls.domain = get_domain(cls.apiclient) |
| 283 | cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) |
| 284 | cls.services['mode'] = cls.zone.networktype |
| 285 | cls.hypervisor = testClient.getHypervisorInfo() |
| 286 | cls.invalidStoragePoolType = False |
| 287 | # for LXC if the storage pool of type 'rbd' ex: ceph is not available, skip the test |
| 288 | if cls.hypervisor.lower() == 'lxc': |
| 289 | if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): |
| 290 | # RBD storage type is required for data volumes for LXC |
| 291 | cls.invalidStoragePoolType = True |
| 292 | return |
| 293 | cls.disk_offering = DiskOffering.create( |
| 294 | cls.apiclient, |
| 295 | cls.services["disk_offering"] |
| 296 | ) |
| 297 | cls._cleanup.append(cls.disk_offering) |
| 298 | cls.resized_disk_offering = DiskOffering.create( |
| 299 | cls.apiclient, |
| 300 | cls.services["resized_disk_offering"] |
| 301 | ) |
| 302 | cls._cleanup.append(cls.resized_disk_offering) |
| 303 | cls.custom_resized_disk_offering = DiskOffering.create( |
| 304 | cls.apiclient, |
| 305 | cls.services["resized_disk_offering"], |
| 306 | custom=True |
| 307 | ) |
| 308 | cls._cleanup.append(cls.custom_resized_disk_offering) |
| 309 | |
| 310 | cls.template = get_suitable_test_template( |
| 311 | cls.apiclient, |
| 312 | cls.zone.id, |
| 313 | cls.services["ostype"], |
| 314 | cls.hypervisor, |
| 315 | deploy_as_is=cls.hypervisor.lower() == "vmware" |
| 316 | ) |
| 317 | if cls.template == FAILED: |
| 318 | assert False, "get_suitable_test_template() failed to return template with description %s" % cls.services["ostype"] |
| 319 | |
| 320 | cls.services["domainid"] = cls.domain.id |
| 321 | cls.services["zoneid"] = cls.zone.id |
| 322 | cls.services["template"] = cls.template.id |
| 323 | cls.services["diskofferingid"] = cls.disk_offering.id |
| 324 | cls.services['resizeddiskofferingid'] = cls.resized_disk_offering.id |
| 325 | cls.services['customresizeddiskofferingid'] = cls.custom_resized_disk_offering.id |
| 326 | |
| 327 | # Create VMs, VMs etc |
| 328 | cls.account = Account.create( |
| 329 | cls.apiclient, |
| 330 | cls.services["account"], |
| 331 | domainid=cls.domain.id |
| 332 | ) |
| 333 | cls._cleanup.append(cls.account) |
nothing calls this directly
no test coverage detected