From 7e1176b3f2626b4d0c9c1f74c12e8c4353a8af56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicki=20K=C5=99=C3=AD=C5=BEek?= Date: Thu, 27 Nov 2025 13:58:28 +0100 Subject: [PATCH 1/3] Remove obsolete checks for PYTHON executable Python has been required to run the system test suite for quite a while. Remove the dated checks inside system tests which are no longer needed. (cherry picked from commit fe92341fd3fc3e4c02bf316bdd337308569fa538) --- bin/tests/system/digdelv/tests.sh | 4 +-- bin/tests/system/dnstap/tests.sh | 4 +-- bin/tests/system/doth/tests.sh | 24 ++++++------------ bin/tests/system/kasp.sh | 41 ++++++++++++++----------------- 4 files changed, 28 insertions(+), 45 deletions(-) diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index 899aa513cb..265366a247 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -69,9 +69,7 @@ KEYDATA="$(sed /dev/null && HAS_PYYAML=1 -fi +$PYTHON -c "import yaml" 2>/dev/null && HAS_PYYAML=1 # # test whether ans7/ans.pl will be able to send a UPDATE response. diff --git a/bin/tests/system/dnstap/tests.sh b/bin/tests/system/dnstap/tests.sh index 261384fd1f..d4bcdd30ea 100644 --- a/bin/tests/system/dnstap/tests.sh +++ b/bin/tests/system/dnstap/tests.sh @@ -549,9 +549,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) HAS_PYYAML=0 -if [ -x "$PYTHON" ]; then - $PYTHON -c "import yaml" 2>/dev/null && HAS_PYYAML=1 -fi +$PYTHON -c "import yaml" 2>/dev/null && HAS_PYYAML=1 if [ $HAS_PYYAML -ne 0 ]; then echo_i "checking dnstap-read YAML output" diff --git a/bin/tests/system/doth/tests.sh b/bin/tests/system/doth/tests.sh index 3559c6757c..753cc0f8d8 100644 --- a/bin/tests/system/doth/tests.sh +++ b/bin/tests/system/doth/tests.sh @@ -22,11 +22,9 @@ msg_peer_verification_failed=";; TLS peer certificate verification" ca_file="./CA/CA.pem" -if [ -x "$PYTHON" ]; then - OPENSSL_VERSION=$("$PYTHON" "$TOP_SRCDIR/bin/tests/system/doth/get_openssl_version.py") - OPENSSL_VERSION_MAJOR=$(echo "$OPENSSL_VERSION" | cut -d ' ' -f 1) - OPENSSL_VERSION_MINOR=$(echo "$OPENSSL_VERSION" | cut -d ' ' -f 2) -fi +OPENSSL_VERSION=$("$PYTHON" "$TOP_SRCDIR/bin/tests/system/doth/get_openssl_version.py") +OPENSSL_VERSION_MAJOR=$(echo "$OPENSSL_VERSION" | cut -d ' ' -f 1) +OPENSSL_VERSION_MINOR=$(echo "$OPENSSL_VERSION" | cut -d ' ' -f 2) # According to the RFC 8310, Section 8.1, Subject field MUST # NOT be inspected when verifying a hostname when using @@ -43,12 +41,10 @@ fi # On the platforms with too old TLS versions, e.g. RedHat 7, we should # ignore the tests checking the correct handling of absence of # SubjectAltName. -if [ -n "$OPENSSL_VERSION" ]; then - if [ $OPENSSL_VERSION_MAJOR -gt 1 ]; then - run_san_tests=1 - elif [ $OPENSSL_VERSION_MAJOR -eq 1 ] && [ $OPENSSL_VERSION_MINOR -ge 1 ]; then - run_san_tests=1 - fi +if [ $OPENSSL_VERSION_MAJOR -gt 1 ]; then + run_san_tests=1 +elif [ $OPENSSL_VERSION_MAJOR -eq 1 ] && [ $OPENSSL_VERSION_MINOR -ge 1 ]; then + run_san_tests=1 fi dig_with_tls_opts() { @@ -843,11 +839,7 @@ test_opcodes FORMERR 4 5 n=$((n + 1)) echo_i "checking server quotas for both encrypted and unencrypted HTTP ($n)" ret=0 -if [ -x "$PYTHON" ]; then - BINDHOST="10.53.0.1" "$PYTHON" "$TOP_SRCDIR/bin/tests/system/doth/stress_http_quota.py" || ret=$? -else - echo_i "Python is not available. Skipping the test..." -fi +BINDHOST="10.53.0.1" "$PYTHON" "$TOP_SRCDIR/bin/tests/system/doth/stress_http_quota.py" || ret=$? if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) diff --git a/bin/tests/system/kasp.sh b/bin/tests/system/kasp.sh index 636d3c4da2..be0f6082b7 100644 --- a/bin/tests/system/kasp.sh +++ b/bin/tests/system/kasp.sh @@ -299,12 +299,11 @@ set_keytime() { # $3: Value # $4: Additional time. set_addkeytime() { - if [ -x "$PYTHON" ]; then - # Convert "%Y%m%d%H%M%S" format to epoch seconds. - # Then, add the additional time (can be negative). - _value=$3 - _plus=$4 - $PYTHON >python.out.$ZONE.$1.$2 <python.out.$ZONE.$1.$2 < Date: Thu, 27 Nov 2025 14:00:21 +0100 Subject: [PATCH 2/3] Remove extraneous prerequisite script for timeouts test The timeouts test already checks for dnspython>=2.0.0 in test_tcp_timeouts.py and the prereq.sh file is not needed. (cherry picked from commit 156b213d620b445f4c6539671a9139a57b927d3a) --- bin/tests/system/timeouts/prereq.sh | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 bin/tests/system/timeouts/prereq.sh diff --git a/bin/tests/system/timeouts/prereq.sh b/bin/tests/system/timeouts/prereq.sh deleted file mode 100644 index a37df94a09..0000000000 --- a/bin/tests/system/timeouts/prereq.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# 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. - -. ../conf.sh - -if test -n "$PYTHON"; then - if $PYTHON -c "from dns.query import send_tcp" 2>/dev/null; then - : - else - echo_i "This test requires the dnspython >= 2.0.0 module." >&2 - exit 1 - fi -else - echo_i "This test requires Python and the dnspython module." >&2 - exit 1 -fi - -exit 0 From 5f492f478c7b7963452b6925e4e3c67165007315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicki=20K=C5=99=C3=AD=C5=BEek?= Date: Thu, 27 Nov 2025 14:13:32 +0100 Subject: [PATCH 3/3] Remove obsolete dnspython prerequisite checks dnspython has been mandatory to run system test for quite a while. Remove all extraneous checks for this module from prereq.sh scipts. (cherry picked from commit b1ffc80f26cd22af2002e524d2f10c2a7d40f0ee) --- bin/tests/system/chain/prereq.sh | 5 ----- bin/tests/system/cookie/prereq.sh | 21 --------------------- bin/tests/system/digdelv/prereq.sh | 5 ----- bin/tests/system/dnssec/prereq.sh | 5 ----- bin/tests/system/forward/prereq.sh | 5 ----- bin/tests/system/qmin/prereq.sh | 21 --------------------- 6 files changed, 62 deletions(-) delete mode 100644 bin/tests/system/cookie/prereq.sh delete mode 100644 bin/tests/system/qmin/prereq.sh diff --git a/bin/tests/system/chain/prereq.sh b/bin/tests/system/chain/prereq.sh index fe84055246..0d6e2b45d4 100644 --- a/bin/tests/system/chain/prereq.sh +++ b/bin/tests/system/chain/prereq.sh @@ -13,11 +13,6 @@ . ../conf.sh -if ! ${PYTHON} -c 'import dns'; then - echo_i "python dns module is required" - exit 1 -fi - if ! ${PERL} -MNet::DNS -e ''; then echo_i "perl Net::DNS module is required" exit 1 diff --git a/bin/tests/system/cookie/prereq.sh b/bin/tests/system/cookie/prereq.sh deleted file mode 100644 index b6b005f8ff..0000000000 --- a/bin/tests/system/cookie/prereq.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# 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. - -. ../conf.sh - -if ! ${PYTHON} -c 'import dns'; then - echo_i "python dns module is required" - exit 1 -fi - -exit 0 diff --git a/bin/tests/system/digdelv/prereq.sh b/bin/tests/system/digdelv/prereq.sh index 32889aa251..c52be9c97a 100644 --- a/bin/tests/system/digdelv/prereq.sh +++ b/bin/tests/system/digdelv/prereq.sh @@ -13,11 +13,6 @@ . ../conf.sh -if ! ${PYTHON} -c 'import dns'; then - echo_i "python dns module is required" - exit 1 -fi - if ! ${PERL} -MNet::DNS -e ''; then echo_i "perl Net::DNS module is required" exit 1 diff --git a/bin/tests/system/dnssec/prereq.sh b/bin/tests/system/dnssec/prereq.sh index 32889aa251..c52be9c97a 100644 --- a/bin/tests/system/dnssec/prereq.sh +++ b/bin/tests/system/dnssec/prereq.sh @@ -13,11 +13,6 @@ . ../conf.sh -if ! ${PYTHON} -c 'import dns'; then - echo_i "python dns module is required" - exit 1 -fi - if ! ${PERL} -MNet::DNS -e ''; then echo_i "perl Net::DNS module is required" exit 1 diff --git a/bin/tests/system/forward/prereq.sh b/bin/tests/system/forward/prereq.sh index 32889aa251..c52be9c97a 100644 --- a/bin/tests/system/forward/prereq.sh +++ b/bin/tests/system/forward/prereq.sh @@ -13,11 +13,6 @@ . ../conf.sh -if ! ${PYTHON} -c 'import dns'; then - echo_i "python dns module is required" - exit 1 -fi - if ! ${PERL} -MNet::DNS -e ''; then echo_i "perl Net::DNS module is required" exit 1 diff --git a/bin/tests/system/qmin/prereq.sh b/bin/tests/system/qmin/prereq.sh deleted file mode 100644 index b6b005f8ff..0000000000 --- a/bin/tests/system/qmin/prereq.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# 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. - -. ../conf.sh - -if ! ${PYTHON} -c 'import dns'; then - echo_i "python dns module is required" - exit 1 -fi - -exit 0