From: Tom Krizek Date: Tue, 25 Oct 2022 12:05:07 +0000 (+0200) Subject: Support testcrypto.sh usage without including conf.sh X-Git-Tag: v9.19.7~28^2~4 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=bb1c6bbdc701cdbadfe7c796acf8b5ecd719f1b9;p=thirdparty%2Fbind9.git Support testcrypto.sh usage without including conf.sh The only variable really needed for the script to work is the path to the $KEYGEN binary. Allow setting this via an environment variable to avoid loading conf.sh (and causing a chicken-egg problem). Also make testcrypto.sh executable to allow its use from conf.sh. --- diff --git a/bin/tests/system/testcrypto.sh b/bin/tests/system/testcrypto.sh old mode 100644 new mode 100755 index 96cc39651ed..72237777d92 --- a/bin/tests/system/testcrypto.sh +++ b/bin/tests/system/testcrypto.sh @@ -11,14 +11,16 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -. ../conf.sh +if test -z "$KEYGEN"; then + . ../conf.sh + alg="-a $DEFAULT_ALGORITHM -b $DEFAULT_BITS" +else + alg="" +fi prog=$0 - args="" -alg="-a $DEFAULT_ALGORITHM -b $DEFAULT_BITS" quiet=0 - msg="cryptography" while test "$#" -gt 0; do case $1 in @@ -62,6 +64,11 @@ while test "$#" -gt 0; do shift done +if test -z "$alg"; then + echo "${prog}: no algorithm selected" + exit 1 +fi + if $KEYGEN $args $alg foo > /dev/null 2>&1 then rm -f Kfoo*