1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Add seed cmdline arg to test scripts

This commit is contained in:
Andres AG
2016-10-10 15:46:20 +01:00
committed by Simon Butcher
parent e3d882ad4a
commit 7770ea82d5
2 changed files with 24 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ CONFIG_BAK="$CONFIG_H.bak"
MEMORY=0
FORCE=0
RELEASE=0
# Default commands, can be overriden by the environment
: ${OPENSSL:="openssl"}
@@ -48,6 +49,8 @@ usage()
printf " -h|--help\t\tPrint this help.\n"
printf " -m|--memory\t\tAdditional optional memory tests.\n"
printf " -f|--force\t\tForce the tests to overwrite any modified files.\n"
printf " -s|--seed\t\tInteger seed value to use for this test run.\n"
printf " -r|--release-test\t\tRun this script in release mode. This fixes the seed value to 1.\n"
printf " --out-of-source-dir=<path>\t\tDirectory used for CMake out-of-source build tests."
printf " --openssl=<OpenSSL_path>\t\tPath to OpenSSL executable to use for most tests.\n"
printf " --openssl-legacy=<OpenSSL_path>\t\tPath to OpenSSL executable to use for legacy tests e.g. SSLv3.\n"
@@ -106,6 +109,13 @@ while [ $# -gt 0 ]; do
--force|-f)
FORCE=1
;;
--seed|-s)
shift
SEED="$1"
;;
--release-test|-r)
RELEASE=1
;;
--out-of-source-dir)
shift
OUT_OF_SOURCE_DIR="$1"
@@ -171,9 +181,15 @@ else
fi
fi
if [ $RELEASE -eq 1 ]; then
# Fix the seed value to 1 to ensure that the tests are deterministic.
SEED=1
fi
msg "info: $0 configuration"
echo "MEMORY: $MEMORY"
echo "FORCE: $FORCE"
echo "SEED: ${SEED-"UNSET"}"
echo "OPENSSL: $OPENSSL"
echo "OPENSSL_LEGACY: $OPENSSL_LEGACY"
echo "GNUTLS_CLI: $GNUTLS_CLI"
@@ -187,6 +203,9 @@ export OPENSSL_CMD="$OPENSSL"
export GNUTLS_CLI="$GNUTLS_CLI"
export GNUTLS_SERV="$GNUTLS_SERV"
# Avoid passing --seed flag in every call to ssl-opt.sh
[ ! -z ${SEED+set} ] && export SEED
# Make sure the tools we need are available.
check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$GNUTLS_CLI" "$GNUTLS_SERV" \
"$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" "doxygen" "dot" \