Fix deleting zones after tests
these tests create zones as part of the test but do clean them up
afterward slowly. This leads to these and following tests in the thread
to fail with over quota when default zone quota is sufficiently low.
Change-Id: Iebe15ca6d0d3101237a92e011b081c38647a8de6
diff --git a/designate_tempest_plugin/tests/base.py b/designate_tempest_plugin/tests/base.py
index e411597..f4f50de 100644
--- a/designate_tempest_plugin/tests/base.py
+++ b/designate_tempest_plugin/tests/base.py
@@ -14,6 +14,7 @@
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
@@ -97,6 +98,18 @@
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."""