diff options
author | Libor Peltan <libor.peltan@nic.cz> | 2024-06-11 15:17:52 +0200 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2024-06-13 21:00:43 +0200 |
commit | 3c9509fdd8f1ba245c24e9784d1b8f3f84899106 (patch) | |
tree | 093ce44e4080f317dfa477bced22b8004ad8da7c /tests-extra/tests | |
parent | contrib: upgrade embedded library ngtcp2 to v1.6.0 (diff) | |
download | knot-3c9509fdd8f1ba245c24e9784d1b8f3f84899106.tar.xz knot-3c9509fdd8f1ba245c24e9784d1b8f3f84899106.zip |
rcu: protect also zonefile flush and XFRout against simultaneous zone CTL update
Diffstat (limited to 'tests-extra/tests')
-rw-r--r-- | tests-extra/tests/ctl/notify_x_upd/test.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests-extra/tests/ctl/notify_x_upd/test.py b/tests-extra/tests/ctl/notify_x_upd/test.py index eee936679..5e33b3715 100644 --- a/tests-extra/tests/ctl/notify_x_upd/test.py +++ b/tests-extra/tests/ctl/notify_x_upd/test.py @@ -1,18 +1,25 @@ #!/usr/bin/env python3 -'''Test of crash when NOTIFY is sent during zone CTL update.''' +'''Test of crash when NOTIFY or flush is executed during zone CTL update.''' from dnstest.utils import * from dnstest.test import Test import random import threading import time +import os + +scenario_flush = random.choice([False, True]) loop_stop = False def background_notify(server, zone_name): + global scenario_flush try: - server.ctl("zone-notify " + zone_name) + if scenario_flush: + server.ctl("-f zone-flush " + zone_name) + else: + server.ctl("zone-notify " + zone_name) except: pass @@ -28,7 +35,7 @@ t = Test() master = t.server("knot") slave = t.server("knot") -zones = t.zone_rnd(1, dnssec=False, records=40) +zones = t.zone_rnd(1, dnssec=False, records=800) t.link(zones, master, slave) ZONE = zones[0].name @@ -40,7 +47,9 @@ try: for i in range(10): master.ctl("zone-begin " + ZONE) - master.ctl("zone-set %s dhowedhhjewodw 3600 A 1.2.3.%d" % (ZONE, i + 1)) + master.ctl("zone-set %s zzzzzzzzzzzzzz%d 3600 A 1.2.3.%d" % (ZONE, i + 1, i + 1)) + if i > 0: + master.ctl("zone-unset %s zzzzzzzzzzzzzz%d A" % (ZONE, i)) master.ctl("zone-commit " + ZONE) finally: loop_stop = True |