diff --git a/tests/compat.sh b/tests/compat.sh index ac29e50c35..ba187839ff 100755 --- a/tests/compat.sh +++ b/tests/compat.sh @@ -33,6 +33,7 @@ SRVMEM=0 : ${M_SRV:=../programs/ssl/ssl_server2} : ${M_CLI:=../programs/ssl/ssl_client2} : ${OPENSSL:=openssl} +: ${M_QUERY:=../programs/test/query_compile_time_config} : ${GNUTLS_CLI:=gnutls-cli} : ${GNUTLS_SERV:=gnutls-serv} @@ -1089,6 +1090,15 @@ else DOG_DELAY=10 fi +# `$M_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE` will return `"seedfile"` and +# `dd` will create file with double quotes. That's not expected, with `eval` +# we can remove double quotes +NV_SEED_FILE=$(eval "echo `$M_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`") +if [ -n "$NV_SEED_FILE" ] && [ ! -f $NV_SEED_FILE ] +then + dd if=/dev/urandom of=$NV_SEED_FILE bs=64 count=1 2>/dev/null +fi + SKIP_NEXT="NO" trap cleanup INT TERM HUP diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 81749c990b..8fd26850d4 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -2004,23 +2004,17 @@ 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. -SKIP_NEXT="NO" -requires_config_enabled MBEDTLS_ENTROPY_C -requires_config_enabled MBEDTLS_ENTROPY_NV_SEED -requires_config_disabled MBEDTLS_NO_PLATFORM_ENTROPY -create_seedfile() -{ - dd if=/dev/urandom of=$1 bs=64 count=1 2>/dev/null -} -if [ "${SKIP_NEXT:-}" != "YES" ]; then - # `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE` will return `"seedfile"` and - # `dd` will create file with double quotes. That's not expected, with `eval` - # we can remove double quotes - eval "create_seedfile `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`" + +# `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE` will return `"seedfile"` and +# `dd` will create file with double quotes. That's not expected, with `eval` +# we can remove double quotes +NV_SEED_FILE=$(eval "echo `$P_QUERY MBEDTLS_PLATFORM_STD_NV_SEED_FILE`") +if [ -n "$NV_SEED_FILE" ] && [ ! -f $NV_SEED_FILE ] +then + dd if=/dev/urandom of=$NV_SEED_FILE bs=64 count=1 2>/dev/null fi + SKIP_NEXT="NO" trap cleanup INT TERM HUP