]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
test/doc: zone-reload -f doesnt reload with -b
authorLibor Peltan <libor.peltan@nic.cz>
Fri, 27 Nov 2020 11:06:51 +0000 (12:06 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Fri, 11 Dec 2020 11:39:05 +0000 (12:39 +0100)
doc/man/knotc.8in
doc/man_knotc.rst
tests-extra/tests/zone/reload/test.py

index e36a266b6fc7c34800888c2a4916b27c242a553e..2cd04e23129f1351be98456d80c39471ca257911 100644 (file)
@@ -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
index 3a40a35a940923f41a4d70dddbf532f4375f53cd..dc872ee8df7ca7aa089307acd4ec4caf58a33500 100644 (file)
@@ -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
index 02a3b7a28aa26b0ace0541e353ad476e619fddc4..73a942f32e5df79abd26049ac6d48d047fb8024c 100644 (file)
@@ -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()