]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Set algorithms for system tests at runtime
authorTom Krizek <tkrizek@isc.org>
Wed, 26 Oct 2022 15:38:32 +0000 (17:38 +0200)
committerTom Krizek <tkrizek@isc.org>
Tue, 1 Nov 2022 18:51:52 +0000 (19:51 +0100)
Use the get_algorithms.py script to detect supported algorithms and
select random algorithms to use for the tests.

Make sure to load common.conf.sh after KEYGEN env var is exported.

(cherry picked from commit 69b608ee9f90af0a351c176167825bfc335b982d)

bin/tests/system/conf.sh.common
bin/tests/system/conf.sh.in

index 298126418ba5ac418058e8bca17e3dcc417b0bd5..6d890b1a539a95d0e3e0bff4052fb173bb530d3c 100644 (file)
@@ -279,24 +279,33 @@ send() {
 # Useful variables in test scripts
 #
 
+# The following script sets the following algorithm-related variables. These
+# are selected randomly at runtime from a list of supported algorithms. The
+# randomization is deterministic and remains stable for a period of time for a
+# given platform.
+#
 # Default algorithm for testing.
-export DEFAULT_ALGORITHM=ECDSAP256SHA256
-export DEFAULT_ALGORITHM_NUMBER=13
-export DEFAULT_BITS=256
-
-# This is an alternative algorithm for test cases that require more than
-# one algorithm (for example algorithm rollover).  Must be different from
+# DEFAULT_ALGORITHM
+# DEFAULT_ALGORITHM_NUMBER
+# DEFAULT_BITS
+#
+# This is an alternative algorithm for test cases that require more than one
+# algorithm (for example algorithm rollover). Must be different from
 # DEFAULT_ALGORITHM.
-export ALTERNATIVE_ALGORITHM=RSASHA256
-export ALTERNATIVE_ALGORITHM_NUMBER=8
-export ALTERNATIVE_BITS=1280
-
-# This is an algorithm that is used for tests against the
-# "disable-algorithms" configuration option.  Must be different from above
-# algorithms.
-export DISABLED_ALGORITHM=ECDSAP384SHA384
-export DISABLED_ALGORITHM_NUMBER=14
-export DISABLED_BITS=384
+# ALTERNATIVE_ALGORITHM
+# ALTERNATIVE_ALGORITHM_NUMBER
+# ALTERNATIVE_BITS
+#
+# This is an algorithm that is used for tests against the "disable-algorithms"
+# configuration option. Must be different from above algorithms.
+# DISABLED_ALGORITHM
+# DISABLED_ALGORITHM_NUMBER
+# DISABLED_BITS
+#
+# There are multiple algoritms sets to choose from (see get_algorithms.py). To
+# override the default choice, set the ALGORITHM_SET env var (see mkeys system
+# test for example).
+eval "$($PYTHON "$TOP_SRCDIR/bin/tests/system/get_algorithms.py")"
 
 # Default HMAC algorithm.
 export DEFAULT_HMAC=hmac-sha256
index bde33520a8c4798bfb539331ed11e4e71776aac7..a6edf0e91cc5da7ea86617354ff78a0d96b0e625 100644 (file)
@@ -26,9 +26,6 @@ export TMPDIR=${TMPDIR:-/tmp}
 # This is not the windows build.
 export CYGWIN=""
 
-# Load common values shared between windows and unix/linux.
-. $TOP/bin/tests/system/conf.sh.common
-
 export ARPANAME=$TOP/bin/tools/arpaname
 export CDS=$TOP/bin/dnssec/dnssec-cds
 export CHECKCONF=$TOP/bin/check/named-checkconf
@@ -80,6 +77,9 @@ export KRB5_CONFIG=/dev/null
 # use local keytab instead of default /etc/krb5.keytab
 export KRB5_KTNAME=dns.keytab
 
+# Load common values shared between windows and unix/linux.
+. $TOP/bin/tests/system/conf.sh.common
+
 #
 # Construct the lists of tests to run
 #