From: Nicki Křížek Date: Fri, 10 Jul 2026 11:50:51 +0000 (+0000) Subject: Mark each test's boundaries in the named instance logs X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=e942d0dcf5bb51f9c1e89a489516faa06d2d28df;p=thirdparty%2Fbind9.git Mark each test's boundaries in the named instance logs Send an `rndc null` command with a test ID marker at the start and end of each test function to all named instances. This makes it easy to identify the precise point where each test was executed when reading the named logs. This becomes especially useful for modules which run multiple test functions, since those are executed on the same named instances. Assisted-by: Claude:claude-fable-5 --- diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 3339eacd972..07b7928e6bb 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -295,6 +295,31 @@ def wait_for_zones_loaded(request, servers): watcher.wait_for_line("all zones loaded") +@pytest.fixture(autouse=True) +def named_log_test_markers(request, servers): + """Send `rndc null` message with a test ID to each named instance.""" + + def mark(event): + for server in servers.values(): + if not isinstance(server, isctest.instance.NamedInstance): + continue + try: + with server.rndc_client(timeout=2) as c: + c.call(f"null ------ {event} {request.node.nodeid} ------") + except ( + OSError, + isctest.rndc.RNDCException, + isctest.rndc.RNDCProtocolError, + ): + # best-effort: the instance may be stopped or use a + # non-standard control channel + pass + + mark("BEGIN") + yield + mark("END") + + @pytest.fixture(scope="module", autouse=True) def configure_algorithm_set(request): """Configure the algorithm set to use in tests."""