diff --git a/ChangeLog b/ChangeLog index fa6847d0e5370339b5b70be0b737c52ea71adbde..25869e13154833e33d4bd53344c9bff8188bc05b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 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. diff --git a/src/testsuite/functions.sh b/src/testsuite/functions.sh index 13348ab0a797da37ea155eba4f5451d437c52c4a..b6499c3d545f04fd85fb6bb21aaa50f6d011c35f 100644 --- a/src/testsuite/functions.sh +++ b/src/testsuite/functions.sh @@ -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 } diff --git a/src/testsuite/lshd-random-input-test b/src/testsuite/lshd-random-input-test index 20ca84048e5c89486bfb01d28cfc47e8c018cba3..225427ab764e2946833d5771f9fccb48526f7360 100755 --- a/src/testsuite/lshd-random-input-test +++ b/src/testsuite/lshd-random-input-test @@ -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" diff --git a/src/testsuite/lshg-tcpip-local-test b/src/testsuite/lshg-tcpip-local-test index f954b95a702fdd831425a42189e790179626cc1e..76b95d40fb1cd312f0f933184641ca525d0d5219 100755 --- a/src/testsuite/lshg-tcpip-local-test +++ b/src/testsuite/lshg-tcpip-local-test @@ -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 diff --git a/src/testsuite/lshg-tcpip-remote-test b/src/testsuite/lshg-tcpip-remote-test index 4c343f062540e1cbaee252e3814aba27925fa935..bcc11e017927b8907a12c587f20771cb74b19fa6 100755 --- a/src/testsuite/lshg-tcpip-remote-test +++ b/src/testsuite/lshg-tcpip-remote-test @@ -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 diff --git a/src/testsuite/rapid7-lshd-test b/src/testsuite/rapid7-lshd-test index 4618cda12923a65c736e7501c76e6588978aa334..c87053563fcd5bbb6eb9dccb349dca255121e27e 100755 --- a/src/testsuite/rapid7-lshd-test +++ b/src/testsuite/rapid7-lshd-test @@ -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" diff --git a/src/testsuite/socks4-test b/src/testsuite/socks4-test index 91baaa623a252050944a47148f25a7ea384dbb94..a1d3b27455506957328fe2f08c2ecbcc7139ebe0 100755 --- a/src/testsuite/socks4-test +++ b/src/testsuite/socks4-test @@ -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 diff --git a/src/testsuite/socks5-test b/src/testsuite/socks5-test index 13db0430f6f090bcb413827d79e09fb3b8746457..8f8904fc72da27456f77418c1626ed7b3fb527c8 100755 --- a/src/testsuite/socks5-test +++ b/src/testsuite/socks5-test @@ -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 diff --git a/src/testsuite/tcpip-local-test b/src/testsuite/tcpip-local-test index 9abfbe58fcee0be59890ea06e3ab322ff0c958aa..29e0e795fc1b2c35c2d5ed96f46038b2d4d06b51 100755 --- a/src/testsuite/tcpip-local-test +++ b/src/testsuite/tcpip-local-test @@ -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 diff --git a/src/testsuite/tcpip-remote-test b/src/testsuite/tcpip-remote-test index 4a9a5c23adf324dea5028122f688d034785e12c2..ac744c98008c3ab642fb6e8a0db280261b03f657 100755 --- a/src/testsuite/tcpip-remote-test +++ b/src/testsuite/tcpip-remote-test @@ -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