Merge "Update the constraints url"
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 794fafa..6c8ed07 100644
--- a/designate_tempest_plugin/tests/api/v2/test_transfer_request.py
+++ b/designate_tempest_plugin/tests/api/v2/test_transfer_request.py
@@ -248,6 +248,37 @@
"Failed, transfer request ID:{} wasn't found in "
"listed IDs{}".format(request_id, request_ids))
+ @decorators.idempotent_id('bee42f38-e666-4b85-a710-01f40ea1e56a')
+ def test_list_transfer_requests_impersonate_another_project(self):
+ LOG.info('Create a Primary zone')
+ primary_zone = self.zone_client.create_zone()[1]
+ self.addCleanup(self.wait_zone_delete,
+ self.zone_client, primary_zone['id'])
+
+ LOG.info('Create an Alt zone')
+ alt_zone = self.alt_zone_client.create_zone()[1]
+ self.addCleanup(self.wait_zone_delete,
+ self.alt_zone_client, alt_zone['id'])
+
+ LOG.info('Create a zone transfer_request using Primary client')
+ primary_transfer_request = self.client.create_transfer_request(
+ primary_zone['id'])[1]
+ self.addCleanup(self.client.delete_transfer_request,
+ primary_transfer_request['id'])
+
+ LOG.info('Create a zone transfer_request using Alt client')
+ alt_transfer_request = self.alt_client.create_transfer_request(
+ alt_zone['id'])[1]
+ self.addCleanup(self.alt_client.delete_transfer_request,
+ alt_transfer_request['id'])
+
+ request_ids = [
+ item['id'] for item in self.admin_client.list_transfer_requests(
+ headers={'x-auth-sudo-project-id': self.alt_client.project_id},
+ params={'limit': 1000})[1]['transfer_requests']]
+
+ self.assertEqual([alt_transfer_request['id']], request_ids)
+
@decorators.idempotent_id('de5e9d32-c723-4518-84e5-58da9722cc13')
def test_update_transfer_request(self):
LOG.info('Create a zone')
diff --git a/designate_tempest_plugin/tests/scenario/v2/recordset_data.json b/designate_tempest_plugin/tests/scenario/v2/recordset_data.json
index 9f365a7..3168722 100644
--- a/designate_tempest_plugin/tests/scenario/v2/recordset_data.json
+++ b/designate_tempest_plugin/tests/scenario/v2/recordset_data.json
@@ -48,5 +48,37 @@
"name": "www",
"type": "TXT",
"records": ["\"Any Old Text Goes Here\""]
+ },
+ "SPF": {
+ "name": "*.sub",
+ "type": "SPF",
+ "records": ["\"v=spf1; a -all\""]
+ },
+ "NS": {
+ "name": "NS_Record",
+ "type": "NS",
+ "records": ["ns1.example.org."]
+ },
+ "PTR_IPV4": {
+ "name": "PTR_Record_IPV4",
+ "type": "PTR",
+ "records": ["34.216.184.93.in-addr.arpa."]
+ },
+ "PTR_IPV6":{
+ "name":"PTR_Record_IPV6",
+ "type":"PTR",
+ "records":[
+ "6.4.9.1.8.c.5.2.3.9.8.1.8.4.2.0.1.0.0.0.0.2.2.0.0.0.8.2.6.0.6.2.ip6.arpa."
+ ]
+ },
+ "CAA_Record": {
+ "name": "CAA_Record",
+ "type": "CAA",
+ "records": ["0 issue letsencrypt.org"]
+ },
+ "NAPTR_Record": {
+ "name": "NAPTR_Record",
+ "type": "NAPTR",
+ "records": ["0 0 S SIP+D2U !^.*$!sip:customer-service@example.com! _sip._udp.example.com."]
}
-}
+}
\ No newline at end of file
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py b/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
index 0808f56..4c40c28 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
@@ -27,10 +27,16 @@
@ddt.ddt
class RecordsetsTest(base.BaseDnsV2Test):
+
+ credentials = ["admin", "system_admin", "primary"]
+
@classmethod
def setup_clients(cls):
super(RecordsetsTest, cls).setup_clients()
-
+ if CONF.enforce_scope.designate:
+ cls.admin_client = cls.os_system_admin.dns_v2.RecordsetClient()
+ else:
+ cls.admin_client = cls.os_admin.dns_v2.RecordsetClient()
cls.client = cls.os_primary.dns_v2.ZonesClient()
cls.recordset_client = cls.os_primary.dns_v2.RecordsetClient()
@@ -98,3 +104,21 @@
self.assertRaises(lib_exc.NotFound,
lambda: self.recordset_client.show_recordset(
self.zone['id'], recordset['id']))
+
+ @decorators.idempotent_id('1e78a742-66ee-11ec-8dc3-201e8823901f')
+ def test_create_soa_record_not_permitted(self):
+ # SOA record is automatically created for a zone, no user
+ # should be able to create a SOA record.
+ soa_record = ("s1.devstack.org. admin.example.net. 1510721487 3510"
+ " 600 86400 3600")
+ LOG.info('Primary tries to create a Recordset on '
+ 'the existing zone')
+ self.assertRaises(
+ lib_exc.BadRequest,
+ self.recordset_client.create_recordset,
+ self.zone['id'], soa_record)
+ LOG.info('Admin tries to create a Recordset on the existing zone')
+ self.assertRaises(
+ lib_exc.BadRequest,
+ self.admin_client.create_recordset,
+ self.zone['id'], soa_record)
diff --git a/setup.cfg b/setup.cfg
index 3cf22d8..728e365 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,12 +1,12 @@
[metadata]
name = designate-tempest-plugin
summary = OpenStack DNS As A Service (Designate) Functional Tests
-description-file =
+description_file =
README.rst
author = OpenStack
-author-email = openstack-discuss@lists.openstack.org
-home-page = https://docs.openstack.org/designate-tempest-plugin/latest/
-python-requires = >=3.6
+author_email = openstack-discuss@lists.openstack.org
+home_page = https://docs.openstack.org/designate-tempest-plugin/latest/
+python_requires = >=3.6
classifier =
Environment :: OpenStack
Environment :: No Input/Output (Daemon)