mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
TinyDNS SRV support and test coverage
This commit is contained in:
@@ -17,7 +17,7 @@ class TestTinyDnsFileSource(TestCase):
|
||||
def test_populate_normal(self):
|
||||
got = Zone('example.com.', [])
|
||||
self.source.populate(got)
|
||||
self.assertEqual(25, len(got.records))
|
||||
self.assertEqual(28, len(got.records))
|
||||
|
||||
expected = Zone('example.com.', [])
|
||||
for name, data in (
|
||||
@@ -140,6 +140,43 @@ class TestTinyDnsFileSource(TestCase):
|
||||
'values': ['ns5.ns.example.com.', 'ns6.ns.example.com.'],
|
||||
},
|
||||
),
|
||||
(
|
||||
'_a._tcp',
|
||||
{
|
||||
'type': 'SRV',
|
||||
'ttl': 43,
|
||||
'values': [
|
||||
{
|
||||
'priority': 0,
|
||||
'weight': 0,
|
||||
'port': 8888,
|
||||
'target': 'target.srv.example.com.',
|
||||
},
|
||||
{
|
||||
'priority': 10,
|
||||
'weight': 50,
|
||||
'port': 8080,
|
||||
'target': 'target.somewhere.else.',
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
('target.srv', {'type': 'A', 'ttl': 43, 'value': '56.57.58.59'}),
|
||||
(
|
||||
'_b._tcp',
|
||||
{
|
||||
'type': 'SRV',
|
||||
'ttl': 3600,
|
||||
'values': [
|
||||
{
|
||||
'priority': 0,
|
||||
'weight': 0,
|
||||
'port': 9999,
|
||||
'target': 'target.srv.example.com.',
|
||||
}
|
||||
],
|
||||
},
|
||||
),
|
||||
):
|
||||
record = Record.new(expected, name, data)
|
||||
expected.add_record(record)
|
||||
@@ -216,4 +253,4 @@ class TestTinyDnsFileSource(TestCase):
|
||||
got = Zone('example.com.', ['sub'])
|
||||
self.source.populate(got)
|
||||
# we don't see one www.sub.example.com. record b/c it's in a sub
|
||||
self.assertEqual(24, len(got.records))
|
||||
self.assertEqual(27, len(got.records))
|
||||
|
||||
@@ -61,3 +61,9 @@ Ccname.other.foo:www.other.foo
|
||||
6ipv6-6.example.com:2a021348017cd5d0002419fffef35743
|
||||
|
||||
'semicolon.example.com:v=DKIM1; k=rsa; p=blah:300
|
||||
|
||||
# SRV
|
||||
S_a._tcp.example.com:56.57.58.59:target:8888
|
||||
S_a._tcp.example.com::target.somewhere.else:8080:10:50:43
|
||||
# TODO: add an IP so it tries to create a record that already exists
|
||||
S_b._tcp.example.com::target.srv.example.com.:9999
|
||||
|
||||
Reference in New Issue
Block a user