-try to fix more of test-*.sh

This commit is contained in:
Christian Grothoff 2022-09-21 10:46:57 +02:00
parent 3fa9f3bb12
commit f365fc0730
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
4 changed files with 30 additions and 16 deletions

@ -1 +1 @@
Subproject commit d402af78f6d360841db53baa46dddae13590ec33
Subproject commit 9dee7d6e8f967fdc58ae224e19ec03989ac35c52

View File

@ -32,22 +32,29 @@ function get_payto_uri() {
# Cleanup to run whenever we exit
function cleanup()
{
echo "Killing Libeufin..."
if test -f libeufin-sandbox.pid
then
echo "Killing libeufin sandbox"
PID=`cat libeufin-sandbox.pid 2> /dev/null`
kill $PID 2> /dev/null || true
wait $PID
rm libeufin-sandbox.pid
fi
if test -f libeufin-nexus.pid
then
echo "Killing libeufin nexus"
PID=`cat libeufin-nexus.pid 2> /dev/null`
kill $PID 2> /dev/null || true
wait $PID
rm libeufin-nexus.pid
fi
echo "killing libeufin DONE"
for n in `jobs -p`
do
kill $n 2> /dev/null || true
done
wait
echo "Killing Libeufin..."
if test -f libeufin-sandbox.pid
then
echo "Killing libeufin sandbox"
kill `cat libeufin-sandbox.pid 2> /dev/null` &> /dev/null || true
fi
if test -f libeufin-nexus.pid
then
echo "Killing libeufin nexus"
kill `cat libeufin-nexus.pid 2> /dev/null` &> /dev/null || true
fi
}
# Install cleanup handler (except for kill -9)

View File

@ -61,6 +61,9 @@ function exit_fail() {
exit 1
}
# Clean up leftovers on start
rm -f libeufin-sandbox.pid libeufin-nexus.pid
function stop_libeufin()
{
echo "killing libeufin..."
@ -68,7 +71,7 @@ function stop_libeufin()
then
echo "Killing libeufin sandbox"
PID=`cat libeufin-sandbox.pid 2> /dev/null`
kill $PID || true
kill $PID 2> /dev/null || true
wait $PID
rm libeufin-sandbox.pid
fi
@ -76,7 +79,7 @@ function stop_libeufin()
then
echo "Killing libeufin nexus"
PID=`cat libeufin-nexus.pid 2> /dev/null`
kill $PID || true
kill $PID 2> /dev/null || true
wait $PID
rm libeufin-nexus.pid
fi
@ -2079,6 +2082,7 @@ export PGHOST
MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX`
echo "Generating fresh database at $MYDIR"
rm -f $DB.sqlite3 2> /dev/null || true # libeufin
if faketime -f '-1 d' ./generate-auditor-basedb.sh $MYDIR/$DB
then
check_with_database $MYDIR/$DB

View File

@ -54,6 +54,9 @@ function exit_fail() {
exit 1
}
# Clean up leftovers on start
rm -f libeufin-sandbox.pid libeufin-nexus.pid
function stop_libeufin()
{
echo "killing libeufin..."
@ -61,7 +64,7 @@ function stop_libeufin()
then
echo "Killing libeufin sandbox"
PID=`cat libeufin-sandbox.pid 2> /dev/null`
kill $PID || true
kill $PID 2> /dev/null || true
wait $PID
rm libeufin-sandbox.pid
fi
@ -69,7 +72,7 @@ function stop_libeufin()
then
echo "Killing libeufin nexus"
PID=`cat libeufin-nexus.pid 2> /dev/null`
kill $PID || true
kill $PID 2> /dev/null || true
wait $PID
rm libeufin-nexus.pid
fi