"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/tests/hitch_test.sh" between
hitch-1.6.1.tar.gz and hitch-1.7.0.tar.gz

About: Hitch is a libev-based high performance SSL/TLS proxy that terminates TLS/SSL connections and forwards the unencrypted traffic to some backend.

hitch_test.sh  (hitch-1.6.1):hitch_test.sh  (hitch-1.7.0)
skipping to change at line 165 skipping to change at line 165
start_hitch() { start_hitch() {
TEST_UID=$(id -u) TEST_UID=$(id -u)
HITCH_USER= HITCH_USER=
test "$TEST_UID" -eq 0 && HITCH_USER=--user=nobody test "$TEST_UID" -eq 0 && HITCH_USER=--user=nobody
run_cmd hitch \ run_cmd hitch \
--pidfile="$TEST_TMPDIR/hitch.pid" \ --pidfile="$TEST_TMPDIR/hitch.pid" \
--log-filename=hitch.log \ --log-filename=hitch.log \
--daemon \ --daemon \
--dbg-listen="$TEST_TMPDIR/hitch_hosts" \
$HITCH_USER \ $HITCH_USER \
"$@" "$@"
} }
#- #-
# Usage: stop_hitch # Usage: stop_hitch
# #
# Kill a hitch daemon started with `start_hitch`, waiting for the # Kill a hitch daemon started with `start_hitch`, waiting for the
# process to terminate. # process to terminate.
skipping to change at line 206 skipping to change at line 207
cat "$TEST_TMPDIR/hitch.pid" cat "$TEST_TMPDIR/hitch.pid"
} }
#- #-
# Usage: hitch_hosts # Usage: hitch_hosts
# #
# Print a list of hosts for the daemon started with `start_hitch`, usually in # Print a list of hosts for the daemon started with `start_hitch`, usually in
# a loop. Only IPv4 listen addresses are listed. # a loop. Only IPv4 listen addresses are listed.
hitch_hosts() { hitch_hosts() {
if cmd lsof if [ -f "$TEST_TMPDIR/hitch_hosts" ]
then then
lsof -F -P -n -a -p "$(hitch_pid)" -i 4 -i TCP -s TCP:LISTEN | cat "$TEST_TMPDIR/hitch_hosts"
awk '/^n/ {
sub("\\*", "127.0.0.1", $1)
print substr($1,2)
}'
return return
fi fi
if cmd sockstat && test "$(uname)" = FreeBSD fail "$TEST_TMPDIR/hitch_hosts not found. Hitch started without --dbg-lis
then ten?"
sockstat -P tcp -4 |
awk '$3 == '"$(hitch_pid)"' {
sub("\\*", "127.0.0.1", $6)
print $6
}'
return
fi
if cmd fstat && test "$(uname)" = OpenBSD
then
fstat -p "$(hitch_pid)" |
awk '$5 == "internet" && $7 == "tcp" && NF == 9 {
sub("\\*", "127.0.0.1", $9)
print $9
}'
return
fi
fail "none of supported lsof, sockstat or fstat available"
} }
#- #-
# Usage: curl_hitch [opts...] [-- arg [args...]] # Usage: curl_hitch [opts...] [-- arg [args...]]
# #
# Send an HTTPS request to a hitch server. If an option is not supported by # Send an HTTPS request to a hitch server. If an option is not supported by
# curl the test is skipped. When `--` is missing, a URL using the first # curl the test is skipped. When `--` is missing, a URL using the first
# address reported by `hitch_host` is used. It includes all the common options # address reported by `hitch_host` is used. It includes all the common options
# needed by test cases. The test fail if the response status is different than # needed by test cases. The test fail if the response status is different than
# ${CURL_STATUS} (or 200 if it isn't set). # ${CURL_STATUS} (or 200 if it isn't set).
 End of changes. 4 change blocks. 
27 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)