(cls)
| 44 | |
| 45 | @classmethod |
| 46 | def setUpClass(cls): |
| 47 | testClient = super(TestScaleVm, cls).getClsTestClient() |
| 48 | cls.apiclient = testClient.getApiClient() |
| 49 | cls.services = testClient.getParsedTestDataConfig() |
| 50 | cls.hostConfig = cls.config.__dict__["zones"][0].__dict__["pods"][0].__dict__["clusters"][0].__dict__["hosts"][ |
| 51 | 0].__dict__ |
| 52 | cls._cleanup = [] |
| 53 | cls.unsupportedHypervisor = False |
| 54 | cls.hypervisor = cls.testClient.getHypervisorInfo() |
| 55 | if cls.hypervisor.lower() in ('kvm', 'hyperv', 'lxc'): |
| 56 | cls.unsupportedHypervisor = True |
| 57 | return |
| 58 | |
| 59 | # Get Zone, Domain and templates |
| 60 | cls.domain = get_domain(cls.apiclient) |
| 61 | cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) |
| 62 | cls.services['mode'] = cls.zone.networktype |
| 63 | |
| 64 | if cls.hypervisor.lower() in ['simulator', 'vmware']: |
| 65 | cls.template = get_template( |
| 66 | cls.apiclient, |
| 67 | cls.zone.id, |
| 68 | cls.services["ostype"] |
| 69 | ) |
| 70 | if cls.template == FAILED: |
| 71 | assert False, "get_template() failed to return template\ |
| 72 | with description %s" % cls.services["ostype"] |
| 73 | cls.template = Template.update( |
| 74 | cls.template, |
| 75 | cls.apiclient, |
| 76 | isdynamicallyscalable='true' |
| 77 | ) |
| 78 | else: |
| 79 | cls.template = get_test_template( |
| 80 | cls.apiclient, |
| 81 | cls.zone.id, |
| 82 | cls.hypervisor |
| 83 | ) |
| 84 | if cls.template == FAILED: |
| 85 | assert False, "get_test_template() failed to return template\ |
| 86 | with hypervisor %s" % cls.hypervisor |
| 87 | cls.template = Template.update( |
| 88 | cls.template, |
| 89 | cls.apiclient, |
| 90 | isdynamicallyscalable='true' |
| 91 | ) |
| 92 | |
| 93 | # Set Zones and disk offerings |
| 94 | cls.services["small"]["zoneid"] = cls.zone.id |
| 95 | cls.services["small"]["template"] = cls.template.id |
| 96 | |
| 97 | # Create account, service offerings, vm. |
| 98 | cls.account = Account.create( |
| 99 | cls.apiclient, |
| 100 | cls.services["account"], |
| 101 | domainid=cls.domain.id |
| 102 | ) |
| 103 | cls._cleanup.append(cls.account) |
nothing calls this directly
no test coverage detected