Commit c47b4f9d authored by Jan Kadlec's avatar Jan Kadlec

tests-extra: extented restart test, fixed error logging

parent 01254813
......@@ -5,6 +5,22 @@
from dnstest.test import Test
import dnstest.utils
def check_axfr(server, zone):
# Get AXFR
axfr_pre = server.dig(zone[0].name, "AXFR", log_no_sep=True)
# Restart
server.stop()
t.sleep(1)
server.start()
server.zone_wait(zone)
# Get AXFR after restart
axfr_post = server.dig(zone[0].name, "AXFR", log_no_sep=True)
# Compare AXFRs
t.axfr_diff_resp(axfr_pre, axfr_post, server, server, zone[0])
t = Test()
master = t.server("knot")
......@@ -12,39 +28,43 @@ slave = t.server("knot")
# Zone setup
zone = t.zone_rnd(1)
t.link(zone, master, slave, ixfr = True, ddns=True)
t.link(zone, master, slave, ixfr = True)
# Turn automatic DNSSEC on
master.dnssec_enable = True
master.enable_nsec3(zone)
master.gen_key(zone, ksk=True, alg="RSASHA256")
master.gen_key(zone, alg="RSASHA256")
t.start()
# Load zones - master should sign
serial = master.zone_wait(zone)
master.zone_wait(zone)
slave.zone_wait(zone)
# Get AXFR from master
axfr_pre = master.dig(zone[0].name, "AXFR", log_no_sep=True)
# Restart and compare AXFRs
master.stop()
master.start()
master.zone_wait(zone)
# Check DNSSEC application
check_axfr(master, zone)
axfr_post = master.dig(zone[0].name, "AXFR", log_no_sep=True)
# Update zone using DDNS
up = master.update(zone)
up.add("test123."+zone[0].name, "3600", "TXT", "test")
up.send("NOERROR")
t.axfr_diff_resp(axfr_pre, axfr_post, zone[0])
# Check DDNS application
check_axfr(master, zone)
serial = master.zone_wait(zone)
serial = slave.zone_wait(zone, serial)
# Update zonefile on master
master.flush()
master.update_zonefile(zone, random=True)
master.reload()
# Wait for changes on slave
# Restart and do an AXFR diff
# Update zone using DDNS
# Stop and start, do an AXFR diff
# Wait for all changes on slave
slave.zone_wait(zone, serial)
# Stop and start the slave server, make sure everything is applied
# Make sure slave applied everything
check_axfr(slave, zone)
master.stop()
slave.stop()
......
......@@ -276,7 +276,7 @@ class Test(object):
return unique, records
def _axfr_diff_resp(self, unique1, rrset1s, unique2, rrsets2):
def _axfr_diff_resp(self, unique1, rrset1s, unique2, rrsets2, server1, server2):
diff1 = sorted(list(unique1 - unique2))
if diff1:
set_err("AXFR DIFF")
......@@ -296,7 +296,7 @@ class Test(object):
unique1, rrsets1 = self._axfr_records(server1.dig(zone.name, "AXFR", log_no_sep=True), zone)
unique2, rrsets2 = self._axfr_records(server2.dig(zone.name, "AXFR", log_no_sep=True), zone)
self._axfr_diff_resp(unique1, rrsets1, unique2, rrsets2)
self._axfr_diff_resp(unique1, rrsets1, unique2, rrsets2, server1, server2)
class IxfrChange():
def __init__(self):
......@@ -455,8 +455,8 @@ class Test(object):
detail_log(SEP)
def axfr_diff_resp(self, resp1, resp2, zone):
def axfr_diff_resp(self, resp1, resp2, server1, server2, zone):
unique1, rrsets1 = self._axfr_records(resp1, zone)
unique2, rrsets2 = self._axfr_records(resp2, zone)
self._axfr_diff_resp(unique1, rrsets1, unique2, rrsets2)
self._axfr_diff_resp(unique1, rrsets1, unique2, rrsets2, server1, server2)
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