From: Colin Vidal Date: Thu, 30 Apr 2026 13:18:03 +0000 (+0100) Subject: Fix `cyclic_glue` system test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69fad4f7a4cd02a037ecb0e1dd9e1b79c4f384af;p=thirdparty%2Fbind9.git Fix `cyclic_glue` system test The `cyclic_glue` system test was not explicitly waiting for the dump to complete. As a result, the test could read an outdated dump file and perform assertions on database state. Fix this by waiting for `dumpdb` command to finish before reading `named_dump.db`. --- diff --git a/bin/tests/system/cyclic_glue/tests_cyclic_glue.py b/bin/tests/system/cyclic_glue/tests_cyclic_glue.py index ff71db7a6bb..3f52255a5b5 100644 --- a/bin/tests/system/cyclic_glue/tests_cyclic_glue.py +++ b/bin/tests/system/cyclic_glue/tests_cyclic_glue.py @@ -14,7 +14,7 @@ from re import compile as Re import isctest -def run_queries(ns): +def query_and_dump(ns): msg = isctest.query.create("a.foo.test.", "A") res = isctest.query.udp(msg, ns.ip) isctest.check.noerror(res) @@ -23,11 +23,14 @@ def run_queries(ns): res = isctest.query.udp(msg, ns.ip) isctest.check.noerror(res) + with ns.watch_log_from_here() as watcher: + ns.rndc("dumpdb -deleg") + watcher.wait_for_line("dumpdb complete") + return isctest.text.TextFile(f"{ns.identifier}/named_dump.db") + def test_cyclic_glues(ns1, ns4, templates): - run_queries(ns4) - ns4.rndc("dumpdb -deleg") - dump = isctest.text.TextFile("ns4/named_dump.db") + dump = query_and_dump(ns4) # The test is using the correctly-behaving ns2 server. assert len(dump.grep(Re("test. .* DELEG server-ipv4=10.53.0.2"))) == 1 @@ -53,9 +56,7 @@ def test_cyclic_glues(ns1, ns4, templates): ns4.rndc("flush") watcher.wait_for_line("flushing caches in all views succeeded") - run_queries(ns4) - ns4.rndc("dumpdb -deleg") - dump = isctest.text.TextFile("ns4/named_dump.db") + dump = query_and_dump(ns4) # The test is now using the broken ans5 server. assert len(dump.grep(Re("test. [0-9]* DELEG server-ipv4=10.53.0.2"))) == 0