Commit f999bc96 authored by godog's avatar godog

zone_test: add recursive extend test

parent dd88c5ce
Pipeline #1996 failed with stage
in 25 seconds
......@@ -16,13 +16,13 @@ autistici.org:
- 82.94.249.234
- 82.221.99.153
www: "$FRONTENDS"
''',
''',
'''
"@default":
_:
- NS ns1.autistici.org.
- NS ns2.autistici.org.
''',
''',
'''
"@default":
onion:
......@@ -59,6 +59,32 @@ autistici.org:
''',
]
TEST_DATA_4 = [
'''
autistici.org:
EXTENDS:
- "@default"
_:
- 1.1.1.3
www: CNAME "www.l.autistici.org"
''',
'''
"@default":
EXTENDS:
- "@base"
_:
- 1.1.1.2
- NS ns2.autistici.org.
''',
'''
"@base":
_:
- 1.1.1.1
- MX 10 $FRONTENDS
- NS ns1.autistici.org.
''',
]
TEST_CONFIG = {
'FRONTENDS': ['82.94.249.234', '82.221.99.153'],
}
......@@ -133,6 +159,14 @@ www IN A 82.94.249.234
num_ns = len(filter(lambda x: x.startswith('NS '), result[0][1]['_']))
self.assertEquals(num_ns, 2)
def test_recursive_extend(self):
self.zp.load(_loadyaml(TEST_DATA_4))
result = list(self.zp.render())
self.assertTrue(result)
for frontend in TEST_CONFIG['FRONTENDS']:
self.assertIn('MX 10 %s' % frontend, result[0][1]['_'])
self.assertEquals('autistici.org', result[0][0])
class ZoneWriterTestBase(unittest.TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment