Replace digdelv/ans4 with AsyncDnsServer

Configure the AsyncDnsServer to ignore all queries to ensure the same
behaviour as with "//" command for ans.pl.

(cherry picked from commit 648f2534b1)
This commit is contained in:
Nicki Křížek 2025-11-27 18:12:55 +01:00 committed by Nicki Křížek (GitLab job 6713398)
parent 808e84d1b9
commit 0e6c9cae68
3 changed files with 25 additions and 3 deletions

View file

@ -0,0 +1,25 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from isctest.asyncserver import (
AsyncDnsServer,
IgnoreAllQueries,
)
def main() -> None:
server = AsyncDnsServer()
server.install_response_handler(IgnoreAllQueries())
server.run()
if __name__ == "__main__":
main()

View file

@ -1 +0,0 @@

View file

@ -382,8 +382,6 @@ if [ -x "$DIG" ]; then
n=$((n + 1))
echo_i "checking dig preserves origin on TCP retries ($n)"
ret=0
# Ask ans4 to still accept TCP connections, but not respond to queries
echo "//" | sendcmd 10.53.0.4
dig_with_opts -d +tcp @10.53.0.4 +retry=1 +time=1 +domain=bar foo >dig.out.test$n 2>&1 && ret=1
test "$(grep -c "trying origin bar" dig.out.test$n)" -eq 2 || ret=1
grep "using root origin" <dig.out.test$n >/dev/null && ret=1