knot-dns/tests-extra/tests/notify/ctl/test.py
Josh Soref 43db89b880 spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-11-24 12:55:47 +01:00

42 lines
760 B
Python

#!/usr/bin/env python3
'''Test for knotc zone-notify'''
from dnstest.test import Test
t = Test()
master = t.server("knot")
slave = t.server("knot")
zone = t.zone("notify.", storage=".")
t.link(zone, master, slave)
t.start()
master.zone_wait(zone)
slave.zone_wait(zone)
slave.stop()
master.update_zonefile(zone, version=1) # notify doesn't succeed while slave is offline
master.reload()
master.zone_wait(zone)
slave.start() # slave starts with older version of zone and doesn't attempt refresh since it's in timers
slave.zone_wait(zone)
resp = slave.dig("node.notify.", "A")
resp.check(rcode="NXDOMAIN")
master.ctl("zone-notify", wait=True)
t.sleep(2)
resp = slave.dig("node.notify.", "A")
resp.check(rcode="NOERROR", rdata="1.2.3.4")
t.end()