#! /bin/sh

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

. $srcdir/functions.sh

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

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

test_done
