summaryrefslogtreecommitdiffstats
path: root/tests-extra/tests/zone
diff options
context:
space:
mode:
authorLibor Peltan <libor.peltan@nic.cz>2022-04-27 09:50:48 +0200
committerDaniel Salzman <daniel.salzman@nic.cz>2022-04-28 10:02:17 +0200
commit46fd73e36950a2dcfdac336680bb5ad9ee5903aa (patch)
tree4276515bef6d77bb6f2533854c8d429260c523bd /tests-extra/tests/zone
parenttests/catalog: frequent updates to catalog zone (diff)
downloadknot-46fd73e36950a2dcfdac336680bb5ad9ee5903aa.tar.xz
knot-46fd73e36950a2dcfdac336680bb5ad9ee5903aa.zip
zonedb-reload: when recreating zone, replan also refresh...
...as it might be planned by incomming NOTIFY during zonedb-reload and in this case its not in timers
Diffstat (limited to 'tests-extra/tests/zone')
-rw-r--r--tests-extra/tests/zone/reload_notify/test.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests-extra/tests/zone/reload_notify/test.py b/tests-extra/tests/zone/reload_notify/test.py
new file mode 100644
index 000000000..9709ff577
--- /dev/null
+++ b/tests-extra/tests/zone/reload_notify/test.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python3
+
+'''Test race conditions about incomming NOTIFY during zonedb-reload'''
+
+from dnstest.test import Test
+from dnstest.utils import *
+
+import random
+import threading
+
+t = Test()
+
+master = t.server("knot")
+slave = t.server("knot")
+zones = t.zone_rnd(60, dnssec=False, records=10)
+t.link(zones, master, slave, ixfr=True)
+
+t.start()
+
+serials = slave.zones_wait(zones)
+
+def send_reload(server):
+ server.ctl("reload")
+
+def send_update(up):
+ up.send()
+
+for z in zones:
+ up = master.update(z)
+ up.add("dojdojwodijowjeojdwe", 3600, "A", "1.2.3.4")
+
+ threading.Thread(target=send_update, args=[up]).start()
+
+t.sleep(random.choice([0.1, 0.2, 0.5, 1, 2, 4]))
+
+slave.reload()
+
+slave.zones_wait(zones, serials)
+
+t.end()