]> 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>
Thu, 22 Dec 2022 14:17:41 +0000 (15:17 +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 54b62ff1d5565e6a9ac9ae003470369680a6f892..97afbfec17bccae54b365d0bc0f71fa5177659f2 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 9377f24ef062121013a9674a8ce0a45cac209f23..644e9a45f4671925d42463461b05e2123a354925 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
 #