gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: fix test logic: initialize $WALL


From: gnunet
Subject: [taler-exchange] branch master updated: fix test logic: initialize $WALLET_DB and fix cleanup logic of generate-auditor-basedb.sh
Date: Fri, 28 Aug 2020 18:01:54 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new d089c31e fix test logic: initialize $WALLET_DB and fix cleanup logic 
of generate-auditor-basedb.sh
d089c31e is described below

commit d089c31e5e5dcab03c6988d87c61c839e447b05b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Aug 28 18:01:50 2020 +0200

    fix test logic: initialize $WALLET_DB and fix cleanup logic of 
generate-auditor-basedb.sh
---
 contrib/gana                           |  2 +-
 src/auditor/generate-auditor-basedb.sh | 20 +++++++++++++++-----
 src/auditor/test-auditor.sh            |  9 +++++----
 src/auditor/test-revocation.sh         |  9 +++++----
 4 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/contrib/gana b/contrib/gana
index 18a39c29..0b778cda 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 18a39c29726860af58800a28454446154b89832b
+Subproject commit 0b778cdac372d0b75f3b64501a15a21c9c57f36e
diff --git a/src/auditor/generate-auditor-basedb.sh 
b/src/auditor/generate-auditor-basedb.sh
index 5b4f21fe..8678c6ca 100755
--- a/src/auditor/generate-auditor-basedb.sh
+++ b/src/auditor/generate-auditor-basedb.sh
@@ -15,8 +15,19 @@
 #
 set -eu
 
+# Cleanup to run whenever we exit
+function cleanup()
+{
+    for n in `jobs -p`
+    do
+        kill $n 2> /dev/null || true
+    done
+    wait
+}
+
+# Install cleanup handler (except for kill -9)
+trap cleanup EXIT
 
-trap "kill `jobs -p` &> /dev/null || true" ERR
 
 # Exit, with status code "skip" (no 'real' failure)
 function exit_skip() {
@@ -32,6 +43,8 @@ BASEDB=${1:-"auditor-basedb"}
 # elsewhere
 TARGET_DB=taler-auditor-basedb
 
+WALLET_DB=${BASEDB:-"wallet"}.wdb
+
 # Configuration file will be edited, so we create one
 # from the template.
 CONF=generate-auditor-basedb-prod.conf
@@ -122,8 +135,6 @@ done
 
 if [ 1 != $OK ]
 then
-    kill `jobs -p`
-    wait
     exit_skip "Failed to launch services"
 fi
 echo " DONE"
@@ -148,8 +159,7 @@ taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api 
'runIntegrationTest' \
 
 
 echo "Shutting down services"
-kill `jobs -p`
-wait
+cleanup
 
 # Dump database
 echo "Dumping database"
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index e7cdaa16..db8e73a7 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -42,7 +42,10 @@ function exit_fail() {
 # Cleanup to run whenever we exit
 function cleanup()
 {
-    kill `jobs -p` >/dev/null 2>/dev/null || true
+    for n in `jobs -p`
+    do
+        kill $n 2> /dev/null || true
+    done
     wait
 }
 
@@ -118,9 +121,7 @@ function audit_only () {
 function post_audit () {
     taler-exchange-dbinit -g || exit_fail "exchange DB GC failed"
 
-    kill -TERM `jobs -p` >/dev/null 2>/dev/null || true
-    echo -n "Waiting for servers to die ..."
-    wait
+    cleanup
     echo "DONE"
     echo -n "TeXing ."
     taler-helper-auditor-render.py test-audit-aggregation.json 
test-audit-coins.json test-audit-deposits.json test-audit-reserves.json 
test-audit-wire.json < ../../contrib/auditor-report.tex.j2 > test-report.tex || 
exit_fail "Renderer failed"
diff --git a/src/auditor/test-revocation.sh b/src/auditor/test-revocation.sh
index ac1f4dcc..a65ba196 100755
--- a/src/auditor/test-revocation.sh
+++ b/src/auditor/test-revocation.sh
@@ -42,7 +42,10 @@ function exit_fail() {
 # Cleanup to run whenever we exit
 function cleanup()
 {
-    kill `jobs -p` >/dev/null 2>/dev/null || true
+    for n in `jobs -p`
+    do
+        kill $n 2> /dev/null || true
+    done
     wait
 }
 
@@ -117,9 +120,7 @@ function audit_only () {
 
 # Cleanup to run after the auditor
 function post_audit () {
-    kill -TERM `jobs -p` >/dev/null 2>/dev/null || true
-    echo -n "Waiting for servers to die ..."
-    wait
+    cleanup
     echo "DONE"
     echo -n "TeXing ."
     taler-helper-auditor-render.py test-audit-aggregation.json 
test-audit-coins.json test-audit-deposits.json test-audit-reserves.json 
test-audit-wire.json < ../../contrib/auditor-report.tex.j2 > test-report.tex || 
exit_fail "Renderer failed"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]