Commit 828c229d authored by Niels Möller's avatar Niels Möller

Use our own tcpconnect for the testsuite. Don't depend on tcputils.

parent dd6be796
2012-07-13 Niels Möller <nisse@lysator.liu.se>
* src/testsuite/functions.sh (need_tcputils): Deleted function.
* src/testsuite/lshd-random-input-test: Use ./tcpconnect, rather
than the possibly installed version from tcputils. Don't use
need_tcputils.
* src/testsuite/lshg-tcpip-local-test: Likewise.
* src/testsuite/lshg-tcpip-remote-test: Likewise.
* src/testsuite/rapid7-lshd-test: Likewise.
* src/testsuite/socks4-test: Likewise.
* src/testsuite/socks5-test: Likewise.
* src/testsuite/tcpip-local-test: Likewise.
* src/testsuite/tcpip-remote-test: Likewise.
* src/testsuite/tcpconnect.c (main): Ignore SIGPIPE. Fixes to
diagnostic printouts.
......
......@@ -115,10 +115,6 @@ need_xvfb () {
[ -n "$XVFB" ] || test_skip
}
need_tcputils () {
type tcpconnect >/dev/null 2>&1 || test_skip
}
need_tsocks () {
type tsocks >/dev/null 2>&1 || test_skip
}
......
......@@ -8,8 +8,6 @@ fi
PORT=5555
need_tcputils
werror "Testing lshd with random input"
spawn_lshd
......@@ -17,7 +15,7 @@ spawn_lshd
for seed in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
werror "Trying seed $seed"
$LFIB_STREAM $seed \
| tcpconnect localhost $PORT > /dev/null \
| ./tcpconnect -v localhost $PORT > /dev/null \
|| die "Connect failed"
kill -0 `cat $PIDFILE` || die "Server died"
......
......@@ -6,8 +6,6 @@ fi
. $srcdir/functions.sh
need_tcputils
SERVERPORT=`expr $PORT + 1`
PROXYPORT=`expr $PORT + 2`
......@@ -15,7 +13,7 @@ at_connect $SERVERPORT 1 'echo foo' \
&& spawn_lshd \
&& spawn_lsh --start-gateway \
&& spawn_lshg -L $PROXYPORT:localhost:$SERVERPORT \
&& tcpconnect -r </dev/null localhost $PROXYPORT | grep foo \
&& ./tcpconnect -r </dev/null localhost $PROXYPORT | grep foo \
&& test_success
test_done
......@@ -6,8 +6,6 @@ fi
. $srcdir/functions.sh
need_tcputils
SERVERPORT=`expr $PORT + 1`
PROXYPORT=`expr $PORT + 2`
......@@ -17,9 +15,9 @@ at_connect $SERVERPORT 1 'echo foo' \
&& spawn_lshd \
&& spawn_lsh --start-gateway \
&& spawn_lshg -R $PROXYPORT:localhost:$SERVERPORT \
&& cat /dev/null | tcpconnect localhost $PROXYPORT | grep foo \
&& cat /dev/null | ./tcpconnect localhost $PROXYPORT | grep foo \
&& kill `cat $LSHG_PIDFILE` \
&& sleep 5 \
&& if tcpconnect </dev/null -i localhost $PROXYPORT ; then false ; else test_success ; fi
&& if ./tcpconnect </dev/null -i localhost $PROXYPORT ; then false ; else test_success ; fi
test_done
......@@ -6,8 +6,6 @@ fi
. $srcdir/functions.sh
need_tcputils
PORT=5555
werror "Testing lshd"
......@@ -16,7 +14,7 @@ spawn_lshd
for f in $srcdir/rapid7-ssh-pdu/*.pdu ; do
# werror "Testing $f"
tcpconnect localhost $PORT < "$f" > /dev/null \
./tcpconnect localhost $PORT < "$f" > /dev/null \
|| die "Connect failed, test $f"
kill -0 `cat $PIDFILE` || die "Server died, test $f"
......
......@@ -6,7 +6,6 @@ fi
. $srcdir/functions.sh
need_tcputils
need_tsocks
SERVERPORT=`expr $PORT + 1`
......@@ -20,7 +19,7 @@ export TSOCKS_CONF_FILE
at_connect $SERVERPORT 1 'grep bar && echo foo' \
&& spawn_lshd \
&& spawn_lsh -D$SOCKSPORT \
&& echo bar | tsocks tcpconnect localhost $SERVERPORT | grep foo \
&& echo bar | tsocks ./tcpconnect localhost $SERVERPORT | grep foo \
&& test_success
test_done
......@@ -6,7 +6,6 @@ fi
. $srcdir/functions.sh
need_tcputils
need_tsocks
SERVERPORT=`expr $PORT + 1`
......@@ -20,7 +19,7 @@ export TSOCKS_CONF_FILE
at_connect $SERVERPORT 1 'grep bar && echo foo' \
&& spawn_lshd \
&& spawn_lsh -D$SOCKSPORT \
&& echo bar | tsocks tcpconnect localhost $SERVERPORT | grep foo \
&& echo bar | tsocks ./tcpconnect localhost $SERVERPORT | grep foo \
&& test_success
test_done
......@@ -6,15 +6,13 @@ fi
. $srcdir/functions.sh
need_tcputils
SERVERPORT=`expr $PORT + 1`
PROXYPORT=`expr $PORT + 2`
at_connect $SERVERPORT 1 'grep bar && echo foo' \
&& spawn_lshd \
&& spawn_lsh -L $PROXYPORT:localhost:$SERVERPORT \
&& echo bar | tcpconnect localhost $PROXYPORT | grep foo \
&& echo bar | ./tcpconnect localhost $PROXYPORT | grep foo \
&& test_success
test_done
......@@ -6,22 +6,20 @@ fi
. $srcdir/functions.sh
need_tcputils
SERVERPORT=`expr $PORT + 1`
PROXYPORT=`expr $PORT + 2`
# For some reason, tcpconnect < /dev/null doesn't work on SunOS-5.4. Hence
# the appearantly unneeded use of cat.
# The sleep is needed, because spawn_lsh returns when the
# FIXME: The sleep is needed, because spawn_lsh returns when the
# tcpip-forward request is sent, and the server may not have processed
# it yet.
at_connect $SERVERPORT 1 'echo foo' \
&& spawn_lshd \
&& spawn_lsh -R $PROXYPORT:localhost:$SERVERPORT \
&& sleep 2 \
&& cat /dev/null | tcpconnect localhost $PROXYPORT | grep foo \
&& cat /dev/null | ./tcpconnect localhost $PROXYPORT | grep foo \
&& test_success
test_done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment