Skip to content
Snippets Groups Projects
Commit f7bed943 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'fix_test_reload' into 'master'

test/doc: zone-reload -f doesnt reload with -b

See merge request !1222
parents 51930d7b cf3fa8bc
No related branches found
No related tags found
1 merge request!1222test/doc: zone-reload -f doesnt reload with -b
Pipeline #73491 passed
......@@ -99,15 +99,15 @@ Show the zone status. Filters are \fB+role\fP, \fB+serial\fP, \fB+transaction\fP
.TP
\fBzone\-check\fP [\fIzone\fP\&...]
Test if the server can load the zone. Semantic checks are executed if enabled
in the configuration. If invoked with the forced flag, an error is returned
in the configuration. If invoked with the force option, an error is returned
when semantic check warning appears. (*)
.TP
\fBzone\-reload\fP [\fIzone\fP\&...]
Trigger a zone reload from a disk without checking its modification time. For
slave zone, the refresh from a master server is scheduled; for master zone,
the notification of slave servers is scheduled. An open zone transaction
will be aborted! If invoked with the forced flag, also zone modules will be
re\-loaded. (#)
will be aborted! If invoked with the force option, also zone modules will be
re\-loaded, but blocking mode might not work reliably. (#)
.TP
\fBzone\-refresh\fP [\fIzone\fP\&...]
Trigger a check for the zone serial on the zone\(aqs master. If the master has a
......
......@@ -76,15 +76,15 @@ Actions
**zone-check** [*zone*...]
Test if the server can load the zone. Semantic checks are executed if enabled
in the configuration. If invoked with the forced flag, an error is returned
in the configuration. If invoked with the force option, an error is returned
when semantic check warning appears. (*)
**zone-reload** [*zone*...]
Trigger a zone reload from a disk without checking its modification time. For
slave zone, the refresh from a master server is scheduled; for master zone,
the notification of slave servers is scheduled. An open zone transaction
will be aborted! If invoked with the forced flag, also zone modules will be
re-loaded. (#)
will be aborted! If invoked with the force option, also zone modules will be
re-loaded, but blocking mode might not work reliably. (#)
**zone-refresh** [*zone*...]
Trigger a check for the zone serial on the zone's master. If the master has a
......
......@@ -20,30 +20,34 @@ t.start()
# Load zones
serial = master.zone_wait(zone)
def reload_zone(version, exp_serial, exp_version):
def reload_zone(version, exp_serial, exp_version, msg):
master.update_zonefile(zone, version)
if random.random() < 0.5:
opt = random.choice([1, 2, 3])
if opt == 1:
master.reload()
else:
master.ctl(random.choice(["-f", " "]) + " zone-reload " + zone[0].name, wait=True)
if opt == 2:
master.ctl("zone-reload " + zone[0].name, wait=True)
if opt == 3:
master.ctl("-f zone-reload " + zone[0].name, wait=True)
t.sleep(1) # forced zone-reload does *only schedule* LOAD event
new_serial = master.zone_wait(zone)
if new_serial != exp_serial:
set_err("SOA MISMATCH")
set_err("SOA MISMATCH %s (%d)" % (msg, opt))
detail_log("!Zone '%s' SOA serial %s != %s" % (zone[0].name, new_serial, exp_serial))
return
resp = master.dig("new-record%d.%s" % (exp_version, zone[0].name), "A")
resp.check(rcode="NOERROR")
# Zone changes, serial increases (create changeset)
reload_zone(1, serial + 1, 1)
reload_zone(1, serial + 1, 1, "create changeset")
# Zone changes, serial doesn't change (create changeset, increment serial automatically)
reload_zone(2, serial + 2, 2)
reload_zone(2, serial + 2, 2, "auto incremented")
# Zone changes, serial jumps out-of-range (journal is not applicable)
reload_zone(3, serial + 2, 2)
reload_zone(3, serial + 2, 2, "journal not applied")
# Stop master.
master.stop()
......
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