google.test 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env bash
  2. # google.test
  3. server=www.google.com
  4. [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
  5. if ! test -n "$WOLFSSL_EXTERNAL_TEST"; then
  6. echo "WOLFSSL_EXTERNAL_TEST not set, won't run"
  7. exit 77
  8. fi
  9. if test "$WOLFSSL_EXTERNAL_TEST" == "0"; then
  10. echo "WOLFSSL_EXTERNAL_TEST is defined to zero, won't run"
  11. exit 77
  12. fi
  13. if ! ./examples/client/client -V | grep -q 3; then
  14. echo 'skipping google.test because TLS1.2 is not available.' 1>&2
  15. exit 77
  16. fi
  17. # is our desired server there?
  18. ./scripts/ping.test $server 2
  19. RESULT=$?
  20. [ $RESULT -ne 0 ] && exit 0
  21. # client test against the server
  22. ./examples/client/client -X -C -h $server -p 443 -g -d
  23. RESULT=$?
  24. [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
  25. if ./examples/client/client -V | grep -q 4; then
  26. # client test against the server using TLS v1.3
  27. ./examples/client/client -v 4 -X -C -h $server -p 443 -g -d
  28. RESULT=$?
  29. [ $RESULT -ne 0 ] && echo -e "\n\nTLSv1.3 Client connection failed" && exit 1
  30. fi
  31. exit 0