1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Root CNAMEs are not allowed

This commit is contained in:
Ross McFarland
2017-06-23 09:49:11 -07:00
parent a69ff64ae1
commit d2af8efe5c
3 changed files with 23 additions and 4 deletions

View File

@@ -1260,8 +1260,10 @@ class TestRoute53Records(TestCase):
False)
self.assertEquals(c, c)
d = _Route53Record(None, Record.new(existing, '',
{'ttl': 42, 'type': 'CNAME',
'value': 'foo.bar.'}),
{'ttl': 42, 'type': 'MX',
'value': {
'priority': 10,
'value': 'foo.bar.'}}),
False)
self.assertEquals(d, d)

View File

@@ -859,15 +859,24 @@ class TestRecordValidation(TestCase):
def test_CNAME(self):
# doesn't blow up
Record.new(self.zone, '', {
Record.new(self.zone, 'www', {
'type': 'CNAME',
'ttl': 600,
'value': 'foo.bar.com.',
})
# missing trailing .
# root cname is a no-no
with self.assertRaises(ValidationError) as ctx:
Record.new(self.zone, '', {
'type': 'CNAME',
'ttl': 600,
'value': 'foo.bar.com.',
})
self.assertEquals(['root CNAME not allowed'], ctx.exception.reasons)
# missing trailing .
with self.assertRaises(ValidationError) as ctx:
Record.new(self.zone, 'www', {
'type': 'CNAME',
'ttl': 600,
'value': 'foo.bar.com',