Merge "Add tests for wildcard RRSets"

This commit is contained in:
Jenkins 2016-09-20 10:42:10 +00:00 committed by Gerrit Code Review
commit 5fde0854fc
2 changed files with 75 additions and 0 deletions

View File

@ -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?"]
}
}

View File

@ -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(