diff --git a/CHANGELOG.rst b/CHANGELOG.rst index af550898..9ad56c0d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -41,6 +41,11 @@ Fixed `Launchpad-bug #1881456 `_ +Removed +~~~~~~~ + +* Remove deprecated api version 1 for designate + [2.0.0] - 2020-05-08 -------------------- diff --git a/rally-jobs/designate.yaml b/rally-jobs/designate.yaml index f8e16e9f..f0b8b9e1 100644 --- a/rally-jobs/designate.yaml +++ b/rally-jobs/designate.yaml @@ -4,143 +4,6 @@ description: > This task contains various scenarios for testing designate plugins subtasks: - - - title: DesignateBasic.create_and_delete_domain tests - scenario: - DesignateBasic.create_and_delete_domain: {} - runner: - constant: - times: 4 - concurrency: 2 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - - - title: DesignateBasic.create_and_update_domain tests - scenario: - DesignateBasic.create_and_update_domain: {} - runner: - constant: - times: 4 - concurrency: 2 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - - - title: DesignateBasic.create_and_delete_records tests - scenario: - DesignateBasic.create_and_delete_records: - records_per_domain: 5 - runner: - constant: - times: 4 - concurrency: 2 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - - - title: DesignateBasic.create_and_list_domains tests - scenario: - DesignateBasic.create_and_list_domains: {} - runner: - constant: - times: 4 - concurrency: 2 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - - - title: DesignateBasic.create_and_list_records tests - scenario: - DesignateBasic.create_and_list_records: - records_per_domain: 5 - runner: - constant: - times: 4 - concurrency: 2 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - - - title: DesignateBasic.list_domains tests - scenario: - DesignateBasic.list_domains: {} - runner: - constant: - times: 3 - concurrency: 2 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - - - title: DesignateBasic.create_and_list_servers tests - scenario: - DesignateBasic.create_and_list_servers: {} - runner: - constant: - times: 4 - concurrency: 1 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - - - title: DesignateBasic.create_and_delete_server tests - scenario: - DesignateBasic.create_and_delete_server: {} - runner: - constant: - times: 4 - concurrency: 1 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - - - title: DesignateBasic.list_servers tests - scenario: - DesignateBasic.list_servers: {} - runner: - constant: - times: 4 - concurrency: 2 - contexts: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 100 - title: DesignateBasic.create_and_list_zones tests scenario: diff --git a/rally_openstack/common/osclients.py b/rally_openstack/common/osclients.py index e218c650..c3d83664 100644 --- a/rally_openstack/common/osclients.py +++ b/rally_openstack/common/osclients.py @@ -678,7 +678,7 @@ class Murano(OSClient): @configure("designate", default_version="2", default_service_type="dns", - supported_versions=["1", "2"]) + supported_versions=["2"]) class Designate(OSClient): """Wrapper for DesignateClient which returns authenticated native client. @@ -694,11 +694,8 @@ class Designate(OSClient): api_url += "/v%s" % version session = self.keystone.get_session()[0] - if version == "2": - return client.Client(version, session=session, - endpoint_override=api_url) return client.Client(version, session=session, - endpoint=api_url) + endpoint_override=api_url) @configure("trove", default_version="1.0", supported_versions=["1.0"], diff --git a/rally_openstack/task/contexts/quotas/designate_quotas.py b/rally_openstack/task/contexts/quotas/designate_quotas.py index b2c647d9..52f3ca30 100644 --- a/rally_openstack/task/contexts/quotas/designate_quotas.py +++ b/rally_openstack/task/contexts/quotas/designate_quotas.py @@ -20,15 +20,19 @@ class DesignateQuotas(object): "type": "object", "additionalProperties": False, "properties": { - "domains": { + "api_export_size": { "type": "integer", "minimum": 1 }, - "domain_recordsets": { + "zones": { "type": "integer", "minimum": 1 }, - "domain_records": { + "zones_recordsets": { + "type": "integer", + "minimum": 1 + }, + "zones_records": { "type": "integer", "minimum": 1 }, diff --git a/rally_openstack/task/scenarios/designate/basic.py b/rally_openstack/task/scenarios/designate/basic.py index 0a07c960..33092ba7 100644 --- a/rally_openstack/task/scenarios/designate/basic.py +++ b/rally_openstack/task/scenarios/designate/basic.py @@ -26,223 +26,6 @@ from rally_openstack.task.scenarios.designate import utils """Basic scenarios for Designate.""" -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", users=True) -@scenario.configure(context={"cleanup@openstack": ["designate"]}, - name="DesignateBasic.create_and_list_domains", - platform="openstack") -class CreateAndListDomains(utils.DesignateScenario): - - def run(self): - """Create a domain and list all domains. - - Measure the "designate domain-list" command performance. - - If you have only 1 user in your context, you will - add 1 domain on every iteration. So you will have more - and more domain and will be able to measure the - performance of the "designate domain-list" command depending on - the number of domains owned by users. - """ - domain = self._create_domain() - msg = "Domain isn't created" - self.assertTrue(domain, msg) - list_domains = self._list_domains() - self.assertIn(domain, list_domains) - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", users=True) -@scenario.configure(name="DesignateBasic.list_domains", - platform="openstack") -class ListDomains(utils.DesignateScenario): - - def run(self): - """List Designate domains. - - This simple scenario tests the designate domain-list command by listing - all the domains. - - Suppose if we have 2 users in context and each has 2 domains - uploaded for them we will be able to test the performance of - designate domain-list command in this case. - """ - self._list_domains() - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", users=True) -@scenario.configure(context={"cleanup@openstack": ["designate"]}, - name="DesignateBasic.create_and_delete_domain", - platform="openstack") -class CreateAndDeleteDomain(utils.DesignateScenario): - - def run(self): - """Create and then delete a domain. - - Measure the performance of creating and deleting domains - with different level of load. - """ - domain = self._create_domain() - self._delete_domain(domain["id"]) - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", users=True) -@scenario.configure(context={"cleanup@openstack": ["designate"]}, - name="DesignateBasic.create_and_update_domain", - platform="openstack") -class CreateAndUpdateDomain(utils.DesignateScenario): - - def run(self): - """Create and then update a domain. - - Measure the performance of creating and updating domains - with different level of load. - """ - domain = self._create_domain() - self._update_domain(domain) - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", users=True) -@scenario.configure(context={"cleanup@openstack": ["designate"]}, - name="DesignateBasic.create_and_delete_records", - platform="openstack") -class CreateAndDeleteRecords(utils.DesignateScenario): - - def run(self, records_per_domain=5): - """Create and then delete records. - - Measure the performance of creating and deleting records - with different level of load. - - :param records_per_domain: Records to create pr domain. - """ - domain = self._create_domain() - - records = [] - - for i in range(records_per_domain): - record = self._create_record(domain) - records.append(record) - - for record in records: - self._delete_record( - domain["id"], record["id"]) - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", users=True) -@scenario.configure(name="DesignateBasic.list_records", - platform="openstack") -class ListRecords(utils.DesignateScenario): - - def run(self, domain_id): - """List Designate records. - - This simple scenario tests the designate record-list command by listing - all the records in a domain. - - Suppose if we have 2 users in context and each has 2 domains - uploaded for them we will be able to test the performance of - designate record-list command in this case. - - :param domain_id: Domain ID - """ - - self._list_records(domain_id) - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", users=True) -@scenario.configure(context={"cleanup@openstack": ["designate"]}, - name="DesignateBasic.create_and_list_records", - platform="openstack") -class CreateAndListRecords(utils.DesignateScenario): - - def run(self, records_per_domain=5): - """Create and then list records. - - If you have only 1 user in your context, you will - add 1 record on every iteration. So you will have more - and more records and will be able to measure the - performance of the "designate record-list" command depending on - the number of domains/records owned by users. - - :param records_per_domain: Records to create pr domain. - """ - domain = self._create_domain() - for i in range(records_per_domain): - self._create_record(domain) - - self._list_records(domain["id"]) - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", admin=True) -@scenario.configure(context={"admin_cleanup@openstack": ["designate"]}, - name="DesignateBasic.create_and_list_servers", - platform="openstack") -class CreateAndListServers(utils.DesignateScenario): - - def run(self): - """Create a Designate server and list all servers. - - If you have only 1 user in your context, you will - add 1 server on every iteration. So you will have more - and more server and will be able to measure the - performance of the "designate server-list" command depending on - the number of servers owned by users. - """ - server = self._create_server() - self.assertTrue(server) - list_servers = self._list_servers() - self.assertIn(server, list_servers) - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", admin=True) -@scenario.configure(context={"admin_cleanup@openstack": ["designate"]}, - name="DesignateBasic.create_and_delete_server", - platform="openstack") -class CreateAndDeleteServer(utils.DesignateScenario): - - def run(self): - """Create and then delete a server. - - Measure the performance of creating and deleting servers - with different level of load. - """ - server = self._create_server() - self._delete_server(server["id"]) - - -@validation.add("required_services", - services=[consts.Service.DESIGNATE]) -@validation.add("required_platform", platform="openstack", admin=True) -@scenario.configure(name="DesignateBasic.list_servers", platform="openstack") -class ListServers(utils.DesignateScenario): - - def run(self): - """List Designate servers. - - This simple scenario tests the designate server-list command by listing - all the servers. - """ - self._list_servers() - - -# NOTE: API V2 @validation.add("required_services", services=[consts.Service.DESIGNATE]) @validation.add("required_platform", platform="openstack", users=True) diff --git a/rally_openstack/task/scenarios/designate/utils.py b/rally_openstack/task/scenarios/designate/utils.py index 3ba05eff..4abf604e 100644 --- a/rally_openstack/task/scenarios/designate/utils.py +++ b/rally_openstack/task/scenarios/designate/utils.py @@ -26,103 +26,6 @@ class DesignateScenario(scenario.OpenStackScenario): # which are used in default autogenerated names RESOURCE_NAME_FORMAT = "s-rally-XXXXXXXX-XXXXXXXX" - @atomic.action_timer("designate.create_domain") - def _create_domain(self, domain=None): - """Create domain. - - :param domain: dict, POST /v1/domains request options - :returns: designate domain dict - """ - domain = domain or {} - - domain.setdefault("email", "root@random.name") - domain["name"] = "%s.name." % self.generate_random_name() - return self.clients("designate").domains.create(domain) - - @atomic.action_timer("designate.list_domains") - def _list_domains(self): - """Return user domain list.""" - return self.clients("designate").domains.list() - - @atomic.action_timer("designate.delete_domain") - def _delete_domain(self, domain_id): - """Delete designate zone. - - :param domain_id: domain ID - """ - self.clients("designate").domains.delete(domain_id) - - @atomic.action_timer("designate.update_domain") - def _update_domain(self, domain): - """Update designate domain. - - :param domain: designate domain - :returns: designate updated domain dict - """ - domain["description"] = "updated domain" - domain["email"] = "updated@random.name" - return self.clients("designate").domains.update(domain) - - @atomic.action_timer("designate.create_record") - def _create_record(self, domain, record=None): - """Create a record in a domain. - - :param domain: domain dict - :param record: record dict - :returns: Designate record dict - """ - record = record or {} - record.setdefault("type", "A") - record["name"] = "%s.%s" % (self.generate_random_name(), - domain["name"]) - record.setdefault("data", "10.0.0.1") - - return self.clients("designate").records.create(domain["id"], record) - - @atomic.action_timer("designate.list_records") - def _list_records(self, domain_id): - """List domain records. - - :param domain_id: domain ID - :returns: domain records list - """ - return self.clients("designate").records.list(domain_id) - - @atomic.action_timer("designate.delete_record") - def _delete_record(self, domain_id, record_id): - """Delete a domain record. - - :param domain_id: domain ID - :param record_id: record ID - """ - self.clients("designate").records.delete(domain_id, record_id) - - @atomic.action_timer("designate.create_server") - def _create_server(self, server=None): - """Create server. - - :param server: dict, POST /v1/servers request options - :returns: designate server dict - """ - server = server or {} - - server["name"] = "%s.name." % self.generate_random_name() - return self.admin_clients("designate").servers.create(server) - - @atomic.action_timer("designate.list_servers") - def _list_servers(self): - """Return user server list.""" - return self.admin_clients("designate").servers.list() - - @atomic.action_timer("designate.delete_server") - def _delete_server(self, server_id): - """Delete Server. - - :param server_id: unicode server ID - """ - self.admin_clients("designate").servers.delete(server_id) - - # NOTE: API V2 @atomic.action_timer("designate.create_zone") def _create_zone(self, name=None, type_=None, email=None, description=None, ttl=None): diff --git a/samples/tasks/scenarios/designate/create-and-delete-domain.json b/samples/tasks/scenarios/designate/create-and-delete-domain.json deleted file mode 100644 index ac3bb2cf..00000000 --- a/samples/tasks/scenarios/designate/create-and-delete-domain.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DesignateBasic.create_and_delete_domain": [ - { - "runner": { - "type": "constant", - "times": 10, - "concurrency": 10 - }, - "context": { - "quotas": { - "designate": { - "domains": 100, - "domain_recordsets": 500, - "domain_records": 2000, - "recordset_records": 2000 - } - }, - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/create-and-delete-domain.yaml b/samples/tasks/scenarios/designate/create-and-delete-domain.yaml deleted file mode 100644 index d30e9ac6..00000000 --- a/samples/tasks/scenarios/designate/create-and-delete-domain.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- - DesignateBasic.create_and_delete_domain: - - - runner: - type: "constant" - times: 10 - concurrency: 10 - context: - quotas: - designate: - domains: 100 - domain_recordsets: 500 - domain_records: 2000 - recordset_records: 2000 - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/create-and-delete-records.json b/samples/tasks/scenarios/designate/create-and-delete-records.json deleted file mode 100644 index 91839a39..00000000 --- a/samples/tasks/scenarios/designate/create-and-delete-records.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "DesignateBasic.create_and_delete_records": [ - { - "args": { - "records_per_domain": 10 - }, - "runner": { - "type": "constant", - "times": 10, - "concurrency": 10 - }, - "context": { - "quotas": { - "designate": { - "domains": 100, - "domain_recordsets": 2000, - "domain_records": 2000, - "recordset_records": 2000 - } - }, - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/create-and-delete-records.yaml b/samples/tasks/scenarios/designate/create-and-delete-records.yaml deleted file mode 100644 index c6b09877..00000000 --- a/samples/tasks/scenarios/designate/create-and-delete-records.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- - DesignateBasic.create_and_delete_records: - - - args: - records_per_domain: 10 - runner: - type: "constant" - times: 10 - concurrency: 10 - context: - quotas: - designate: - domains: 100 - domain_recordsets: 2000 - domain_records: 2000 - recordset_records: 2000 - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/create-and-delete-recordsets.json b/samples/tasks/scenarios/designate/create-and-delete-recordsets.json index 7adc241a..ff07f567 100644 --- a/samples/tasks/scenarios/designate/create-and-delete-recordsets.json +++ b/samples/tasks/scenarios/designate/create-and-delete-recordsets.json @@ -12,9 +12,9 @@ "context": { "quotas": { "designate": { - "domains": 100, - "domain_recordsets": 2000, - "domain_records": 2000, + "zones": 100, + "zones_recordsets": 2000, + "zones_records": 2000, "recordset_records": 2000 } }, diff --git a/samples/tasks/scenarios/designate/create-and-delete-recordsets.yaml b/samples/tasks/scenarios/designate/create-and-delete-recordsets.yaml index 05115b2c..c60ec298 100644 --- a/samples/tasks/scenarios/designate/create-and-delete-recordsets.yaml +++ b/samples/tasks/scenarios/designate/create-and-delete-recordsets.yaml @@ -10,9 +10,9 @@ context: quotas: designate: - domains: 100 - domain_recordsets: 2000 - domain_records: 2000 + zones: 100 + zones_recordsets: 2000 + zones_records: 2000 recordset_records: 2000 users: tenants: 2 diff --git a/samples/tasks/scenarios/designate/create-and-delete-server.json b/samples/tasks/scenarios/designate/create-and-delete-server.json deleted file mode 100644 index 08fad7fe..00000000 --- a/samples/tasks/scenarios/designate/create-and-delete-server.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "DesignateBasic.create_and_delete_server": [ - { - "runner": { - "type": "constant", - "times": 10, - "concurrency": 1 - }, - "context": { - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/create-and-delete-server.yaml b/samples/tasks/scenarios/designate/create-and-delete-server.yaml deleted file mode 100644 index 9214d5cb..00000000 --- a/samples/tasks/scenarios/designate/create-and-delete-server.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- - DesignateBasic.create_and_delete_server: - - - runner: - type: "constant" - times: 10 - concurrency: 1 - context: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/create-and-delete-zone.json b/samples/tasks/scenarios/designate/create-and-delete-zone.json index f6b94375..e598711d 100644 --- a/samples/tasks/scenarios/designate/create-and-delete-zone.json +++ b/samples/tasks/scenarios/designate/create-and-delete-zone.json @@ -9,9 +9,9 @@ "context": { "quotas": { "designate": { - "domains": 100, - "domain_recordsets": 500, - "domain_records": 2000, + "zones": 100, + "zones_recordsets": 500, + "zones_records": 2000, "recordset_records": 2000 } }, diff --git a/samples/tasks/scenarios/designate/create-and-delete-zone.yaml b/samples/tasks/scenarios/designate/create-and-delete-zone.yaml index a2c7b240..59200d28 100644 --- a/samples/tasks/scenarios/designate/create-and-delete-zone.yaml +++ b/samples/tasks/scenarios/designate/create-and-delete-zone.yaml @@ -8,9 +8,9 @@ context: quotas: designate: - domains: 100 - domain_recordsets: 500 - domain_records: 2000 + zones: 100 + zones_recordsets: 500 + zones_records: 2000 recordset_records: 2000 users: tenants: 2 diff --git a/samples/tasks/scenarios/designate/create-and-list-domain.json b/samples/tasks/scenarios/designate/create-and-list-domain.json deleted file mode 100644 index 792538b6..00000000 --- a/samples/tasks/scenarios/designate/create-and-list-domain.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DesignateBasic.create_and_list_domains": [ - { - "runner": { - "type": "constant", - "times": 10, - "concurrency": 10 - }, - "context": { - "quotas": { - "designate": { - "domains": 100, - "domain_recordsets": 500, - "domain_records": 2000, - "recordset_records": 2000 - } - }, - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/create-and-list-domain.yaml b/samples/tasks/scenarios/designate/create-and-list-domain.yaml deleted file mode 100644 index 89caec54..00000000 --- a/samples/tasks/scenarios/designate/create-and-list-domain.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- - DesignateBasic.create_and_list_domains: - - - runner: - type: "constant" - times: 10 - concurrency: 10 - context: - quotas: - designate: - domains: 100 - domain_recordsets: 500 - domain_records: 2000 - recordset_records: 2000 - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/create-and-list-records.json b/samples/tasks/scenarios/designate/create-and-list-records.json deleted file mode 100644 index a6d98105..00000000 --- a/samples/tasks/scenarios/designate/create-and-list-records.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "DesignateBasic.create_and_list_records": [ - { - "args": { - "records_per_domain": 10 - }, - "runner": { - "type": "constant", - "times": 10, - "concurrency": 10 - }, - "context": { - "quotas": { - "designate": { - "domains": 100, - "domain_recordsets": 2000, - "domain_records": 2000, - "recordset_records": 2000 - } - }, - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/create-and-list-records.yaml b/samples/tasks/scenarios/designate/create-and-list-records.yaml deleted file mode 100644 index d24da341..00000000 --- a/samples/tasks/scenarios/designate/create-and-list-records.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- - DesignateBasic.create_and_list_records: - - - args: - records_per_domain: 10 - runner: - type: "constant" - times: 10 - concurrency: 10 - context: - quotas: - designate: - domains: 100 - domain_recordsets: 2000 - domain_records: 2000 - recordset_records: 2000 - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/create-and-list-recordsets.json b/samples/tasks/scenarios/designate/create-and-list-recordsets.json index 7bafa102..e420b42f 100644 --- a/samples/tasks/scenarios/designate/create-and-list-recordsets.json +++ b/samples/tasks/scenarios/designate/create-and-list-recordsets.json @@ -12,9 +12,9 @@ "context": { "quotas": { "designate": { - "domains": 100, - "domain_recordsets": 2000, - "domain_records": 2000, + "zones": 100, + "zones_recordsets": 2000, + "zones_records": 2000, "recordset_records": 2000 } }, diff --git a/samples/tasks/scenarios/designate/create-and-list-recordsets.yaml b/samples/tasks/scenarios/designate/create-and-list-recordsets.yaml index 8396f97c..4301f92e 100644 --- a/samples/tasks/scenarios/designate/create-and-list-recordsets.yaml +++ b/samples/tasks/scenarios/designate/create-and-list-recordsets.yaml @@ -10,9 +10,9 @@ context: quotas: designate: - domains: 100 - domain_recordsets: 2000 - domain_records: 2000 + zones: 100 + zones_recordsets: 2000 + zones_records: 2000 recordset_records: 2000 users: tenants: 2 diff --git a/samples/tasks/scenarios/designate/create-and-list-servers.json b/samples/tasks/scenarios/designate/create-and-list-servers.json deleted file mode 100644 index 6b1bbfb6..00000000 --- a/samples/tasks/scenarios/designate/create-and-list-servers.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "DesignateBasic.create_and_list_servers": [ - { - "runner": { - "type": "constant", - "times": 10, - "concurrency": 1 - }, - "context": { - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/create-and-list-servers.yaml b/samples/tasks/scenarios/designate/create-and-list-servers.yaml deleted file mode 100644 index 5ac183e7..00000000 --- a/samples/tasks/scenarios/designate/create-and-list-servers.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- - DesignateBasic.create_and_list_servers: - - - runner: - type: "constant" - times: 10 - concurrency: 1 - context: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/create-and-list-zones.json b/samples/tasks/scenarios/designate/create-and-list-zones.json index 42b06ec9..eba90bda 100644 --- a/samples/tasks/scenarios/designate/create-and-list-zones.json +++ b/samples/tasks/scenarios/designate/create-and-list-zones.json @@ -9,9 +9,9 @@ "context": { "quotas": { "designate": { - "domains": 100, - "domain_recordsets": 500, - "domain_records": 2000, + "zones": 100, + "zones_recordsets": 500, + "zones_records": 2000, "recordset_records": 2000 } }, diff --git a/samples/tasks/scenarios/designate/create-and-list-zones.yaml b/samples/tasks/scenarios/designate/create-and-list-zones.yaml index 20a34be1..8f052365 100644 --- a/samples/tasks/scenarios/designate/create-and-list-zones.yaml +++ b/samples/tasks/scenarios/designate/create-and-list-zones.yaml @@ -8,9 +8,9 @@ context: quotas: designate: - domains: 100 - domain_recordsets: 500 - domain_records: 2000 + zones: 100 + zones_recordsets: 500 + zones_records: 2000 recordset_records: 2000 users: tenants: 2 diff --git a/samples/tasks/scenarios/designate/create-and-update-domain.json b/samples/tasks/scenarios/designate/create-and-update-domain.json deleted file mode 100644 index 336c3bfd..00000000 --- a/samples/tasks/scenarios/designate/create-and-update-domain.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DesignateBasic.create_and_update_domain": [ - { - "runner": { - "type": "constant", - "times": 10, - "concurrency": 10 - }, - "context": { - "quotas": { - "designate": { - "domains": 100, - "domain_recordsets": 500, - "domain_records": 2000, - "recordset_records": 2000 - } - }, - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/create-and-update-domain.yaml b/samples/tasks/scenarios/designate/create-and-update-domain.yaml deleted file mode 100644 index 8a94ff00..00000000 --- a/samples/tasks/scenarios/designate/create-and-update-domain.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- - DesignateBasic.create_and_update_domain: - - - runner: - type: "constant" - times: 10 - concurrency: 10 - context: - quotas: - designate: - domains: 100 - domain_recordsets: 500 - domain_records: 2000 - recordset_records: 2000 - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/list-domains.json b/samples/tasks/scenarios/designate/list-domains.json deleted file mode 100644 index f578f864..00000000 --- a/samples/tasks/scenarios/designate/list-domains.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "DesignateBasic.list_domains": [ - { - "runner": { - "type": "constant", - "times": 3, - "concurrency": 2 - }, - "context": { - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/list-domains.yaml b/samples/tasks/scenarios/designate/list-domains.yaml deleted file mode 100644 index 0047ca0a..00000000 --- a/samples/tasks/scenarios/designate/list-domains.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- - DesignateBasic.list_domains: - - - runner: - type: "constant" - times: 3 - concurrency: 2 - context: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/list-records.json b/samples/tasks/scenarios/designate/list-records.json deleted file mode 100644 index d4f0206b..00000000 --- a/samples/tasks/scenarios/designate/list-records.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "DesignateBasic.list_records": [ - { - "args": { - "domain_id": "" - }, - "runner": { - "type": "constant", - "times": 3, - "concurrency": 2 - }, - "context": { - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/list-records.yaml b/samples/tasks/scenarios/designate/list-records.yaml deleted file mode 100644 index c256a21c..00000000 --- a/samples/tasks/scenarios/designate/list-records.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- - DesignateBasic.list_records: - - - args: - domain_id: - runner: - type: "constant" - times: 3 - concurrency: 2 - context: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/samples/tasks/scenarios/designate/list-servers.json b/samples/tasks/scenarios/designate/list-servers.json deleted file mode 100644 index 008cc2a5..00000000 --- a/samples/tasks/scenarios/designate/list-servers.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "DesignateBasic.list_servers": [ - { - "runner": { - "type": "constant", - "times": 3, - "concurrency": 2 - }, - "context": { - "users": { - "tenants": 2, - "users_per_tenant": 2 - } - }, - "sla": { - "failure_rate": { - "max": 0 - } - } - } - ] -} diff --git a/samples/tasks/scenarios/designate/list-servers.yaml b/samples/tasks/scenarios/designate/list-servers.yaml deleted file mode 100644 index 0addbdad..00000000 --- a/samples/tasks/scenarios/designate/list-servers.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- - DesignateBasic.list_servers: - - - runner: - type: "constant" - times: 3 - concurrency: 2 - context: - users: - tenants: 2 - users_per_tenant: 2 - sla: - failure_rate: - max: 0 diff --git a/tests/unit/common/test_osclients.py b/tests/unit/common/test_osclients.py index f0a51263..bf426086 100644 --- a/tests/unit/common/test_osclients.py +++ b/tests/unit/common/test_osclients.py @@ -911,7 +911,6 @@ class OSClientsTestCase(test.TestCase): @ddt.data( {}, {"version": "2"}, - {"version": "1"}, {"version": None} ) @ddt.unpack @@ -944,16 +943,10 @@ class OSClientsTestCase(test.TestCase): mock_keystone_get_session.assert_called_once_with() - if version == "2": - mock_designate.client.Client.assert_called_once_with( - version, - endpoint_override=url.__iadd__.return_value, - session="fake_session") - elif version == "1": - mock_designate.client.Client.assert_called_once_with( - version, - endpoint=url.__iadd__.return_value, - session="fake_session") + mock_designate.client.Client.assert_called_once_with( + default, + endpoint_override=url.__iadd__.return_value, + session="fake_session") key = "designate" if version is not None: diff --git a/tests/unit/task/contexts/quotas/test_designate_quotas.py b/tests/unit/task/contexts/quotas/test_designate_quotas.py index 25bf5572..481577eb 100644 --- a/tests/unit/task/contexts/quotas/test_designate_quotas.py +++ b/tests/unit/task/contexts/quotas/test_designate_quotas.py @@ -25,9 +25,10 @@ class DesignateQuotasTestCase(test.TestCase): quotas = designate_quotas.DesignateQuotas(clients) tenant_id = mock.MagicMock() quotas_values = { - "domains": 5, - "domain_recordsets": 20, - "domain_records": 20, + "api_export_size": 5, + "zones": 5, + "zones_recordsets": 20, + "zones_records": 20, "recordset_records": 20, } quotas.update(tenant_id, **quotas_values) @@ -43,7 +44,8 @@ class DesignateQuotasTestCase(test.TestCase): def test_get(self): tenant_id = "tenant_id" - quotas = {"domains": -1, "domain_recordsets": 2, "domain_records": 3, + quotas = {"api_export_size": -1, "zones": -1, + "zones_recordsets": 2, "zones_records": 3, "recordset_records": 3} clients = mock.MagicMock() clients.designate.return_value.quotas.get.return_value = quotas diff --git a/tests/unit/task/scenarios/designate/test_basic.py b/tests/unit/task/scenarios/designate/test_basic.py index 4c6bb13f..9c24378e 100644 --- a/tests/unit/task/scenarios/designate/test_basic.py +++ b/tests/unit/task/scenarios/designate/test_basic.py @@ -25,171 +25,6 @@ BASE = "rally_openstack.task.scenarios.designate.basic" class DesignateBasicTestCase(test.ScenarioTestCase): - @mock.patch("%s.CreateAndListDomains._list_domains" % BASE) - @mock.patch("%s.CreateAndListDomains._create_domain" % BASE) - def test_create_and_list_domains(self, - mock__create_domain, - mock__list_domains): - mock__create_domain.return_value = "fake_domain.xyz" - mock__list_domains.return_value = (["fake_domain.org", - "fake_domain.xyz", - "ultimate_question.net"]) - basic.CreateAndListDomains(self.context).run() - mock__create_domain.assert_called_once_with() - mock__list_domains.assert_called_once_with() - - @mock.patch("%s.CreateAndListDomains._list_domains" % BASE) - @mock.patch("%s.CreateAndListDomains._create_domain" % BASE) - def test_create_and_list_domains_fails(self, - mock__create_domain, - mock__list_domains): - mock__list_domains.return_value = (["fake_domain.org", - "fake_domain.xyz", - "ultimate_question.net"]) - scenario = basic.CreateAndListDomains(self.context) - self.assertRaises(exceptions.RallyAssertionError, scenario.run) - mock__create_domain.assert_called_once_with() - - mock__create_domain.return_value = "fake_not_existed_domain.xyz" - self.assertRaises(exceptions.RallyAssertionError, scenario.run) - mock__create_domain.assert_called_with() - mock__list_domains.assert_called_with() - - @mock.patch("%s.CreateAndDeleteDomain._delete_domain" % BASE) - @mock.patch("%s.CreateAndDeleteDomain._create_domain" % BASE, - return_value={"id": "123"}) - def test_create_and_delete_domain(self, - mock__create_domain, - mock__delete_domain): - - basic.CreateAndDeleteDomain(self.context).run() - - mock__create_domain.assert_called_once_with() - mock__delete_domain.assert_called_once_with("123") - - @mock.patch("%s.CreateAndUpdateDomain._update_domain" % BASE) - @mock.patch("%s.CreateAndUpdateDomain._create_domain" % BASE) - def test_create_and_update_domain(self, - mock__create_domain, - mock__update_domain): - domain = { - "name": "zone.name", - "email": "email@zone.name", - "id": "123"} - mock__create_domain.return_value = domain - basic.CreateAndUpdateDomain(self.context).run() - mock__update_domain.assert_called_once_with(domain) - - @mock.patch("%s.ListDomains._list_domains" % BASE) - def test_list_domains(self, mock__list_domains): - basic.ListDomains(self.context).run() - mock__list_domains.assert_called_once_with() - - @mock.patch("%s.CreateAndListRecords._list_records" % BASE) - @mock.patch("%s.CreateAndListRecords._create_record" % BASE) - @mock.patch("%s.CreateAndListRecords._create_domain" % BASE) - def test_create_and_list_records(self, - mock__create_domain, - mock__create_record, - mock__list_records): - domain = { - "name": "zone.name", - "email": "email@zone.name", - "id": "123"} - mock__create_domain.return_value = domain - records_per_domain = 5 - return_value = mock.call(domain) - mock__create_record.return_value = return_value - mock__list_records.return_value = [return_value] * records_per_domain - - basic.CreateAndListRecords(self.context).run( - records_per_domain=records_per_domain) - mock__create_domain.assert_called_once_with() - - self.assertEqual(mock__create_record.mock_calls, - [return_value] - * records_per_domain) - mock__list_records.assert_called_once_with(domain["id"]) - - @mock.patch("%s.CreateAndDeleteRecords._delete_record" % BASE) - @mock.patch("%s.CreateAndDeleteRecords._create_record" % BASE) - @mock.patch("%s.CreateAndDeleteRecords._create_domain" % BASE) - def test_create_and_delete_records(self, - mock__create_domain, - mock__create_record, - mock__delete_record): - domain = { - "name": "zone.name", - "email": "email@zone.name", - "id": "123"} - mock__create_domain.return_value = domain - mock__create_record.return_value = {"id": "321"} - records_per_domain = 5 - - basic.CreateAndDeleteRecords(self.context).run( - records_per_domain=records_per_domain) - mock__create_domain.assert_called_once_with() - self.assertEqual(mock__create_record.mock_calls, - [mock.call(domain)] - * records_per_domain) - self.assertEqual(mock__delete_record.mock_calls, - [mock.call(domain["id"], - "321")] - * records_per_domain) - - @mock.patch("%s.ListRecords._list_records" % BASE) - def test_list_records(self, mock__list_records): - basic.ListRecords(self.context).run("123") - mock__list_records.assert_called_once_with("123") - - @mock.patch("%s.CreateAndListServers._list_servers" % BASE) - @mock.patch("%s.CreateAndListServers._create_server" % BASE) - def test_create_and_list_servers(self, - mock__create_server, - mock__list_servers): - mock__create_server.return_value = "fake_server" - mock__list_servers.return_value = ["fake_srv1", - "fake_srv2", - "fake_server"] - - # Positive case: - basic.CreateAndListServers(self.context).run() - - mock__create_server.assert_called_once_with() - mock__list_servers.assert_called_once_with() - - # Negative case: server isn't created - mock__create_server.return_value = None - self.assertRaises(exceptions.RallyAssertionError, - basic.CreateAndListServers(self.context).run) - - mock__create_server.assert_called_with() - - # Negative case: server not found in the list of existed servers - mock__create_server.return_value = "The_main_server_of_the_universe" - self.assertRaises(exceptions.RallyAssertionError, - basic.CreateAndListServers(self.context).run) - - mock__create_server.assert_called_with() - mock__list_servers.assert_called_with() - - @mock.patch("%s.CreateAndDeleteServer._delete_server" % BASE) - @mock.patch("%s.CreateAndDeleteServer._create_server" % BASE, - return_value={"id": "123"}) - def test_create_and_delete_server(self, - mock__create_server, - mock__delete_server): - basic.CreateAndDeleteServer(self.context).run() - - mock__create_server.assert_called_once_with() - mock__delete_server.assert_called_once_with("123") - - @mock.patch("%s.ListServers._list_servers" % BASE) - def test_list_servers(self, mock__list_servers): - basic.ListServers(self.context).run() - mock__list_servers.assert_called_once_with() - - # NOTE: API V2 @mock.patch("%s.CreateAndListZones._list_zones" % BASE) @mock.patch("%s.CreateAndListZones._create_zone" % BASE) def test_create_and_list_zones(self, diff --git a/tests/unit/task/scenarios/designate/test_utils.py b/tests/unit/task/scenarios/designate/test_utils.py index 54d42f6a..9dfbcc1a 100644 --- a/tests/unit/task/scenarios/designate/test_utils.py +++ b/tests/unit/task/scenarios/designate/test_utils.py @@ -38,131 +38,9 @@ class DesignateScenarioTestCase(test.ScenarioTestCase): @ddt.data( {}, {"email": "root@zone.name"}) - def test_create_domain(self, domain_data): - random_name = "foo" - scenario = utils.DesignateScenario(context=self.context) - scenario.generate_random_name = mock.Mock(return_value=random_name) - self.clients("designate").domains.create.return_value = self.domain - expected = {"email": "root@random.name"} - expected.update(domain_data) - expected["name"] = "%s.name." % random_name - - domain = scenario._create_domain(domain_data) - self.clients("designate").domains.create.assert_called_once_with( - expected) - self.assertEqual(self.domain, domain) - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.create_domain") - - def test_list_domains(self): - scenario = utils.DesignateScenario(context=self.context) - return_domains_list = scenario._list_domains() - self.assertEqual(self.clients("designate").domains.list.return_value, - return_domains_list) - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.list_domains") - - def test_delete_domain(self): - scenario = utils.DesignateScenario(context=self.context) - - domain = scenario._create_domain() - scenario._delete_domain(domain["id"]) - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.delete_domain") - - def test_update_domain(self): - scenario = utils.DesignateScenario(context=self.context) - domain = scenario._create_domain() - self.clients("designate").domains.update.return_value = self.domain - updated_domain = scenario._update_domain(domain) - self.clients("designate").domains.update.assert_called_once_with( - domain) - self.assertEqual(self.domain, updated_domain) - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.update_domain") - @ddt.data( {}, {"data": "127.0.0.1"}) - def test_create_record(self, record_data): - random_name = "foo" - domain_name = "zone.name." - domain = {"name": domain_name, "id": "123"} - record_name = "%s.%s" % (random_name, domain_name) - - scenario = utils.DesignateScenario(context=self.context) - scenario.generate_random_name = mock.Mock(return_value=random_name) - - expected = {"type": "A", "data": "10.0.0.1"} - expected.update(record_data) - expected["name"] = record_name - - scenario._create_record(domain, record=record_data) - self.clients("designate").records.create.assert_called_once_with( - domain["id"], expected) - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.create_record") - - def test_list_records(self): - scenario = utils.DesignateScenario(context=self.context) - return_records_list = scenario._list_records("123") - self.assertEqual(self.clients("designate").records.list.return_value, - return_records_list) - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.list_records") - - def test_delete_record(self): - scenario = utils.DesignateScenario(context=self.context) - - domain_id = mock.Mock() - record_id = mock.Mock() - scenario._delete_record(domain_id, record_id) - self.clients("designate").records.delete.assert_called_once_with( - domain_id, record_id) - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.delete_record") - - self.clients("designate").records.delete.reset_mock() - scenario._delete_record(domain_id, record_id) - self.clients("designate").records.delete.assert_called_once_with( - domain_id, record_id) - - def test_create_server(self): - scenario = utils.DesignateScenario(context=self.context) - random_name = "foo" - scenario.generate_random_name = mock.Mock(return_value=random_name) - - explicit_name = "bar.io." - - self.admin_clients( - "designate").servers.create.return_value = self.server - - # Check that the defaults / randoms are used if nothing is specified - server = scenario._create_server() - self.admin_clients("designate").servers.create.assert_called_once_with( - {"name": "%s.name." % random_name}) - self.assertEqual(self.server, server) - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.create_server") - - self.admin_clients("designate").servers.create.reset_mock() - - # Check that when specifying server name defaults are not used... - data = {"name": explicit_name} - server = scenario._create_server(data) - self.admin_clients( - "designate").servers.create.assert_called_once_with(data) - self.assertEqual(self.server, server) - - def test_delete_server(self): - scenario = utils.DesignateScenario(context=self.context) - - scenario._delete_server("foo_id") - self.admin_clients("designate").servers.delete.assert_called_once_with( - "foo_id") - self._test_atomic_action_timer(scenario.atomic_actions(), - "designate.delete_server") - # NOTE: API V2 @ddt.data( {},