gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 02/02: -work on auditor tests


From: gnunet
Subject: [taler-exchange] 02/02: -work on auditor tests
Date: Tue, 13 Sep 2022 13:22:36 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

commit 1081f3edbfac616e94a96a1ea597faef4e75f053
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Sep 13 13:22:26 2022 +0200

    -work on auditor tests
---
 src/auditor/test-auditor.sh | 40 +++++++++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 11 deletions(-)

diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index 9b9b21b7..803d3ad9 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -61,18 +61,18 @@ function exit_fail() {
     exit 1
 }
 
-# Cleanup to run whenever we exit
+# Cleanup exchange and libeufin between runs.
 function cleanup()
 {
-    if test ! -z ${POSTGRES_PATH:-}
+    if test ! -z ${EPID:-}
     then
-        ${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null stop &> /dev/null || 
true
+        echo -n "Stopping exchange..."
+        kill -TERM $EPID
+        wait $EPID
+        echo " DONE"
+        unset EPID
     fi
-    for n in `jobs -p`
-    do
-        kill $n 2> /dev/null || true
-    done
-    wait
+
     echo "killing libeufin..."
     if test -f libeufin-sandbox.pid
     then
@@ -87,8 +87,26 @@ function cleanup()
     echo DONE
 }
 
+# Cleanup to run whenever we exit
+function exit_cleanup()
+{
+    echo "Running exit-cleanup"
+    if test ! -z ${POSTGRES_PATH:-}
+    then
+        echo "Stopping Postgres at ${POSTGRES_PATH}"
+        ${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null stop &> /dev/null || 
true
+    fi
+    for n in `jobs -p`
+    do
+        kill $n 2> /dev/null || true
+    done
+    wait
+    cleanup
+    echo "DONE"
+}
+
 # Install cleanup handler (except for kill -9)
-trap cleanup EXIT
+trap exit_cleanup EXIT
 
 function launch_libeufin () {
     export LIBEUFIN_NEXUS_DB_CONNECTION="jdbc:sqlite:$DB.sqlite3"
@@ -294,12 +312,12 @@ function run_audit () {
 # Do a full reload of the (original) database
 function full_reload()
 {
-    echo "Doing full reload of the database ($BASEDB)... "
+    echo "Doing full reload of the database ($BASEDB - $DB)... "
     dropdb $DB 2> /dev/null || true
     rm -f $DB.sqlite3 2> /dev/null || true # libeufin
     createdb -T template0 $DB || exit_skip "could not create database $DB (at 
$PGHOST)"
     # Import pre-generated database, -q(ietly) using single (-1) transaction
-    psql -Aqt $DB -q -1 -f ${BASEDB}.sql > /dev/null || exit_skip "Failed to 
load database"
+    psql -Aqt $DB -q -1 -f ${BASEDB}.sql > /dev/null || exit_skip "Failed to 
load database $DB from ${BASEDB}.sql"
     echo "Loading libeufin basedb: ${BASEDB}-libeufin.sql"
     sqlite3 $DB.sqlite3 < ${BASEDB}-libeufin.sql || exit_skip "Failed to load 
libEufin database"
     echo "DONE"

-- 
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]