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