From: Libor Peltan Date: Fri, 27 Nov 2020 11:06:51 +0000 (+0100) Subject: test/doc: zone-reload -f doesnt reload with -b X-Git-Tag: v3.1.0~288^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf3fa8bc103b36f2b231e37f9fbcd4a1b58e9f24;p=thirdparty%2Fknot-dns.git test/doc: zone-reload -f doesnt reload with -b --- diff --git a/doc/man/knotc.8in b/doc/man/knotc.8in index e36a266b6f..2cd04e2312 100644 --- a/doc/man/knotc.8in +++ b/doc/man/knotc.8in @@ -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 diff --git a/doc/man_knotc.rst b/doc/man_knotc.rst index 3a40a35a94..dc872ee8df 100644 --- a/doc/man_knotc.rst +++ b/doc/man_knotc.rst @@ -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 diff --git a/tests-extra/tests/zone/reload/test.py b/tests-extra/tests/zone/reload/test.py index 02a3b7a28a..73a942f32e 100644 --- a/tests-extra/tests/zone/reload/test.py +++ b/tests-extra/tests/zone/reload/test.py @@ -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()