test_rebind.sh 748 B

1234567891011121314151617181920212223242526272829303132333435
  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 exemptions. Skipping." >&2
  9. exit 77
  10. fi
  11. fi
  12. tmpdir=
  13. clean () {
  14. if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then
  15. rm -rf "$tmpdir"
  16. fi
  17. }
  18. trap clean EXIT HUP INT TERM
  19. tmpdir="$(mktemp -d -t tor_rebind_test.XXXXXX)"
  20. if [ -z "$tmpdir" ]; then
  21. echo >&2 mktemp failed
  22. exit 2
  23. elif [ ! -d "$tmpdir" ]; then
  24. echo >&2 mktemp failed to make a directory
  25. exit 3
  26. fi
  27. "${PYTHON:-python}" "${abs_top_srcdir:-.}/src/test/test_rebind.py" "${TESTING_TOR_BINARY}" "$tmpdir"
  28. exit $?