test_rebind.sh 783 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. set -x
  3. UNAME_OS=$(uname -s | cut -d_ -f1)
  4. if test "$UNAME_OS" = 'CYGWIN' || \
  5. test "$UNAME_OS" = 'MSYS' || \
  6. test "$UNAME_OS" = 'MINGW'; then
  7. if test "$APPVEYOR" = 'True'; then
  8. echo "This test is disabled on Windows CI, as it requires firewall examptions. Skipping." >&2
  9. exit 77
  10. fi
  11. fi
  12. exitcode=0
  13. tmpdir=
  14. clean () {
  15. if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then
  16. rm -rf "$tmpdir"
  17. fi
  18. }
  19. trap clean EXIT HUP INT TERM
  20. tmpdir="$(mktemp -d -t tor_rebind_test.XXXXXX)"
  21. if [ -z "$tmpdir" ]; then
  22. echo >&2 mktemp failed
  23. exit 2
  24. elif [ ! -d "$tmpdir" ]; then
  25. echo >&2 mktemp failed to make a directory
  26. exit 3
  27. fi
  28. "${PYTHON:-python}" "${abs_top_srcdir:-.}/src/test/test_rebind.py" "${TESTING_TOR_BINARY}" "$tmpdir" || exitcode=1
  29. exit ${exitcode}