]> git.ipfire.org Git - thirdparty/bind9.git/commit
Rewrite xfer/ans11/ans.py to use AsyncDnsServer
authorNicki Křížek <nicki@isc.org>
Thu, 2 Apr 2026 12:40:25 +0000 (12:40 +0000)
committerAram Sargsyan <aram@isc.org>
Fri, 3 Apr 2026 11:01:34 +0000 (11:01 +0000)
commit187e571f4d21a13508bf6cda9ff09c5ce8a67dca
treea9120261298c9ff4e60f6e301181e2d8f890fec4
parent141ff7bfa7bf97b5d2b55a8417c847ac81ca5bc1
Rewrite xfer/ans11/ans.py to use AsyncDnsServer

Replace the hand-rolled threaded socket server with the standard
AsyncDnsServer framework used by other ans.py servers in the test suite.

The DNS wire-format message builders (IXFR diff, AXFR, SOA, SERVFAIL)
are retained unchanged since they produce carefully crafted messages
needed to trigger the IXFR->AXFR race condition. The server
infrastructure is replaced:

- Manual TCP/UDP socket management and threading replaced by
  AsyncDnsServer, which handles both protocols, pidfile lifecycle,
  and signal handling.
- Query parsing replaced by the framework's dns.message-based parser;
  query dispatch moved into IxfrRaceHandler.get_responses().
- The axfr_done_event threading.Event replaced by a boolean instance
  variable on IxfrRaceHandler, safe within the single asyncio event
  loop.
- For IXFR over TCP, the handler yields two BytesResponseSend actions
  (msg1 then msg2) so the framework sends both with TCP length prefixes,
  preserving the race-triggering sequence.
- For IXFR over UDP, the TC flag is set on the response to force TCP
  retry.
- Unused encode_name_compressed() and parse_dns_query() removed.

Also fix a timing issue that might result in the initial transfer not
being done by the time the test is executed -- since ns11 is started
after ns6. Ensure the initial transfer has happened before running the
ixfr_race test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bin/tests/system/xfer/ans11/ans.py
bin/tests/system/xfer/tests_xfer.py