]> 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, 27 Oct 2022 11:24:52 +0000 (13:24 +0200)
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 5877e548a9ae28ef0df539edcee611e09c92c5ed..bb78122634003438240e50032acc8b6c0d5be11b 100644 (file)
@@ -269,24 +269,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.
 # also update common/rndc.conf and common/rndc.key when updating DEFAULT_HMAC
index 993240115a3c42fa11f2098c79b31b17ff43269b..6309e4d49fbee557cc2093fae6ccf2412111e203 100644 (file)
@@ -23,9 +23,6 @@ export TOP_SRCDIR=@abs_top_srcdir@
 # Provide TMPDIR variable for tests that need it.
 export TMPDIR=${TMPDIR:-/tmp}
 
-# Load common values
-. $TOP_SRCDIR/bin/tests/system/conf.sh.common
-
 export ARPANAME=$TOP_BUILDDIR/bin/tools/arpaname
 export CDS=$TOP_BUILDDIR/bin/dnssec/dnssec-cds
 export CHECKCONF=$TOP_BUILDDIR/bin/check/named-checkconf
@@ -70,6 +67,9 @@ export KRB5_CONFIG=/dev/null
 # use local keytab instead of default /etc/krb5.keytab
 export KRB5_KTNAME=dns.keytab
 
+# Load common values
+. $TOP_SRCDIR/bin/tests/system/conf.sh.common
+
 #
 # Construct the lists of tests to run
 #