diff --git a/designate_tempest_plugin/common/waiters.py b/designate_tempest_plugin/common/waiters.py index affe3326..cfa2d105 100644 --- a/designate_tempest_plugin/common/waiters.py +++ b/designate_tempest_plugin/common/waiters.py @@ -233,7 +233,7 @@ def wait_for_query(client, name, rdatatype, found=True): else: all_answers_good = all(not r.answer for r in responses) - if not client.nameservers or all_answers_good: + if all_answers_good: LOG.info("Record %s of type %s was successfully %s on nameservers " "%s", name, rdatatype, state, client.nameservers) return diff --git a/designate_tempest_plugin/services/dns/query/query_client.py b/designate_tempest_plugin/services/dns/query/query_client.py index 7629c516..a9e97239 100644 --- a/designate_tempest_plugin/services/dns/query/query_client.py +++ b/designate_tempest_plugin/services/dns/query/query_client.py @@ -24,21 +24,17 @@ class QueryClient(object): def __init__(self, nameservers=None, query_timeout=None, build_interval=None, build_timeout=None): - self.nameservers = self._nameservers_not_empty( - nameservers or CONF.dns.nameservers) + self.nameservers = nameservers or CONF.dns.nameservers self.query_timeout = query_timeout or CONF.dns.query_timeout self.build_interval = build_interval or CONF.dns.build_interval self.build_timeout = build_timeout or CONF.dns.build_timeout self.clients = [SingleQueryClient(ns, query_timeout=query_timeout) for ns in nameservers] - def _nameservers_not_empty(self, nameservers_list): - if not nameservers_list: + def query(self, zone_name, rdatatype): + if not self.nameservers: raise ValueError('Nameservers list cannot be empty and it should ' 'contain DNS backend IPs to "dig" for') - return nameservers_list - - def query(self, zone_name, rdatatype): return [c.query(zone_name, rdatatype) for c in self.clients] diff --git a/designate_tempest_plugin/tests/api/v2/test_zone_tasks.py b/designate_tempest_plugin/tests/api/v2/test_zone_tasks.py index 70a2e776..2faa83d7 100644 --- a/designate_tempest_plugin/tests/api/v2/test_zone_tasks.py +++ b/designate_tempest_plugin/tests/api/v2/test_zone_tasks.py @@ -19,6 +19,7 @@ from oslo_log import log as logging from tempest import config from tempest.lib import decorators from tempest.lib import exceptions as lib_exc +import testtools from designate_tempest_plugin.common import constants as const from designate_tempest_plugin.common import waiters @@ -81,6 +82,9 @@ class ZoneTasks(BaseZonesTest): cls.alt_client = cls.os_alt.dns_v2.ZonesClient() @decorators.idempotent_id('287e2cd0-a0e7-11eb-b962-74e5f9e2a801') + @testtools.skipUnless( + config.CONF.dns.nameservers, + "Config option dns.nameservers is missing or empty") def test_zone_abandon(self): LOG.info('Create a PRIMARY zone') zone_name = dns_data_utils.rand_zone_name( @@ -123,6 +127,9 @@ class ZoneTasks(BaseZonesTest): self.query_client, pr_zone['name'], "SOA") @decorators.idempotent_id('90b21d1a-a1ba-11eb-84fa-74e5f9e2a801') + @testtools.skipUnless( + config.CONF.dns.nameservers, + "Config option dns.nameservers is missing or empty") def test_zone_abandon_forbidden(self): LOG.info('Create a PRIMARY zone and add to the cleanup')