(cls)
| 61 | |
| 62 | @classmethod |
| 63 | def setUpClass(cls): |
| 64 | testClient = super(TestCreateVolume, cls).getClsTestClient() |
| 65 | cls.apiclient = testClient.getApiClient() |
| 66 | cls.services = testClient.getParsedTestDataConfig() |
| 67 | # Get Zone, Domain and templates |
| 68 | cls.domain = get_domain(cls.apiclient) |
| 69 | cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) |
| 70 | cls._cleanup = [] |
| 71 | cls.hypervisor = testClient.getHypervisorInfo() |
| 72 | cls.services['mode'] = cls.zone.networktype |
| 73 | cls.invalidStoragePoolType = False |
| 74 | # for LXC if the storage pool of type 'rbd' ex: ceph is not available, skip the test |
| 75 | if cls.hypervisor.lower() == 'lxc': |
| 76 | if not find_storage_pool_type(cls.apiclient, storagetype='rbd'): |
| 77 | # RBD storage type is required for data volumes for LXC |
| 78 | cls.invalidStoragePoolType = True |
| 79 | return |
| 80 | cls.disk_offering = DiskOffering.create( |
| 81 | cls.apiclient, |
| 82 | cls.services["disk_offering"] |
| 83 | ) |
| 84 | cls._cleanup.append(cls.disk_offering) |
| 85 | cls.sparse_disk_offering = DiskOffering.create( |
| 86 | cls.apiclient, |
| 87 | cls.services["sparse_disk_offering"] |
| 88 | ) |
| 89 | cls._cleanup.append(cls.sparse_disk_offering) |
| 90 | cls.custom_disk_offering = DiskOffering.create( |
| 91 | cls.apiclient, |
| 92 | cls.services["disk_offering"], |
| 93 | custom=True |
| 94 | ) |
| 95 | cls._cleanup.append(cls.custom_disk_offering) |
| 96 | |
| 97 | template = get_suitable_test_template( |
| 98 | cls.apiclient, |
| 99 | cls.zone.id, |
| 100 | cls.services["ostype"], |
| 101 | cls.hypervisor |
| 102 | ) |
| 103 | if template == FAILED: |
| 104 | assert False, "get_suitable_test_template() failed to return template with description %s" % cls.services["ostype"] |
| 105 | |
| 106 | cls.services["domainid"] = cls.domain.id |
| 107 | cls.services["zoneid"] = cls.zone.id |
| 108 | cls.services["template"] = template.id |
| 109 | cls.services["customdiskofferingid"] = cls.custom_disk_offering.id |
| 110 | cls.services["diskname"] = cls.services["volume"]["diskname"] |
| 111 | # Create VMs, NAT Rules etc |
| 112 | cls.account = Account.create( |
| 113 | cls.apiclient, |
| 114 | cls.services["account"], |
| 115 | domainid=cls.domain.id |
| 116 | ) |
| 117 | cls._cleanup.append(cls.account) |
| 118 | cls.service_offering = ServiceOffering.create( |
| 119 | cls.apiclient, |
| 120 | cls.services["service_offerings"]["tiny"] |
nothing calls this directly
no test coverage detected