Commit 33ec225f authored by Niels Möller's avatar Niels Möller

New variables TEST_HOME and

SEXP_CONV. Changed the initialization of LSH_YARROW_SEED_FILE. Use
TEST_HOME when running lsh and lshd. Should make the tests
independent of our own ~/.lsh.

Rev: src/testsuite/functions.sh:1.21
parent 30b86c7d
# Helper functions for the test scripts.
# Any error count as failure.
set -e
# echo srcdir = $srcdir
# Make sure we have a randomness genereetor
LSH_YARROW_SEED_FILE="`pwd`/yarrow-seed-file"
export LSH_YARROW_SEED_FILE
if [ -z "$TEST_HOME" ] ; then
TEST_HOME="`pwd`/home"
fi
if [ -z "$LSH_YARROW_SEED_FILE" ] ; then
LSH_YARROW_SEED_FILE="$TEST_HOME/.lsh/yarrow-seed-file"
fi
if [ -s "$LSH_YARROW_SEED_FILE" ] ; then : ; else
echo "Creating seed file $LSH_YARROW_SEED_FILE"
../lsh-make-seed --sloppy -q -o "$LSH_YARROW_SEED_FILE"
# For lsh-authorize
if [ -z "SEXP_CONV" ] ; then
SEXP_CONV="`pwd`/../sexp-conv"
fi
export LSH_YARROW_SEED_FILE SEXP_CONV
## # Make sure we have a randomness genereetor
## LSH_YARROW_SEED_FILE="`pwd`/yarrow-seed-file"
## export LSH_YARROW_SEED_FILE
##
## if [ -s "$LSH_YARROW_SEED_FILE" ] ; then : ; else
## echo "Creating seed file $LSH_YARROW_SEED_FILE"
## ../lsh-make-seed --sloppy -q -o "$LSH_YARROW_SEED_FILE"
## fi
if [ -z "$LSHD_FLAGS" ] ; then
LSHD_FLAGS='-q --enable-core'
fi
......@@ -37,9 +55,6 @@ INTERFACE=127.0.0.1
# USERKEY=$srcdir/key-1.private
# fi
# Any error count as failure.
set -e
PORT=11147
ATEXIT='set +e'
......@@ -72,7 +87,8 @@ spawn_lshd () {
# Note that --daemon not only forks into the background, it also changes
# the cwd, uses syslog, etc.
../lshd -h $HOSTKEY --interface=$INTERFACE -p $PORT $LSHD_FLAGS \
HOME="$TEST_HOME" ../lshd -h $HOSTKEY --interface=$INTERFACE \
-p $PORT $LSHD_FLAGS \
--pid-file $PIDFILE --daemon --no-syslog "$@"
# lshd may catch the ordinary TERM signal, leading to timing
......@@ -97,20 +113,21 @@ spawn_lshd () {
run_lsh () {
cmd="$1"
shift
echo "$cmd" | ../lsh $LSH_FLAGS -nt --sloppy-host-authentication \
echo "$cmd" | HOME="$TEST_HOME" ../lsh $LSH_FLAGS -nt \
--sloppy-host-authentication \
--capture-to /dev/null -z -p $PORT "$@" localhost
}
exec_lsh () {
../lsh $LSH_FLAGS -nt --sloppy-host-authentication \
HOME="$TEST_HOME" ../lsh $LSH_FLAGS -nt --sloppy-host-authentication \
--capture-to /dev/null -z -p $PORT localhost "$@"
}
# FIXME: Use -B
spawn_lsh () {
# echo spawn_lsh "$@"
../lsh $LSH_FLAGS -nt --sloppy-host-authentication \
HOME="$TEST_HOME" ../lsh $LSH_FLAGS -nt --sloppy-host-authentication \
--capture-to /dev/null -z -p $PORT "$@" -N localhost &
at_exit "kill $!"
}
......
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