Commit 85b2f230 authored by Daniel Salzman's avatar Daniel Salzman

tests-extra: add new zone/load refresh test

parent 8cdec875
#!/usr/bin/env python3
'''Test for slave zone refresh when loading.'''
from dnstest.test import Test
from dnstest.utils import *
t = Test()
master = t.server("knot")
slave = t.server("knot")
slave.disable_notify = True
zone_del = t.zone_rnd(1, dnssec=False)
zone_upd = t.zone_rnd(1, dnssec=False)
zones = zone_del + zone_upd, master, slave)
serial_del_init = master.zone_wait(zone_del)
serial_upd_init = master.zone_wait(zone_upd)
# Update a zonefile on the master.
master.update_zonefile(zone_upd, random=True)
# Remove a zonefile on the slave.
slave.clean(zone=zone_del, timers=False)
# Check for immediate zone transfer if deleted.
slave.zone_wait(zone_del, serial=serial_del_init, equal=True, greater=False)
# Check for untouched zone if retransfer already scheduled.
serial_upd = slave.zone_wait(zone_upd)
master.zone_wait(zone_upd, serial_upd, equal=False, greater=True)
......@@ -663,6 +663,8 @@ class Server(object):
def clean(self, zone=True, timers=True):
if zone:
zone = zone_arg_check(zone)
# Remove all zonefiles.
if zone is True:
for _z in sorted(self.zones):
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