From: Nicki Křížek Date: Fri, 5 Dec 2025 14:30:09 +0000 (+0100) Subject: Remove obsolete copy_setports X-Git-Tag: v9.21.17~46^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51ab74db105502ec9856c93b7cb415dc799fae3c;p=thirdparty%2Fbind9.git Remove obsolete copy_setports This function is no longer needed and jinja2 templates are universally used instead. --- diff --git a/bin/tests/system/README.md b/bin/tests/system/README.md index ee5ce8efc1c..3ebc33dbef3 100644 --- a/bin/tests/system/README.md +++ b/bin/tests/system/README.md @@ -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 diff --git a/bin/tests/system/conf.sh b/bin/tests/system/conf.sh index ea61b6bbb2e..c4b90a4bbb3 100644 --- a/bin/tests/system/conf.sh +++ b/bin/tests/system/conf.sh @@ -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; }