Skip to content
Snippets Groups Projects
Commit 1b1c8949 authored by Libor Peltan's avatar Libor Peltan Committed by Daniel Salzman
Browse files

tests: zone-in-journal added integration test

parent e092fc84
Branches
Tags
1 merge request!661Zone-in-journal
#!/usr/bin/env python3
'''Test of zone-in-journal: AXFR & IXFR to zonefile-less slave'''
from dnstest.test import Test
t = Test()
master = t.server("knot")
slave = t.server("knot")
zone = t.zone("example.com.")
t.link(zone, master, slave)
slave.zonefile_sync = "-1"
t.start()
master.zone_wait(zone)
slave.zone_wait(zone)
# Check if bootstrapped and unflushed zone is accessible without master available.
master.stop()
slave.stop()
t.sleep(2)
slave.start()
slave.zone_wait(zone)
resp = slave.dig("mail.example.com.", "A")
resp.check(rcode="NOERROR", rdata="192.0.2.3")
resp = slave.dig("node.example.com.", "A")
resp.check(rcode="NXDOMAIN", nordata="1.2.3.4")
# Update the master zone and wait for updated slave.
master.start()
serial = master.zone_wait(zone)
up = master.update(zone)
up.add("node.example.com.", 3600, "A", "1.2.3.5")
up.send("NOERROR")
slave.zone_wait(zone, serial)
# Check if the zone with updates is accessible if not flushed and master not available.
master.stop()
slave.stop()
t.sleep(2)
slave.start()
slave.zone_wait(zone)
resp = slave.dig("mail.example.com.", "A")
resp.check(rcode="NOERROR", rdata="192.0.2.3")
resp = slave.dig("node.example.com.", "A")
resp.check(rcode="NOERROR", rdata="1.2.3.5")
t.end()
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