Merge "Adding new test cases to: "Zone Ownership Transfers" test suite."
diff --git a/designate_tempest_plugin/services/dns/v2/json/zones_client.py b/designate_tempest_plugin/services/dns/v2/json/zones_client.py
index ac360e6..60e669a 100644
--- a/designate_tempest_plugin/services/dns/v2/json/zones_client.py
+++ b/designate_tempest_plugin/services/dns/v2/json/zones_client.py
@@ -23,7 +23,7 @@
@base.handle_errors
def create_zone(self, name=None, email=None, ttl=None, description=None,
- wait_until=False, params=None):
+ attributes=None, wait_until=False, params=None):
"""Create a zone with the specified parameters.
:param name: The name of the zone.
@@ -34,6 +34,10 @@
Default: Random Value
:param description: A description of the zone.
Default: Random Value
+ :param attributes: Key:Value pairs of information about this zone,
+ and the pool the user would like to place the zone in.
+ This information can be used by the scheduler to place
+ zones on the correct pool.
:param wait_until: Block until the zone reaches the desiered status
:param params: A Python dict that represents the query paramaters to
include in the request URI.
@@ -44,6 +48,8 @@
'email': email or dns_data_utils.rand_email(),
'ttl': ttl or dns_data_utils.rand_ttl(),
'description': description or data_utils.rand_name('test-zone'),
+ 'attributes': attributes or {
+ 'attribute_key': data_utils.rand_name('attribute_value')}
}
resp, body = self._create_request('zones', zone, params=params)
diff --git a/designate_tempest_plugin/tests/api/v2/test_recordset.py b/designate_tempest_plugin/tests/api/v2/test_recordset.py
index 53d148d..a0e24a8 100644
--- a/designate_tempest_plugin/tests/api/v2/test_recordset.py
+++ b/designate_tempest_plugin/tests/api/v2/test_recordset.py
@@ -435,35 +435,55 @@
recordsets_created = {}
for client in clients_list:
if client == 'primary':
+ # Create a zone and wait till it's ACTIVE
zone = self.zone_client.create_zone()[1]
self.addCleanup(self.wait_zone_delete,
self.zone_client,
zone['id'])
+ waiters.wait_for_zone_status(
+ self.zone_client, zone['id'], 'ACTIVE')
+
+ # Create a recordset and wait till it's ACTIVE
recordset_data = data_utils.rand_recordset_data(
record_type='A', zone_name=zone['name'])
resp, body = self.client.create_recordset(
zone['id'], recordset_data)
self.assertEqual('PENDING', body['status'],
'Failed, expected status is PENDING')
- waiters.wait_for_zone_status(
- self.zone_client, zone['id'], 'ACTIVE')
+ LOG.info('Wait until the recordset is active')
+ waiters.wait_for_recordset_status(
+ self.client, zone['id'],
+ body['id'], 'ACTIVE')
+
+ # Add "project_id" into the recordset_data
recordset_data['project_id'] = zone['project_id']
recordsets_created['primary'] = recordset_data
+
if client == 'alt':
+ # Create a zone and wait till it's ACTIVE
alt_zone = self.alt_zone_client.create_zone()[1]
self.addCleanup(self.wait_zone_delete,
self.alt_zone_client,
alt_zone['id'])
+ waiters.wait_for_zone_status(
+ self.alt_zone_client, alt_zone['id'], 'ACTIVE')
+
+ # Create a recordset and wait till it's ACTIVE
recordset_data = data_utils.rand_recordset_data(
record_type='A', zone_name=alt_zone['name'])
resp, body = self.alt_client.create_recordset(
alt_zone['id'], recordset_data)
self.assertEqual('PENDING', body['status'],
'Failed, expected status is PENDING')
- waiters.wait_for_zone_status(
- self.alt_zone_client, alt_zone['id'], 'ACTIVE')
+ LOG.info('Wait until the recordset is active')
+ waiters.wait_for_recordset_status(
+ self.alt_client, alt_zone['id'],
+ body['id'], 'ACTIVE')
+
+ # Add "project_id" into the recordset_data
recordset_data['project_id'] = alt_zone['project_id']
recordsets_created['alt'] = recordset_data
+
return recordsets_created
@decorators.idempotent_id('9c0f58ad-1b31-4899-b184-5380720604e5')