Skip to content

Commit

Permalink
Merge pull request wolfSSL#7945 from ColtonWilley/no_external_network…
Browse files Browse the repository at this point in the history
…_test_option

Add option to skip all tests requiring an internet connection
  • Loading branch information
douzzer authored Sep 6, 2024
2 parents 96e2c51 + 9ad4e56 commit 945f976
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
36 changes: 20 additions & 16 deletions scripts/external.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,28 @@ if ! ./examples/client/client -V | grep -q 3; then
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"
if ! test -n "$WOLFSSL_EXTERNAL_TEST"; then
echo "WOLFSSL_EXTERNAL_TEST not set, won't run"
exit 77
fi
if test "$WOLFSSL_EXTERNAL_TEST" == "0"; then
echo "WOLFSSL_EXTERNAL_TEST is defined to zero, won't run"
exit 77
fi


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
Expand Down
4 changes: 4 additions & 0 deletions scripts/google.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ if ! test -n "$WOLFSSL_EXTERNAL_TEST"; then
echo "WOLFSSL_EXTERNAL_TEST not set, won't run"
exit 77
fi
if test "$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
Expand Down
6 changes: 6 additions & 0 deletions scripts/ocsp-stapling.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ if [[ -z "${RETRIES_REMAINING-}" ]]; then
export RETRIES_REMAINING=2
fi

if test "$WOLFSSL_EXTERNAL_TEST" == "0"; then
echo 'skipping oscp-stapling.test because WOLFSSL_EXTERNAL_TEST is \
defined to the value 0.'
exit 77
fi

if ! ./examples/client/client -V | grep -q 3; then
echo 'skipping ocsp-stapling.test because TLS1.2 is not available.' 1>&2
exit 77
Expand Down

0 comments on commit 945f976

Please sign in to comment.