]> 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 10:14:29 +0000 (12:14 +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.

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

index 165b2b1152b452e1341550d6e24dde9b6a0fbc96..b10cfeff07b81fd996799c29e5d9f69eff757b47 100644 (file)
@@ -262,24 +262,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 70edf5bc3e1aa50c6b4f040049d2c063c23ed877..a41ac10b631acf1e2599a7b2245941dc7fa9d68c 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
@@ -69,6 +66,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
 #