Merge "Removes "DDT" module from Designate-Tempest-Plugin"
diff --git a/.zuul.yaml b/.zuul.yaml
index 7bdfc0e..87612e8 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -16,12 +16,6 @@
     nodeset: openstack-single-node-focal
     override-checkout: stable/yoga
 
-- job:
-    name: designate-bind9-stable-xena
-    parent: designate-bind9
-    nodeset: openstack-single-node-focal
-    override-checkout: stable/xena
-
 - project:
     templates:
       - designate-devstack-jobs
@@ -34,5 +28,4 @@
         - designate-bind9-stable-antelope
         - designate-bind9-stable-zed
         - designate-bind9-stable-yoga
-        - designate-bind9-stable-xena
         - neutron-tempest-plugin-designate-scenario
diff --git a/designate_tempest_plugin/services/dns/query/query_client.py b/designate_tempest_plugin/services/dns/query/query_client.py
index a9e9723..95fcb61 100644
--- a/designate_tempest_plugin/services/dns/query/query_client.py
+++ b/designate_tempest_plugin/services/dns/query/query_client.py
@@ -15,6 +15,7 @@
 import dns.exception
 import dns.query
 from tempest import config
+from oslo_utils import netutils
 
 CONF = config.CONF
 
@@ -78,7 +79,7 @@
 
     @classmethod
     def from_str(self, nameserver):
-        if ':' in nameserver:
-            ip, port = nameserver.rsplit(':', 1)
-            return Nameserver(ip, int(port))
+        ip, port = netutils.parse_host_port(nameserver)
+        if port:
+            return Nameserver(ip, port)
         return Nameserver(nameserver)
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py b/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
index 96634e2..07ddde0 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
@@ -102,10 +102,12 @@
         LOG.info('Ensure we respond with PENDING')
         self.assertEqual('PENDING', recordset['status'])
 
-        LOG.info('Wait until the recordset is active')
+        LOG.info('Wait until the recordset is active and propagated')
         waiters.wait_for_recordset_status(self.recordset_client,
                                           self.zone['id'], recordset['id'],
                                           'ACTIVE')
+        waiters.wait_for_query(
+            self.query_client, recordset_data['name'], type)
 
         LOG.info('Delete the recordset')
         body = self.recordset_client.delete_recordset(
@@ -115,10 +117,13 @@
         self.assertEqual('DELETE', body['action'])
         self.assertEqual('PENDING', body['status'])
 
-        LOG.info('Ensure successful deletion of Recordset')
+        LOG.info('Ensure successful deletion of Recordset from:'
+                 ' Designate and Backends')
         self.assertRaises(lib_exc.NotFound,
                           lambda: self.recordset_client.show_recordset(
                               self.zone['id'], recordset['id']))
+        waiters.wait_for_query(
+            self.query_client, recordset_data['name'], type, found=False)
 
     @decorators.attr(type='slow')
     @decorators.idempotent_id('4664ed66-9ff1-45f2-9e60-d4913195c505')
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_shared_zones.py b/designate_tempest_plugin/tests/scenario/v2/test_shared_zones.py
index 7ece8a2..75aa3c3 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_shared_zones.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_shared_zones.py
@@ -294,6 +294,76 @@
         self.addCleanup(self.share_zone_client.delete_zone_share,
                         zone_id, shared_zone['id'])
 
+    @decorators.attr(type='slow')
+    @decorators.idempotent_id('c5d83684-18cb-11ee-a872-201e8823901f')
+    def test_list_zones_shared_with_more_then_two_projects(self):
+        # Create a zone to share with the alt credentialzones_client
+        zone_name = dns_data_utils.rand_zone_name(name='TestZone',
+                                                  suffix=self.tld_name)
+        LOG.info('Create a zone: %s', zone_name)
+        zone = self.zones_client.create_zone(name=zone_name)[1]
+        zone_id = zone['id']
+        self.addCleanup(self.wait_zone_delete, self.zones_client, zone['id'],
+                        ignore_errors=lib_exc.NotFound)
+
+        # Share the zone with the alt credential
+        shared_zone = self.share_zone_client.create_zone_share(
+            zone['id'], self.alt_rec_client.project_id)[1]
+        self.addCleanup(self.share_zone_client.delete_zone_share,
+                        zone['id'], shared_zone['id'])
+
+        # Share the zone with the demo credential
+        shared_zone = self.share_zone_client.create_zone_share(
+            zone['id'], self.demo_rec_client.project_id)[1]
+        self.addCleanup(self.share_zone_client.delete_zone_share,
+                        zone['id'], shared_zone['id'])
+
+        zones = self.zones_client.list_zones()[1]['zones']
+        zones_ids = [zone['id'] for zone in zones]
+        self.assertEqual(
+            1, zones_ids.count(zone_id),
+            'Failed, ID:{} counted in zones listed:{} must be one'.format(
+                zone_id, zones))
+
+    @decorators.attr(type='slow')
+    @decorators.idempotent_id('78b77c6c-18cf-11ee-a872-201e8823901f')
+    def test_create_recordset_for_zone_shared_with_two_projects(self):
+        # Create a zone to share with the alt credential
+        zone_name = dns_data_utils.rand_zone_name(name='TestZone',
+                                                  suffix=self.tld_name)
+        LOG.info('Create a zone: %s', zone_name)
+        zone = self.zones_client.create_zone(name=zone_name)[1]
+        self.addCleanup(self.wait_zone_delete, self.zones_client, zone['id'],
+                        ignore_errors=lib_exc.NotFound)
+
+        # Share the zone with the alt credential
+        shared_zone = self.share_zone_client.create_zone_share(
+            zone['id'], self.alt_rec_client.project_id)[1]
+        self.addCleanup(self.share_zone_client.delete_zone_share,
+                        zone['id'], shared_zone['id'])
+
+        # Check that the alt user can create a recordset on the shared zone
+        recordset_data = dns_data_utils.rand_recordset_data(
+            record_type='A', zone_name=zone['name'])
+        recordset = self.alt_rec_client.create_recordset(
+            zone['id'], recordset_data)[1]
+        self.addCleanup(self.wait_recordset_delete, self.alt_rec_client,
+            zone['id'], recordset['id'], ignore_errors=lib_exc.NotFound)
+
+        # Share the zone with the demo credential
+        shared_zone = self.share_zone_client.create_zone_share(
+            zone['id'], self.demo_rec_client.project_id)[1]
+        self.addCleanup(self.share_zone_client.delete_zone_share,
+                        zone['id'], shared_zone['id'])
+
+        # Check that the demo user can create a recordset on the shared zone
+        recordset_data = dns_data_utils.rand_recordset_data(
+            record_type='A', zone_name=zone['name'])
+        recordset = self.demo_rec_client.create_recordset(
+            zone['id'], recordset_data)[1]
+        self.addCleanup(self.wait_recordset_delete, self.demo_rec_client,
+            zone['id'], recordset['id'], ignore_errors=lib_exc.NotFound)
+
 
 class SharedZonesTestNegative(base.BaseDnsV2Test):
     credentials = ['primary', 'admin', 'system_admin', 'alt',