]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove obsolete checks for PYTHON executable
authorNicki Křížek <nicki@isc.org>
Thu, 27 Nov 2025 12:58:28 +0000 (13:58 +0100)
committerNicki Křížek <nicki@isc.org>
Fri, 28 Nov 2025 10:24:11 +0000 (11:24 +0100)
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.

bin/tests/system/digdelv/tests.sh
bin/tests/system/dnstap/tests.sh
bin/tests/system/doth/tests.sh
bin/tests/system/kasp.sh

index 27706388aa347d76121a2eb5803952a1f31a5dc3..6620641c03acddf2ba79e35edfaf01f5677209d2 100644 (file)
@@ -69,9 +69,7 @@ KEYDATA="$(sed <ns2/keydata -e 's/+/[+]/g')"
 NOSPLIT="$(sed <ns2/keydata -e 's/+/[+]/g' -e 's/ //g')"
 
 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
 
 #
 # test whether ans7/ans.pl will be able to send a UPDATE response.
index 261384fd1f2b09764688d991fcd9d8d6548742f6..d4bcdd30ea40461f8c3c8cd4f60406b2f56635d8 100644 (file)
@@ -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"
index 3559c6757cb182bfeb0cfa30dcc0c6c5e0ca258e..753cc0f8d8ca5dc04d8b9cfd4a6a76f5243a583e 100644 (file)
@@ -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))
 
index 636d3c4da224c2cbc25f92ee0322bdd6aa915680..be0f6082b72b9ebc674c85b410fd339acfef52c7 100644 (file)
@@ -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 <<EOF
+  # 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 <<EOF
 from datetime import datetime
 from datetime import timedelta
 _now = datetime.strptime("$_value", "%Y%m%d%H%M%S")
@@ -312,9 +311,8 @@ _delta = timedelta(seconds=$_plus)
 _then = _now + _delta
 print(_then.strftime("%Y%m%d%H%M%S"));
 EOF
-    # Set the expected timing metadata.
-    key_set "$1" "$2" $(cat python.out.$ZONE.$1.$2)
-  fi
+  # Set the expected timing metadata.
+  key_set "$1" "$2" $(cat python.out.$ZONE.$1.$2)
 }
 
 # Set key state metadata. Set to "none" to unset.
@@ -646,20 +644,17 @@ check_timingmetadata() {
 
 check_keytimes() {
   # The script relies on Python to set keytimes.
-  if [ -x "$PYTHON" ]; then
-
-    if [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
-      check_timingmetadata "KEY1"
-    fi
-    if [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
-      check_timingmetadata "KEY2"
-    fi
-    if [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
-      check_timingmetadata "KEY3"
-    fi
-    if [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
-      check_timingmetadata "KEY4"
-    fi
+  if [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
+    check_timingmetadata "KEY1"
+  fi
+  if [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
+    check_timingmetadata "KEY2"
+  fi
+  if [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
+    check_timingmetadata "KEY3"
+  fi
+  if [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
+    check_timingmetadata "KEY4"
   fi
 }