test_rebind.sh 772 B

1234567891011121314151617181920212223242526272829303132
  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 () { test -n "$tmpdir" && test -d "$tmpdir" && rm -rf "$tmpdir" || :; }
  15. trap clean EXIT HUP INT TERM
  16. tmpdir="`mktemp -d -t tor_rebind_test.XXXXXX`"
  17. if [ -z "$tmpdir" ]; then
  18. echo >&2 mktemp failed
  19. exit 2
  20. elif [ ! -d "$tmpdir" ]; then
  21. echo >&2 mktemp failed to make a directory
  22. exit 3
  23. fi
  24. "${PYTHON:-python}" "${abs_top_srcdir:-.}/src/test/test_rebind.py" "${TESTING_TOR_BINARY}" "$tmpdir" || exitcode=1
  25. exit ${exitcode}