From 46e27d39260ef3dfc95065ee3110d40807e950d4 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Thu, 25 Aug 2016 11:52:23 +0100 Subject: [PATCH] Add tests for wildcard RRSets Port tests for wildcard recordsets from old functional tests Change-Id: I587aced635f869ef828b31e35095a019154abf3b --- .../tests/api/v2/recordset_wildcard_data.json | 53 +++++++++++++++++++ .../tests/api/v2/test_recordset.py | 22 ++++++++ 2 files changed, 75 insertions(+) create mode 100644 designate_tempest_plugin/tests/api/v2/recordset_wildcard_data.json diff --git a/designate_tempest_plugin/tests/api/v2/recordset_wildcard_data.json b/designate_tempest_plugin/tests/api/v2/recordset_wildcard_data.json new file mode 100644 index 00000000..dedf414a --- /dev/null +++ b/designate_tempest_plugin/tests/api/v2/recordset_wildcard_data.json @@ -0,0 +1,53 @@ +{ + "A at APEX": { + "name": "*", + "type": "A", + "records": ["192.0.2.1", "192.0.2.2", "192.0.2.3"] + }, + "A under APEX": { + "name": "*.sub", + "type": "A", + "records": ["192.0.2.1", "192.0.2.2", "192.0.2.3"] + }, + "AAAA at APEX": { + "name": "*", + "type": "AAAA", + "records": ["2001:db8::1", "2001:db8::1", "2001:db8::"] + }, + "AAAA under APEX": { + "name": "*.sub", + "type": "AAAA", + "records": ["2001:db8::1", "2001:db8::1", "2001:db8::"] + }, + "MX at APEX": { + "name": "*", + "type": "MX", + "records": ["10 mail1.example.org.", + "20 mail2.example.org."] + }, + "MX under APEX": { + "name": "*.sub", + "type": "MX", + "records": ["10 mail.example.org."] + }, + "SPF at APEX": { + "name": "*", + "type": "SPF", + "records": ["v=spf1; a -all"] + }, + "SPF under APEX": { + "name": "*.sub", + "type": "SPF", + "records": ["v=spf1; a -all"] + }, + "TXT at APEX": { + "name": "*", + "type": "TXT", + "records": ["Can you read me?"] + }, + "TXT under APEX": { + "name": "*.sub", + "type": "TXT", + "records": ["Can you read me?"] + } +} diff --git a/designate_tempest_plugin/tests/api/v2/test_recordset.py b/designate_tempest_plugin/tests/api/v2/test_recordset.py index a4b50e3e..44ac45ba 100644 --- a/designate_tempest_plugin/tests/api/v2/test_recordset.py +++ b/designate_tempest_plugin/tests/api/v2/test_recordset.py @@ -91,6 +91,28 @@ class RecordsetsTest(BaseRecordsetsTest): LOG.info('Ensure we respond with PENDING') self.assertEqual('PENDING', body['status']) + @decorators.idempotent_id('69f002e5-6511-43d3-abae-7abdd45ae03e') + @ddt.file_data("recordset_wildcard_data.json") + def test_create_wildcard_recordset(self, name, type, records): + if name is not None: + recordset_name = name + "." + self.zone['name'] + + else: + recordset_name = "*." + self.zone['name'] + + recordset_data = { + 'name': recordset_name, + 'type': type, + 'records': records, + } + + LOG.info('Create a Recordset') + resp, body = self.client.create_recordset( + self.zone['id'], recordset_data) + + LOG.info('Ensure we respond with PENDING') + self.assertEqual('PENDING', body['status']) + @decorators.idempotent_id('5964f730-5546-46e6-9105-5030e9c492b2') def test_list_recordsets(self): recordset_data = data_utils.rand_recordset_data(