summaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-09-21 10:46:57 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-09-21 10:46:57 +0200
commitf365fc0730c2243c4fdff5de91f3ad575106398f (patch)
tree55c0ca250b1be1ffa885f4208530d67456763b75 /src/auditor
parent3fa9f3bb12635c6bbb50b763e2c955d73e2e37fa (diff)
downloadexchange-f365fc0730c2243c4fdff5de91f3ad575106398f.tar.gz
exchange-f365fc0730c2243c4fdff5de91f3ad575106398f.tar.bz2
exchange-f365fc0730c2243c4fdff5de91f3ad575106398f.zip
-try to fix more of test-*.sh
Diffstat (limited to 'src/auditor')
-rwxr-xr-xsrc/auditor/generate-auditor-basedb.sh21
-rwxr-xr-xsrc/auditor/test-auditor.sh8
-rwxr-xr-xsrc/auditor/test-revocation.sh7
3 files changed, 25 insertions, 11 deletions
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()
{
- 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
+ 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"
- kill `cat libeufin-nexus.pid 2> /dev/null` &> /dev/null || true
+ 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
}
# 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