Fix mcp/mitaka branch
Change default branch
Revert pick on pike changes
Update gerrit review file
Change-Id: Ie630c14a7c330950af4c5361d931603947d3fc55
Related-Prod:PROD-28085
Revert "Fix deleting zones after tests"
This reverts commit 84e8349
Change-Id: Iae4530688f2882caec635802486d3a12d21254e4
Revert "Fix deleting zones in recordset validation tests"
This reverts commit fe54746
Change-Id: I4d72c732b1eee2f66e107c17b58bd213d1595b56
Revert "Fix quota tests for static credentials"
This reverts commit 4b16650
Change-Id: Ib55d51e3425e7b5137d2c5ea881d330fe8df55f6
Revert "Delete created zone in recordset validation tests"
This reverts commit 1dad5c3
Change-Id: I1a8db36a29fef0b97f36203550ecd0eef84f01ea
Revert "Add test for quota set for invalid project"
This reverts commit 422f38b
Related-Prod:PROD-28069
Change-Id: If1e05cd10a4f560c55c482314fa1df29d3451413
diff --git a/.gitreview b/.gitreview
index 6a64c52..2f35588 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,4 +2,4 @@
host=gerrit.mcp.mirantis.net
port=29418
project=packaging/sources/designate-tempest-plugin.git
-defaultbranch=mcp/pike
+defaultbranch=mcp/mitaka
diff --git a/designate_tempest_plugin/config.py b/designate_tempest_plugin/config.py
index c82421a..565d5c3 100644
--- a/designate_tempest_plugin/config.py
+++ b/designate_tempest_plugin/config.py
@@ -74,10 +74,6 @@
cfg.BoolOpt('api_v2_quotas',
default=False,
help="Is the v2 quota API enabled."),
- cfg.BoolOpt('api_v2_quotas_verify_project',
- default=False,
- help="Is project IDs verified when setting v2 quotas. "
- "Must be set to True starting from Rocky release."),
cfg.BoolOpt('bug_1573141_fixed',
default=False,
help="Is https://bugs.launchpad.net/designate/+bug/1573141 "
diff --git a/designate_tempest_plugin/tests/api/admin/test_quotas.py b/designate_tempest_plugin/tests/api/admin/test_quotas.py
index ad249d5..ad298b7 100644
--- a/designate_tempest_plugin/tests/api/admin/test_quotas.py
+++ b/designate_tempest_plugin/tests/api/admin/test_quotas.py
@@ -36,12 +36,6 @@
credentials = ["admin"]
- def setUp(self):
- super(QuotasAdminTest, self).setUp()
- _, original_quotas = self.admin_client.show_quotas()
- self.addCleanup(self.admin_client.update_quotas,
- **original_quotas['quota'])
-
@classmethod
def setup_clients(cls):
super(QuotasAdminTest, cls).setup_clients()
diff --git a/designate_tempest_plugin/tests/api/v2/test_quotas.py b/designate_tempest_plugin/tests/api/v2/test_quotas.py
index 6f3c050..33c0f95 100644
--- a/designate_tempest_plugin/tests/api/v2/test_quotas.py
+++ b/designate_tempest_plugin/tests/api/v2/test_quotas.py
@@ -14,7 +14,6 @@
from oslo_log import log as logging
from tempest import config
from tempest.lib import decorators
-from tempest.lib import exceptions as lib_exc
from designate_tempest_plugin.tests import base
from designate_tempest_plugin import data_utils as dns_data_utils
@@ -27,7 +26,7 @@
class QuotasV2Test(base.BaseDnsV2Test):
- credentials = ['primary', 'admin', 'alt']
+ credentials = ['primary', 'admin']
@classmethod
def skip_checks(cls):
@@ -44,24 +43,9 @@
cls.quotas_client = cls.os.quotas_client
cls.admin_client = cls.os_adm.quotas_client
- cls.alt_client = cls.os_alt.quotas_client
-
- def _store_quotas(self, project_id=None, cleanup=True):
- """Remember current quotas and reset them after the test"""
- params = {}
- if project_id:
- params['project_id'] = project_id
- params['headers'] = {'X-Auth-All-Projects': True}
-
- _r, original_quotas = self.admin_client.show_quotas(**params)
- params.update(original_quotas)
- if cleanup:
- self.addCleanup(self.admin_client.update_quotas, **params)
- return original_quotas
@decorators.idempotent_id('1dac991a-9e2e-452c-a47a-26ac37381ec5')
def test_show_quotas(self):
- self._store_quotas()
LOG.info("Updating quotas")
quotas = dns_data_utils.rand_quotas()
_, body = self.admin_client.update_quotas(**quotas)
@@ -75,7 +59,6 @@
@decorators.idempotent_id('0448b089-5803-4ce3-8a6c-5c15ff75a2cc')
def test_delete_quotas(self):
- self._store_quotas()
LOG.info("Deleting quotas")
_, body = self.admin_client.delete_quotas()
@@ -84,10 +67,10 @@
@decorators.idempotent_id('76d24c87-1b39-4e19-947c-c08e1380dc61')
def test_update_quotas(self):
- self._store_quotas()
LOG.info("Updating quotas")
quotas = dns_data_utils.rand_quotas()
_, body = self.admin_client.update_quotas(**quotas)
+ self.addCleanup(self.admin_client.delete_quotas)
LOG.info("Ensuring the response has all quota types")
self.assertExpected(quotas, body, [])
@@ -96,7 +79,6 @@
def test_update_quotas_other_project(self):
project_id = self.quotas_client.tenant_id
- self._store_quotas(project_id=project_id)
LOG.info("Updating quotas for %s ", project_id)
@@ -105,6 +87,7 @@
request['project_id'] = project_id
request['headers'] = {'X-Auth-All-Projects': True}
_, body = self.admin_client.update_quotas(**request)
+ self.addCleanup(self.admin_client.delete_quotas, project_id=project_id)
LOG.info("Ensuring the response has all quota types")
self.assertExpected(quotas, body, [])
@@ -116,15 +99,10 @@
@decorators.idempotent_id('21e45d30-dbc1-4173-9d6b-9b6813ef514b')
def test_reset_quotas_other_project(self):
- LOG.info("Using 'alt' project id to set quotas on.")
- project_id = self.alt_client.tenant_id
- self._store_quotas(project_id=project_id)
+ # Use a fake project for this
+ project_id = '21e45d30-dbc1-4173-9d6b-9b6813ef514b'
- LOG.info("Resetting quotas to default for %s ", project_id)
- self.admin_client.delete_quotas(
- project_id=project_id,
- headers={'X-Auth-All-Projects': True})
- _, default_quotas = self.admin_client.show_quotas(
+ _, original_quotas = self.admin_client.show_quotas(
project_id=project_id, headers={'X-Auth-All-Projects': True})
LOG.info("Updating quotas for %s ", project_id)
@@ -134,6 +112,7 @@
request['project_id'] = project_id
request['headers'] = {'X-Auth-All-Projects': True}
_, body = self.admin_client.update_quotas(**request)
+ self.addCleanup(self.admin_client.delete_quotas, project_id=project_id)
self.admin_client.delete_quotas(
project_id=project_id,
@@ -142,28 +121,4 @@
_, final_quotas = self.admin_client.show_quotas(
project_id=project_id, headers={'X-Auth-All-Projects': True})
- self.assertExpected(default_quotas, final_quotas, [])
-
- @decorators.idempotent_id('9b09b3e2-7e88-4569-bce3-9be2f7ac70c4')
- def test_update_quotas_invalid_project(self):
-
- if not CONF.dns_feature_enabled.api_v2_quotas_verify_project:
- raise self.skipException("Project ID in quotas "
- "is not being verified.")
-
- project_id = 'project-that-does-not-exist'
- original_quotas = self._store_quotas(project_id=project_id,
- cleanup=False)
-
- LOG.info("Updating quotas for non-existing %s ", project_id)
-
- quotas = dns_data_utils.rand_quotas()
- request = quotas.copy()
- request['project_id'] = project_id
- request['headers'] = {'X-Auth-All-Projects': True}
- with self.assertRaisesDns(lib_exc.BadRequest, 'invalid_project', 400):
- self.admin_client.update_quotas(**request)
-
- _, client_body = self.quotas_client.show_quotas()
-
- self.assertExpected(original_quotas, client_body, [])
+ self.assertExpected(original_quotas, final_quotas, [])
diff --git a/designate_tempest_plugin/tests/api/v2/test_recordset.py b/designate_tempest_plugin/tests/api/v2/test_recordset.py
index fd05e73..2a2e483 100644
--- a/designate_tempest_plugin/tests/api/v2/test_recordset.py
+++ b/designate_tempest_plugin/tests/api/v2/test_recordset.py
@@ -40,11 +40,11 @@
@classmethod
def resource_cleanup(cls):
+ super(BaseRecordsetsTest, cls).resource_cleanup()
+
cls.zone_client.delete_zone(
cls.zone['id'], ignore_errors=lib_exc.NotFound)
- super(BaseRecordsetsTest, cls).resource_cleanup()
-
@ddt.ddt
class RecordsetsTest(BaseRecordsetsTest):
@@ -232,7 +232,7 @@
def test_get_nonexistent_recordset(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Attempt to get an invalid Recordset')
with self.assertRaisesDns(
@@ -243,7 +243,7 @@
def test_get_nonexistent_recordset_invalid_id(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Attempt to get an invalid Recordset')
with self.assertRaisesDns(lib_exc.BadRequest, 'invalid_uuid', 400):
@@ -253,7 +253,7 @@
def test_update_nonexistent_recordset(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
recordset_data = data_utils.rand_recordset_data('A', zone['name'])
@@ -267,7 +267,7 @@
def test_update_nonexistent_recordset_invalid_id(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
recordset_data = data_utils.rand_recordset_data('A', zone['name'])
@@ -280,7 +280,7 @@
def test_delete_nonexistent_recordset(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Attempt to delete an invalid Recordset')
with self.assertRaisesDns(
@@ -292,7 +292,7 @@
def test_delete_nonexistent_recordset_invalid_id(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Attempt to get an invalid Recordset')
with self.assertRaisesDns(lib_exc.BadRequest, 'invalid_uuid', 400):
@@ -347,7 +347,7 @@
LOG.info('Create another zone')
_, zone2 = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone2['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone2['id'])
LOG.info('Create another Recordset')
recordset_data = data_utils.rand_recordset_data(
@@ -376,7 +376,7 @@
def test_list_zones_recordsets_zone_names(self):
LOG.info('Create another zone')
_, zone2 = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone2['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone2['id'])
LOG.info('List recordsets')
_, body = self.client.list_zones_recordsets()
@@ -421,7 +421,7 @@
LOG.info('Create a zone as a default user')
_, zone = self.zone_client.create_zone(name='a.b.' + zone_name)
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
rrset_data = data_utils.rand_recordset_data(
record_type='A', zone_name=zone_name)
@@ -436,12 +436,6 @@
def test_no_create_recordset_via_alt_domain(self):
_, zone = self.zone_client.create_zone()
_, alt_zone = self.alt_zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete,
- self.zone_client,
- zone['id'])
- self.addCleanup(self.wait_zone_delete,
- self.alt_zone_client,
- alt_zone['id'])
# alt attempts to create record with name A12345.{zone}
recordset_data = data_utils.rand_recordset_data(
diff --git a/designate_tempest_plugin/tests/api/v2/test_recordset_validation.py b/designate_tempest_plugin/tests/api/v2/test_recordset_validation.py
index 81c1353..48c05df 100644
--- a/designate_tempest_plugin/tests/api/v2/test_recordset_validation.py
+++ b/designate_tempest_plugin/tests/api/v2/test_recordset_validation.py
@@ -54,9 +54,6 @@
zone_data = data_utils.rand_zone_data()
resp, body = self.zones_client.create_zone(**zone_data)
self._zone = body
- self.addCleanup(self.wait_zone_delete,
- self.zones_client,
- body['id'])
return self._zone
def create_recordset(self, data):
diff --git a/designate_tempest_plugin/tests/api/v2/test_transfer_accepts.py b/designate_tempest_plugin/tests/api/v2/test_transfer_accepts.py
index 918b1c0..0972a24 100644
--- a/designate_tempest_plugin/tests/api/v2/test_transfer_accepts.py
+++ b/designate_tempest_plugin/tests/api/v2/test_transfer_accepts.py
@@ -37,7 +37,7 @@
def test_create_transfer_accept(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone transfer_request')
_, transfer_request = self.request_client.create_transfer_request(
@@ -59,7 +59,7 @@
def test_show_transfer_accept(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone transfer_request')
_, transfer_request = self.request_client.create_transfer_request(
diff --git a/designate_tempest_plugin/tests/api/v2/test_transfer_request.py b/designate_tempest_plugin/tests/api/v2/test_transfer_request.py
index cd2426a..af81cfc 100644
--- a/designate_tempest_plugin/tests/api/v2/test_transfer_request.py
+++ b/designate_tempest_plugin/tests/api/v2/test_transfer_request.py
@@ -41,7 +41,7 @@
def test_create_transfer_request(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone transfer_request')
_, transfer_request = self.client.create_transfer_request(zone['id'])
@@ -55,7 +55,7 @@
def test_create_transfer_request_scoped(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
transfer_request_data = dns_data_utils.rand_transfer_request_data(
target_project_id=self.os_alt.credentials.project_id)
@@ -73,7 +73,7 @@
def test_create_transfer_request_empty_body(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone transfer_request')
_, transfer_request = self.client.create_transfer_request_empty_body(
zone['id'])
@@ -87,7 +87,7 @@
def test_show_transfer_request(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone transfer_request')
_, transfer_request = self.client.create_transfer_request(zone['id'])
@@ -107,7 +107,7 @@
# the request.
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
transfer_request_data = dns_data_utils.rand_transfer_request_data(
target_project_id=self.os_alt.credentials.project_id)
@@ -131,7 +131,7 @@
def test_delete_transfer_request(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a transfer_request')
_, transfer_request = self.client.create_transfer_request(zone['id'])
@@ -148,7 +148,7 @@
def test_list_transfer_requests(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone transfer_request')
_, transfer_request = self.client.create_transfer_request(zone['id'])
@@ -164,7 +164,7 @@
def test_update_transfer_request(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone transfer_request')
_, transfer_request = self.client.create_transfer_request(zone['id'])
diff --git a/designate_tempest_plugin/tests/api/v2/test_tsigkey.py b/designate_tempest_plugin/tests/api/v2/test_tsigkey.py
index 6f7a311..129c576 100644
--- a/designate_tempest_plugin/tests/api/v2/test_tsigkey.py
+++ b/designate_tempest_plugin/tests/api/v2/test_tsigkey.py
@@ -39,7 +39,7 @@
def test_create_tsigkey(self):
LOG.info('Create a resource')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
tsigkey_data = {
"name": "Example tsigkey",
@@ -61,7 +61,7 @@
def test_list_tsigkey(self):
LOG.info('Create a resource')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a tsigkey')
_, tsigkey = self.admin_client.create_tsigkey(resource_id=zone['id'])
self.addCleanup(self.admin_client.delete_tsigkey, tsigkey['id'])
@@ -72,7 +72,7 @@
def test_show_tsigkey(self):
LOG.info('Create a resource')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a tsigkey')
_, tsigkey = self.admin_client.create_tsigkey(resource_id=zone['id'])
@@ -88,7 +88,7 @@
def test_update_tsigkey(self):
LOG.info('Create a resource')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a tsigkey')
_, tsigkey = self.admin_client.create_tsigkey(resource_id=zone['id'])
@@ -113,7 +113,7 @@
def test_delete_tsigkey(self):
LOG.info('Create a resource')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a tsigkey')
_, tsigkey = self.admin_client.create_tsigkey(resource_id=zone['id'])
diff --git a/designate_tempest_plugin/tests/api/v2/test_zones.py b/designate_tempest_plugin/tests/api/v2/test_zones.py
index cb7d205..326aa48 100644
--- a/designate_tempest_plugin/tests/api/v2/test_zones.py
+++ b/designate_tempest_plugin/tests/api/v2/test_zones.py
@@ -38,7 +38,7 @@
def test_create_zone(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
LOG.info('Ensure we respond with CREATE+PENDING')
self.assertEqual('CREATE', zone['action'])
@@ -48,7 +48,7 @@
def test_show_zone(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
LOG.info('Fetch the zone')
_, body = self.client.show_zone(zone['id'])
@@ -61,7 +61,7 @@
def test_delete_zone(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'],
+ self.addCleanup(self.client.delete_zone, zone['id'],
ignore_errors=lib_exc.NotFound)
LOG.info('Delete the zone')
@@ -75,7 +75,7 @@
def test_list_zones(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
LOG.info('List zones')
_, body = self.client.list_zones()
@@ -88,7 +88,7 @@
def test_update_zone(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
# Generate a random description
description = data_utils.rand_name()
@@ -126,7 +126,7 @@
def test_get_other_tenant_zone(self):
LOG.info('Create a zone as a user')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
LOG.info('Fetch the zone as an admin')
_, body = self.admin_client.show_zone(
@@ -150,7 +150,7 @@
def test_no_create_duplicate_domain(self):
LOG.info('Create a zone as a default user')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
LOG.info('Create a zone as an default with existing domain')
self.assertRaises(lib_exc.Conflict,
@@ -164,7 +164,7 @@
def test_no_create_subdomain_by_alt_user(self):
LOG.info('Create a zone as a default user')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
LOG.info('Create a zone as an alt user with existing subdomain')
self.assertRaises(lib_exc.Forbidden,
@@ -178,7 +178,7 @@
LOG.info('Create a zone as a default user')
_, zone = self.client.create_zone(name='a.b.' + zone_name)
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
LOG.info('Create a zone as an alt user with existing superdomain')
self.assertRaises(lib_exc.Forbidden,
diff --git a/designate_tempest_plugin/tests/api/v2/test_zones_exports.py b/designate_tempest_plugin/tests/api/v2/test_zones_exports.py
index 5b302d2..de5b5fe 100644
--- a/designate_tempest_plugin/tests/api/v2/test_zones_exports.py
+++ b/designate_tempest_plugin/tests/api/v2/test_zones_exports.py
@@ -38,11 +38,10 @@
def test_create_zone_export(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone export')
_, zone_export = self.client.create_zone_export(zone['id'])
- self.addCleanup(self.client.delete_zone_export, zone_export['id'])
LOG.info('Ensure we respond with PENDING')
self.assertEqual('PENDING', zone_export['status'])
@@ -52,11 +51,10 @@
def test_show_zone_export(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
LOG.info('Create a zone export')
resp, zone_export = self.client.create_zone_export(zone['id'])
- self.addCleanup(self.client.delete_zone_export, zone_export['id'])
LOG.info('Re-Fetch the zone export')
_, body = self.client.show_zone_export(zone_export['id'])
@@ -68,7 +66,7 @@
def test_delete_zone_export(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'],
+ self.addCleanup(self.zone_client.delete_zone, zone['id'],
ignore_errors=lib_exc.NotFound)
LOG.info('Create a zone export')
@@ -85,10 +83,9 @@
def test_list_zone_exports(self):
LOG.info('Create a zone')
_, zone = self.zone_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+ self.addCleanup(self.zone_client.delete_zone, zone['id'])
_, export = self.client.create_zone_export(zone['id'])
- self.addCleanup(self.client.delete_zone_export, export['id'])
LOG.info('List zone exports')
_, body = self.client.list_zone_exports()
diff --git a/designate_tempest_plugin/tests/api/v2/test_zones_imports.py b/designate_tempest_plugin/tests/api/v2/test_zones_imports.py
index ed7f3f9..42a20dc 100644
--- a/designate_tempest_plugin/tests/api/v2/test_zones_imports.py
+++ b/designate_tempest_plugin/tests/api/v2/test_zones_imports.py
@@ -16,7 +16,6 @@
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
-from designate_tempest_plugin.common import waiters
from designate_tempest_plugin.tests import base
LOG = logging.getLogger(__name__)
@@ -31,22 +30,13 @@
@classmethod
def setup_clients(cls):
super(ZonesImportTest, cls).setup_clients()
-
- cls.client = cls.os_primary.zone_imports_client
- cls.zone_client = cls.os_primary.zones_client
-
- def clean_up_resources(self, zone_import_id):
- waiters.wait_for_zone_import_status(self.client, zone_import_id,
- "COMPLETE")
- _, zone_import = self.client.show_zone_import(zone_import_id)
- self.client.delete_zone_import(zone_import['id'])
- self.wait_zone_delete(self.zone_client, zone_import['zone_id'])
+ cls.client = cls.os.zone_imports_client
@decorators.idempotent_id('2e2d907d-0609-405b-9c96-3cb2b87e3dce')
def test_create_zone_import(self):
LOG.info('Create a zone import')
_, zone_import = self.client.create_zone_import()
- self.addCleanup(self.clean_up_resources, zone_import['id'])
+ self.addCleanup(self.client.delete_zone_import, zone_import['id'])
LOG.info('Ensure we respond with PENDING')
self.assertEqual('PENDING', zone_import['status'])
@@ -56,7 +46,7 @@
def test_show_zone_import(self):
LOG.info('Create a zone import')
_, zone_import = self.client.create_zone_import()
- self.addCleanup(self.clean_up_resources, zone_import['id'])
+ self.addCleanup(self.client.delete_zone_import, zone_import['id'])
LOG.info('Re-Fetch the zone import')
resp, body = self.client.show_zone_import(zone_import['id'])
@@ -68,12 +58,6 @@
def test_delete_zone_import(self):
LOG.info('Create a zone import')
_, zone_import = self.client.create_zone_import()
- waiters.wait_for_zone_import_status(self.client, zone_import['id'],
- "COMPLETE")
- _, zone_import = self.client.show_zone_import(zone_import['id'])
- self.addCleanup(self.wait_zone_delete,
- self.zone_client,
- zone_import['zone_id'])
LOG.info('Delete the zone')
resp, body = self.client.delete_zone_import(zone_import['id'])
@@ -85,8 +69,7 @@
@decorators.idempotent_id('9eab76af-1995-485f-a2ef-8290c1863aba')
def test_list_zones_imports(self):
LOG.info('Create a zone import')
- _, zone_import = self.client.create_zone_import()
- self.addCleanup(self.clean_up_resources, zone_import['id'])
+ _, zone = self.client.create_zone_import()
LOG.info('List zones imports')
_, body = self.client.list_zone_imports()
diff --git a/designate_tempest_plugin/tests/base.py b/designate_tempest_plugin/tests/base.py
index b088f43..43579dc 100644
--- a/designate_tempest_plugin/tests/base.py
+++ b/designate_tempest_plugin/tests/base.py
@@ -14,7 +14,6 @@
import six
from tempest import test
from tempest import config
-from tempest.lib.common.utils import test_utils as utils
from designate_tempest_plugin import clients
@@ -104,18 +103,6 @@
with context:
callable_(*args, **kwargs)
- def wait_zone_delete(self, zone_client, zone_id, **kwargs):
- zone_client.delete_zone(zone_id, **kwargs)
- utils.call_until_true(self._check_zone_deleted,
- CONF.dns.build_timeout,
- CONF.dns.build_interval,
- zone_client,
- zone_id)
-
- def _check_zone_deleted(self, zone_client, zone_id):
- return utils.call_and_ignore_notfound_exc(zone_client.show_zone,
- zone_id) is None
-
class BaseDnsV1Test(BaseDnsTest):
"""Base class for DNS V1 API tests."""
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_zones.py b/designate_tempest_plugin/tests/scenario/v2/test_zones.py
index e51f563..94665a8 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_zones.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_zones.py
@@ -38,7 +38,7 @@
def test_create_and_delete_zone(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'],
+ self.addCleanup(self.client.delete_zone, zone['id'],
ignore_errors=lib_exc.NotFound)
LOG.info('Ensure we respond with CREATE+PENDING')
@@ -69,7 +69,7 @@
def test_delete_zone_pending_create(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'],
+ self.addCleanup(self.client.delete_zone, zone['id'],
ignore_errors=lib_exc.NotFound)
# NOTE(kiall): This is certainly a little racey, it's entirely
@@ -95,7 +95,7 @@
def test_zone_create_propagates_to_nameservers(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'])
+ self.addCleanup(self.client.delete_zone, zone['id'])
waiters.wait_for_zone_status(self.client, zone['id'], "ACTIVE")
waiters.wait_for_query(self.query_client, zone['name'], "SOA")
@@ -109,7 +109,7 @@
def test_zone_delete_propagates_to_nameservers(self):
LOG.info('Create a zone')
_, zone = self.client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.client, zone['id'],
+ self.addCleanup(self.client.delete_zone, zone['id'],
ignore_errors=lib_exc.NotFound)
waiters.wait_for_zone_status(self.client, zone['id'], "ACTIVE")
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_zones_export.py b/designate_tempest_plugin/tests/scenario/v2/test_zones_export.py
index 8c1b90f..b8002de 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_zones_export.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_zones_export.py
@@ -36,12 +36,10 @@
def test_create_zone_export_and_show_exported_zonefile(self):
LOG.info('Create a zone to be exported')
_, zone = self.zones_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zones_client, zone['id'])
+ self.addCleanup(self.zones_client.delete_zone, zone['id'])
LOG.info('Create a zone export')
_, zone_export = self.client.create_zone_export(zone['id'])
- self.addCleanup(self.client.delete_zone_export, zone_export['id'])
-
self.assertEqual('PENDING', zone_export['status'])
self.assertEqual(zone['id'], zone_export['zone_id'])
self.assertIsNone(zone_export['links'].get('export'))
@@ -53,7 +51,6 @@
LOG.info('Check the zone export looks good')
_, zone_export = self.client.show_zone_export(zone_export['id'])
-
self.assertEqual('COMPLETE', zone_export['status'])
self.assertEqual(zone['id'], zone_export['zone_id'])
self.assertIsNotNone(zone_export['links'].get('export'))
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_zones_import.py b/designate_tempest_plugin/tests/scenario/v2/test_zones_import.py
index b08f829..4406059 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_zones_import.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_zones_import.py
@@ -27,9 +27,8 @@
@classmethod
def setup_clients(cls):
super(ZonesImportTest, cls).setup_clients()
-
- cls.client = cls.os_primary.zone_imports_client
- cls.zones_client = cls.os_primary.zones_client
+ cls.client = cls.os.zone_imports_client
+ cls.zones_client = cls.os.zones_client
@decorators.attr(type='slow')
@decorators.idempotent_id('679f38d0-2f2f-49c5-934e-8fe0c452f56e')
@@ -47,10 +46,6 @@
LOG.info('Check the zone import looks good')
_, zone_import = self.client.show_zone_import(zone_import['id'])
- self.addCleanup(self.wait_zone_delete,
- self.zones_client,
- zone_import['zone_id'])
-
self.assertEqual('COMPLETE', zone_import['status'])
self.assertIsNotNone(zone_import['zone_id'])
self.assertIsNotNone(zone_import['links'].get('zone'))
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_zones_transfer.py b/designate_tempest_plugin/tests/scenario/v2/test_zones_transfer.py
index b59967d..4870307 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_zones_transfer.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_zones_transfer.py
@@ -37,14 +37,14 @@
def test_zone_transfer(self):
LOG.info('Create a zone as primary tenant')
_, zone = self.zones_client.create_zone()
- self.addCleanup(self.wait_zone_delete, self.zones_client, zone['id'],
+ self.addCleanup(self.zones_client.delete_zone, zone['id'],
+ ignore_errors=lib_exc.NotFound)
+ self.addCleanup(self.alt_zones_client.delete_zone, zone['id'],
ignore_errors=lib_exc.NotFound)
LOG.info('Create a zone transfer_request for zone as primary tenant')
_, transfer_request = \
self.request_client.create_transfer_request_empty_body(zone['id'])
- self.addCleanup(self.request_client.delete_transfer_request,
- transfer_request['id'])
accept_data = {
"key": transfer_request['key'],
@@ -55,10 +55,7 @@
self.alt_accept_client.create_transfer_accept(accept_data)
LOG.info('Fetch the zone as alt tenant')
- _, alt_zone = self.alt_zones_client.show_zone(zone['id'])
- self.addCleanup(self.wait_zone_delete,
- self.alt_zones_client,
- alt_zone['id'])
+ self.alt_zones_client.show_zone(zone['id'])
LOG.info('Ensure 404 when fetching the zone as primary tenant')
self.assertRaises(lib_exc.NotFound,