From 0e6c9cae687fbf234d7eb1f388002e484415c05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicki=20K=C5=99=C3=AD=C5=BEek?= Date: Thu, 27 Nov 2025 18:12:55 +0100 Subject: [PATCH] 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 648f2534b1579c3a47c4a223c89db5ef9933c0dc) --- bin/tests/system/digdelv/ans4/ans.py | 25 +++++++++++++++++++++++++ bin/tests/system/digdelv/ans4/startme | 1 - bin/tests/system/digdelv/tests.sh | 2 -- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 bin/tests/system/digdelv/ans4/ans.py delete mode 100644 bin/tests/system/digdelv/ans4/startme diff --git a/bin/tests/system/digdelv/ans4/ans.py b/bin/tests/system/digdelv/ans4/ans.py new file mode 100644 index 0000000000..6f5346ff86 --- /dev/null +++ b/bin/tests/system/digdelv/ans4/ans.py @@ -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() diff --git a/bin/tests/system/digdelv/ans4/startme b/bin/tests/system/digdelv/ans4/startme deleted file mode 100644 index 8b13789179..0000000000 --- a/bin/tests/system/digdelv/ans4/startme +++ /dev/null @@ -1 +0,0 @@ - diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index 265366a247..dee3e96486 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -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" /dev/null && ret=1