Skip to content
Snippets Groups Projects
Commit 4232da99 authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Added tests for TTL mismatch on zone load.

Both master and slave scenarios. Master should fail, slave should
load the zone.

Later, log messages should be checked too, but that's not possible now.
parent 4e8e5511
No related branches found
No related tags found
No related merge requests found
$ORIGIN ttl-mismatch.
$TTL 3600
@ SOA dns1 hostmaster 2010111201 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
ttl A 192.0.2.1
A 192.0.3.1
7200 A 192.0.4.1
AAAA 2001:DB8::1
AAAA 2001:DB9::1
#!/usr/bin/env python3
'''Test for loading of zone containing mismatched TTLs'''
from dnstest.test import Test
t = Test()
master = t.server("knot")
zone = t.zone("ttl-mismatch", storage=".")
t.link(zone, master)
t.start()
# Just check if the zone was loaded. It should be refused on master.
resp = master.dig(zone, "SOA")
resp.check(rcode="REFUSED", flags="QR", noflags="AA TC AD RA")
t.end()
; This zone file is actually not used in the test,
; it's just a placeholder to distinguish master zone
; and updated slave zone.
$ORIGIN ttl-mismatch.
$TTL 3600
@ SOA dns1 hostmaster 2010111201 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
ttl A 192.0.2.1
A 192.0.3.1
AAAA 2001:DB8::1
AAAA 2001:DB9::1
$ORIGIN ttl-mismatch.
$TTL 3600
@ SOA dns1 hostmaster 2010111201 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
ttl A 192.0.2.1
A 192.0.3.1
7200 A 192.0.4.1
AAAA 2001:DB8::1
AAAA 2001:DB9::1
#!/usr/bin/env python3
'''Test for mismatched TTLs handling on slave zone load.'''
from dnstest.test import Test
t = Test()
master = t.server("dummy")
slave = t.server("knot")
zone = t.zone("ttl-mismatch.", storage=".")
t.link(zone, master, slave)
# Create invalid zone file.
slave.update_zonefile(zone, version=1)
t.start()
t.sleep(1)
t.end()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment