#! /bin/sh

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

. $srcdir/functions.sh

need_tcputils

PORT=5555

werror "Testing lshd"

spawn_lshd

for f in $srcdir/rapid7-ssh-pdu/*.pdu ; do
    # werror "Testing $f"
    tcpconnect localhost $PORT < "$f" > /dev/null \
	|| die "Connect failed, test $f"

    kill -0 `cat $PIDFILE` || die "Server died, test $f"
done

werror "Test done"

test_success
