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

tests-extra: refresh -f test

parent 082ec6f8
No related branches found
No related tags found
1 merge request!298Forced refresh fix
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111201 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111202 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
new A 1.2.3.4
#!/usr/bin/env python3
'''Test for reload of a changed zone (serial up, nochange, serial down). '''
from dnstest.test import Test
from dnstest.utils import set_err, detail_log
t = Test()
master = t.server("bind")
slave = t.server("knot")
zone = t.zone("example.com.", storage=".")
t.link(zone, master, slave)
# Load newer zone to the slave
slave.update_zonefile(zone, version=1)
t.start()
serials_master = master.zones_wait(zone)
serials_slave = slave.zones_wait(zone)
# Check that the slave's serial is larger than master's
if serials_master["example.com."] >= serials_slave["example.com."]:
set_err("Master has newer or the same zone as slave.")
# Force refresh
slave.ctl("-f refresh example.com.")
serials_slave = slave.zones_wait(zone)
compare(serials_slave["example.com."], serials_master["example.com."], "Forced refresh")
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