diff --git a/contrib/gana b/contrib/gana index d402af78f..9dee7d6e8 160000 --- a/contrib/gana +++ b/contrib/gana @@ -1 +1 @@ -Subproject commit d402af78f6d360841db53baa46dddae13590ec33 +Subproject commit 9dee7d6e8f967fdc58ae224e19ec03989ac35c52 diff --git a/src/auditor/generate-auditor-basedb.sh b/src/auditor/generate-auditor-basedb.sh index a24942dfc..469abbc3e 100755 --- a/src/auditor/generate-auditor-basedb.sh +++ b/src/auditor/generate-auditor-basedb.sh @@ -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) diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh index 937da49f4..831fec67c 100755 --- a/src/auditor/test-auditor.sh +++ b/src/auditor/test-auditor.sh @@ -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 diff --git a/src/auditor/test-revocation.sh b/src/auditor/test-revocation.sh index 011585340..1aeb6b641 100755 --- a/src/auditor/test-revocation.sh +++ b/src/auditor/test-revocation.sh @@ -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