#! /bin/sh

if [ -z "$srcdir" ] ; then
  srcdir=`pwd`
fi

. $srcdir/functions.sh

need_tcputils

SERVERPORT=`expr $PORT + 1`
PROXYPORT=`expr $PORT + 2`

at_connect $SERVERPORT 1 'echo foo' \
    && spawn_lshd \
    && spawn_lsh -L $PROXYPORT:localhost:$SERVERPORT \
    && sleep 30 \
    && tcpconnect </dev/null localhost $PROXYPORT | grep foo \
    && test_success
    
