From 21ee650d3d93e0b03bd88dacc57175b74d61a2b3 Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Thu, 30 Jun 2022 14:50:25 +0800 Subject: [PATCH] fix ssl-opt.sh test fail ssl-opt.sh depends on seedfile when MBEDTLS_ENTROPY_C && MBEDTLS_ENTROPY_NV_SEED && !MBEDTLS_NO_PLATFORM_ENTROPY Signed-off-by: Jerry Yu --- tests/ssl-opt.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index ec8b0dc0c0..5c35d5df80 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -303,11 +303,10 @@ get_config_value_or_default() { # Note that if the configuration is not defined or is defined to nothing, # the output of this function will be an empty string. if [ "$LIST_TESTS" -eq 0 ];then - ${P_SRV} "query_config=${1}" + ${P_QUERY} "${1}" else echo "1" fi - } requires_config_value_at_least() { @@ -2005,6 +2004,19 @@ CLI_OUT="cli_out.$$" PXY_OUT="pxy_out.$$" SESSION="session.$$" +# If MBEDTLS_ENTROPY_C && MBEDTLS_ENTROPY_NV_SEED && !MBEDTLS_NO_PLATFORM_ENTROPY +# create seedfile to fix test fail. +requires_config_enabled MBEDTLS_ENTROPY_C +requires_config_enabled MBEDTLS_ENTROPY_NV_SEED +requires_config_disabled MBEDTLS_NO_PLATFORM_ENTROPY +create_seedfile() +{ + [ -f $1 ] || dd if=/dev/urandom of=$1 bs=64 count=1 2>/dev/null +} +if [ "${SKIP_NEXT:-}" != "YES" ]; then + eval "create_seedfile `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`" +fi + SKIP_NEXT="NO" trap cleanup INT TERM HUP