Update no network test option to overload meaning of existing WOLFSSL_EXTERNAL_TEST instead of using new flag

This commit is contained in:
Colton Willey
2024-09-04 16:09:16 -07:00
parent 8aa5f463b1
commit 8661cf6fee
3 changed files with 46 additions and 20 deletions

View File

@ -15,25 +15,34 @@ if ! ./examples/client/client -V | grep -q 3; then
exit 77
fi
# cloudflare seems to change CAs quickly, disabled by default
if test -n "$WOLFSSL_EXTERNAL_TEST"; then
BUILD_FLAGS="$(./examples/client/client '-#')"
if echo "$BUILD_FLAGS" | fgrep -q -e ' -DWOLFSSL_SNIFFER '; then
echo 'skipping WOLFSSL_EXTERNAL_TEST because -DWOLFSSL_SNIFFER configuration of build is incompatible.'
exit 77
fi
if echo "$BUILD_FLAGS" | fgrep -v -q -e ' -DHAVE_ECC '; then
echo 'skipping WOLFSSL_EXTERNAL_TEST because -UHAVE_ECC configuration of build is incompatible.'
exit 77
fi
echo "WOLFSSL_EXTERNAL_TEST set, running test..."
else
echo "WOLFSSL_EXTERNAL_TEST NOT set, won't run"
# These tests do not run by default, we will call these opt in. There are
# additional default tests that require network connection, those are
# opt out.
# Not defining WOLFSSL_EXTERNAL_TEST runs only opt out.
# Defining WOLFSSL_EXTERNAL_TEST!=0 runs opt out and opt in.
# Defining WOLFSSL_EXTERNAL_TEST=0 does not run opt in or opt out.
if [[ ! -v WOLFSSL_EXTERNAL_TEST ]]; then
echo "WOLFSSL_EXTERNAL_TEST not set, won't run"
exit 77
fi
if [[ "$WOLFSSL_EXTERNAL_TEST" == "0" ]]; then
echo "WOLFSSL_EXTERNAL_TEST is defined to zero, won't run"
exit 77
fi
# cloudflare seems to change CAs quickly, disabled by default
BUILD_FLAGS="$(./examples/client/client '-#')"
if echo "$BUILD_FLAGS" | fgrep -q -e ' -DWOLFSSL_SNIFFER '; then
echo 'skipping WOLFSSL_EXTERNAL_TEST because -DWOLFSSL_SNIFFER configuration of build is incompatible.'
exit 77
fi
if echo "$BUILD_FLAGS" | fgrep -v -q -e ' -DHAVE_ECC '; then
echo 'skipping WOLFSSL_EXTERNAL_TEST because -UHAVE_ECC configuration of build is incompatible.'
exit 77
fi
echo "WOLFSSL_EXTERNAL_TEST set, running test..."
# is our desired server there?
"${SCRIPT_DIR}"/ping.test $server 2

View File

@ -6,10 +6,20 @@ server=www.google.com
[ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
if ! test -n "$WOLFSSL_EXTERNAL_TEST"; then
# These tests do not run by default, we will call these opt in. There are
# additional default tests that require network connection, those are
# opt out.
# Not defining WOLFSSL_EXTERNAL_TEST runs only opt out.
# Defining WOLFSSL_EXTERNAL_TEST!=0 runs opt out and opt in.
# Defining WOLFSSL_EXTERNAL_TEST=0 does not run opt in or opt out.
if [[ ! -v WOLFSSL_EXTERNAL_TEST ]]; then
echo "WOLFSSL_EXTERNAL_TEST not set, won't run"
exit 77
fi
if [[ "$WOLFSSL_EXTERNAL_TEST" == "0" ]]; then
echo "WOLFSSL_EXTERNAL_TEST is defined to zero, won't run"
exit 77
fi
if ! ./examples/client/client -V | grep -q 3; then
echo 'skipping google.test because TLS1.2 is not available.' 1>&2

View File

@ -11,8 +11,15 @@ if [[ -z "${RETRIES_REMAINING-}" ]]; then
export RETRIES_REMAINING=2
fi
if test -n "$WOLFSSL_NO_EXTERNAL_NETWORK_TESTS"; then
echo 'skipping oscp-stapling.test because WOLFSSL_NO_EXTERNAL_NETWORK_TESTS defined.'
# These tests do run by default, we will call these opt out. There are
# additional non-default tests that require network connection, those are
# opt in.
# Not defining WOLFSSL_EXTERNAL_TEST runs only opt out.
# Defining WOLFSSL_EXTERNAL_TEST!=0 runs opt out and opt in.
# Defining WOLFSSL_EXTERNAL_TEST=0 does not run opt in or opt out.
if [[ "$WOLFSSL_EXTERNAL_TEST" == "0" ]]; then
echo 'skipping oscp-stapling.test because WOLFSSL_EXTERNAL_TEST is \
defined to the value 0.'
exit 77
fi