]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove obsolete copy_setports
authorNicki Křížek <nicki@isc.org>
Fri, 5 Dec 2025 14:30:09 +0000 (15:30 +0100)
committerNicki Křížek <nicki@isc.org>
Tue, 9 Dec 2025 13:23:17 +0000 (14:23 +0100)
This function is no longer needed and jinja2 templates are universally
used instead.

bin/tests/system/README.md
bin/tests/system/conf.sh

index ee5ce8efc1c3efc652e25bf38cb9a9d2fc7bed5f..3ebc33dbef3306568de4558a1bbcb78021e63c08 100644 (file)
@@ -242,41 +242,6 @@ This script is responsible for setting up the configuration files used in the
 test. It is used by both the python and shell tests. It is interpreted just
 before the servers are started up for each test module.
 
-To cope with the varying port number, ports are not hard-coded into
-configuration files (or, for that matter, scripts that emulate nameservers).
-Instead, setup.sh is responsible for editing the configuration files to set the
-port numbers.
-
-To do this, configuration files should be supplied in the form of templates
-containing tokens identifying ports.  The tokens have the same name as the
-environment variables listed above, but are prefixed and suffixed by the "@"
-symbol.  For example, a fragment of a configuration file template might look
-like:
-
-    controls {
-        inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
-    };
-
-    options {
-        query-source address 10.53.0.1;
-        notify-source 10.53.0.1;
-        transfer-source 10.53.0.1;
-        port @PORT@;
-        allow-new-zones yes;
-    };
-
-setup.sh should copy the template to the desired filename using the
-"copy_setports" shell function defined in "conf.sh", i.e.
-
-    copy_setports ns1/named.conf.in ns1/named.conf
-
-This replaces tokens like @PORT@ with the contents of the environment variables
-listed above. setup.sh should do this for all configuration files required when
-the test starts.
-
-("setup.sh" should also use this method for replacing the tokens in any Perl or
-Python name servers used in the test.)
-
 ### tests_*.py
 
 These are test modules containing tests written in python. Every test is a
index ea61b6bbb2e55ff9e97b59f5e524679c01e89387..c4b90a4bbb3734d7271815e426ba07fc683f2ac6 100644 (file)
@@ -497,49 +497,4 @@ get_named_xfer_stats() {
     | sed -n "s/.* '${ZONE}\/.* \([0-9][0-9]*\) bytes.*/bytes=\1/p" | tail -1
 }
 
-# copy_setports - Copy Configuration File and Replace Ports
-#
-# Convenience function to copy a configuration file, replacing the tokens
-# QUERYPORT, CONTROLPORT and EXTRAPORT[1-8] with the values of the equivalent
-# environment variables. (These values are set by test runner, which calls the
-# scripts invoking this function.)
-#
-# Usage:
-#   copy_setports infile outfile
-#
-copy_setports() {
-  dir=$(echo "$TMPDIR" | sed 's/\//\\\//g')
-  # Use comma instead of slash for directory substitution
-  sed -e "s/@TMPDIR@/${dir}/g" \
-    -e "s,@TOP_BUILDDIR@,${TOP_BUILDDIR},g" \
-    -e "s/@PORT@/${PORT}/g" \
-    -e "s/@TLSPORT@/${TLSPORT}/g" \
-    -e "s/@HTTPPORT@/${HTTPPORT}/g" \
-    -e "s/@HTTPSPORT@/${HTTPSPORT}/g" \
-    -e "s/@EXTRAPORT1@/${EXTRAPORT1}/g" \
-    -e "s/@EXTRAPORT2@/${EXTRAPORT2}/g" \
-    -e "s/@EXTRAPORT3@/${EXTRAPORT3}/g" \
-    -e "s/@EXTRAPORT4@/${EXTRAPORT4}/g" \
-    -e "s/@EXTRAPORT5@/${EXTRAPORT5}/g" \
-    -e "s/@EXTRAPORT6@/${EXTRAPORT6}/g" \
-    -e "s/@EXTRAPORT7@/${EXTRAPORT7}/g" \
-    -e "s/@EXTRAPORT8@/${EXTRAPORT8}/g" \
-    -e "s/@CONTROLPORT@/${CONTROLPORT}/g" \
-    -e "s/@DEFAULT_ALGORITHM@/${DEFAULT_ALGORITHM}/g" \
-    -e "s/@DEFAULT_ALGORITHM_NUMBER@/${DEFAULT_ALGORITHM_NUMBER}/g" \
-    -e "s/@DEFAULT_ALGORITHM_DST_NUMBER@/${DEFAULT_ALGORITHM_DST_NUMBER}/g" \
-    -e "s/@DEFAULT_BITS@/${DEFAULT_BITS}/g" \
-    -e "s/@ALTERNATIVE_ALGORITHM@/${ALTERNATIVE_ALGORITHM}/g" \
-    -e "s/@ALTERNATIVE_ALGORITHM_NUMBER@/${ALTERNATIVE_ALGORITHM_NUMBER}/g" \
-    -e "s/@ALTERNATIVE_ALGORITHM_DST_NUMBER@/${ALTERNATIVE_ALGORITHM_DST_NUMBER}/g" \
-    -e "s/@ALTERNATIVE_BITS@/${ALTERNATIVE_BITS}/g" \
-    -e "s/@DEFAULT_HMAC@/${DEFAULT_HMAC}/g" \
-    -e "s/@DISABLED_ALGORITHM@/${DISABLED_ALGORITHM}/g" \
-    -e "s/@DISABLED_ALGORITHM_NUMBER@/${DISABLED_ALGORITHM_NUMBER}/g" \
-    -e "s/@DISABLED_ALGORITHM_NUMBER@/${DISABLED_ALGORITHM_DST_NUMBER}/g" \
-    -e "s/@DISABLED_BITS@/${DISABLED_BITS}/g" \
-    -e "s/@DYLIB@/${DYLIB}/g" \
-    $1 >$2
-}
-
 grep_v() { grep -v "$@" || test $? = 1; }