#
# NOTE: Not a script, to be included by scripts
#
+USER=$(id -un)
BASEDIR=rundir/${TESTNAME}/
PORT=22222
}
TRY_COMMAND() {
cmd="$*"
+ echo ">> $cmd"
if ! $cmd ; then
FAIL "Command \`$cmd\` failed"
fi
server_pid=$!
cleanup() {
- LOG "Killing ${server_pid}"
- kill ${server_pid}; true
+ if pidof dispsrv | grep ${server_pid}; then
+ LOG "Killing ${server_pid}"
+ kill ${server_pid}; true
+ else
+ LOG "Server already terminated"
+ fi
}
trap cleanup EXIT
LOG "Server not responding on ${PORT}"
LOG "Server log contents:"
cat ${BASEDIR}server.log
+ exit 1
fi