6 # emulate realpath(), in case coreutils or equivalent is not installed.
14 base
="/$(basename "$f")"
16 dir
="$(cd "$dir" && pwd)"
25 TOR_BINARY
="${TESTING_TOR_BINARY:-./src/app/tor}"
28 TOR_BINARY
="$(abspath "$TOR_BINARY")"
30 echo "TOR BINARY IS ${TOR_BINARY}"
32 die
() { echo "$1" >&2 ; exit 5; }
36 DATA_DIR
=$
(mktemp
-d -t tor_cmdline_tests.XXXXXX
)
37 trap 'rm -rf "$DATA_DIR"' 0
39 # 1. Test list-torrc-options.
40 OUT
="${DATA_DIR}/output"
43 "${TOR_BINARY}" --list-torrc-options > "$OUT"
47 # regular options are given.
48 grep -i "SocksPort" "$OUT" >/dev
/null || die
"Did not find SocksPort"
53 # unlisted options are given, since they do not have the NOSET flag.
54 grep -i "__SocksPort" "$OUT" > /dev
/null || die
"Did not find __SocksPort"
58 # unsettable options are not given.
59 if grep -i "DisableIOCP" "$OUT" /dev
/null
; then
60 die
"Found DisableIOCP"
62 if grep -i "HiddenServiceOptions" "$OUT" /dev
/null
; then
63 die
"Found HiddenServiceOptions"