Commit 81284af3 authored by Niels Möller's avatar Niels Möller
Browse files

* src/testsuite/functions.sh, src/testsuite/lsh-1-test,

src/testsuite/lsh-2-test, src/testsuite/lsh-3-test,
src/testsuite/tcpip-local-test: Fixed bash-isms.

Rev: src/testsuite/functions.sh:1.2
Rev: src/testsuite/lsh-1-test:1.2
Rev: src/testsuite/lsh-2-test:1.2
Rev: src/testsuite/lsh-3-test:1.2
Rev: src/testsuite/tcpip-local-test:1.2
parent e97329fa
......@@ -15,22 +15,23 @@ fi
PORT=11147
ATEXIT="res=$?"
trap 'eval "$ATEXIT ; exit \$res"' EXIT
trap 'eval "$ATEXIT ; exit \$res"' 0
function at-exit () {
at_exit () {
res=$?
ATEXIT="$ATEXIT ; $1"
return $res
}
function spawn-lshd () {
spawn_lshd () {
local delay
# local is not available in /bin/sh
# local delay
../lshd -h $srcdir/key-1.private --interface=localhost \
-p $PORT $SERVERFLAGS --pid-file lshd.$$.pid &
at-exit 'kill `cat lshd.$$.pid`; rm -f lshd.$$.pid'
at_exit 'kill `cat lshd.$$.pid`; rm -f lshd.$$.pid'
# Wait a little for lshd to start
for delay in 1 1 1 1 1 5 5 5 20 20 60 60; do
......@@ -45,7 +46,7 @@ function spawn-lshd () {
false
}
function run-lsh () {
run_lsh () {
cmd=$1
shift
echo $cmd | ../lsh $CLIENTFLAGS -nt --sloppy-host-authentication \
......@@ -53,14 +54,14 @@ function run-lsh () {
}
function spawn-lsh () {
# echo spawn-lsh "$@"
spawn_lsh () {
# echo spawn_lsh "$@"
../lsh $CLIENTFLAGS -nt --sloppy-host-authentication \
--capture-to /dev/null -z -p $PORT "$@" -N localhost &
at-exit "kill $!"
at_exit "kill $!"
}
function at-connect () {
at_connect () {
mini-inetd -m $2 localhost:$1 -- /bin/sh sh -c "$3" &
at-exit "kill $!"
at_exit "kill $!"
}
......@@ -14,5 +14,5 @@ fi
. $srcdir/functions.sh
spawn-lshd && run-lsh "exit"
spawn_lshd && run_lsh "exit"
......@@ -14,5 +14,5 @@ fi
. $srcdir/functions.sh
spawn-lshd && run-lsh "echo Hello world."
spawn_lshd && run_lsh "echo Hello world."
......@@ -14,5 +14,5 @@ fi
. $srcdir/functions.sh
spawn-lshd && run-lsh "echo Hello world. ; exit"
spawn_lshd && run_lsh "echo Hello world. ; exit"
......@@ -15,9 +15,9 @@ fi
SERVERPORT=`expr $PORT + 1`
PROXYPORT=`expr $PORT + 2`
at-connect $SERVERPORT 1 'echo foo' \
&& spawn-lshd \
&& spawn-lsh -L $PROXYPORT:localhost:$SERVERPORT \
at_connect $SERVERPORT 1 'echo foo' \
&& spawn_lshd \
&& spawn_lsh -L $PROXYPORT:localhost:$SERVERPORT \
&& sleep 30; tcpconnect -r </dev/null localhost $PROXYPORT
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment