Debian Codegraph @

src/testsuite/rapid7-lsh-test

raw
1 #! /bin/sh
2
3 if [ -z "$srcdir" ] ; then
4 srcdir=`pwd`
5 fi
6
7 . $srcdir/functions.sh
8
9 PORT=5556
10
11 ./mini-inetd -- $PORT /bin/sh /bin/sh -c 'cat current' &
12 pid=$!
13
14 at_exit "kill $pid; rm -f current" 0
15
16 werror "Testing lsh"
17
18 for f in $srcdir/rapid7-ssh-pdu/*.pdu ; do
19 echo 1>&2 "Testing $f"
20 rm -f current || die "Deleting symlink current failed"
21 ln -s $f current || die "Creating symlink current -> $f failed"
22
23 set +e
24 HOME="$TEST_HOME" ../lsh -q --sloppy --capture-to=/dev/null -p $PORT localhost exit 0
25 status="$?"
26 set -e
27 # Should be either 1 or 17 (not sure exactly when
28 # which of these are returned)
29 case "$status" in
30 1|17)
31 :
32 ;;
33 *)
34 die "Strange exit code $status from client"
35 ;;
36 esac
37 done
38
39 werror "Test done"
40
41 test_success