git.ucc.asn.au
/
tpg
/
opendispense2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Gitlab CI - Fix tests (take 2)
[tpg/opendispense2.git]
/
tests
/
_common.sh
diff --git
a/tests/_common.sh
b/tests/_common.sh
index
cb31ac7
..
fa2f107
100644
(file)
--- a/
tests/_common.sh
+++ b/
tests/_common.sh
@@
-1,6
+1,7
@@
#
# NOTE: Not a script, to be included by scripts
#
#
# NOTE: Not a script, to be included by scripts
#
+USER=$(id -un)
BASEDIR=rundir/${TESTNAME}/
PORT=22222
BASEDIR=rundir/${TESTNAME}/
PORT=22222
@@
-34,6
+35,7
@@
FAIL() {
}
TRY_COMMAND() {
cmd="$*"
}
TRY_COMMAND() {
cmd="$*"
+ echo ">> $cmd"
if ! $cmd ; then
FAIL "Command \`$cmd\` failed"
fi
if ! $cmd ; then
FAIL "Command \`$cmd\` failed"
fi
@@
-45,8
+47,12
@@
LD_LIBRARY_PATH=.. ../dispsrv -f ${BASEDIR}cfg_server.conf --dont-daemonise > ${
server_pid=$!
cleanup() {
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
}
trap cleanup EXIT
@@
-57,4
+63,5
@@
if ! (echo "" | nc localhost ${PORT}); then
LOG "Server not responding on ${PORT}"
LOG "Server log contents:"
cat ${BASEDIR}server.log
LOG "Server not responding on ${PORT}"
LOG "Server log contents:"
cat ${BASEDIR}server.log
+ exit 1
fi
fi
UCC
git Repository :: git.ucc.asn.au