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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user