summaryrefslogtreecommitdiff
path: root/src/auditor/test-auditor.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-09-13 13:00:02 +0200
committerChristian Grothoff <christian@grothoff.org>2022-09-13 13:00:02 +0200
commitbca7f21fdd6b37e68a13155857e666b3f1f811a2 (patch)
tree85733a8759fc3d4839f6e18fb189e007391f7f32 /src/auditor/test-auditor.sh
parentfed7102ad5e24382c1ceed089e92498098084075 (diff)
downloadexchange-bca7f21fdd6b37e68a13155857e666b3f1f811a2.tar.gz
exchange-bca7f21fdd6b37e68a13155857e666b3f1f811a2.tar.bz2
exchange-bca7f21fdd6b37e68a13155857e666b3f1f811a2.zip
-work on auditor tests
Diffstat (limited to 'src/auditor/test-auditor.sh')
-rwxr-xr-xsrc/auditor/test-auditor.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index 1b48acbd4..9b9b21b7f 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -73,7 +73,7 @@ function cleanup()
kill $n 2> /dev/null || true
done
wait
- # kill euFin
+ echo "killing libeufin..."
if test -f libeufin-sandbox.pid
then
echo "Killing libeufin sandbox"
@@ -292,12 +292,12 @@ function run_audit () {
# Do a full reload of the (original) database
-full_reload()
+function full_reload()
{
echo "Doing full reload of the database ($BASEDB)... "
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"
+ 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"
echo "Loading libeufin basedb: ${BASEDB}-libeufin.sql"
@@ -2017,11 +2017,11 @@ MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX`
echo -n "Testing for Postgres"
-HAVE_INITDB=`find /usr -name "initdb" | grep postgres` || exit_skip " MISSING"
-echo " FOUND"
+HAVE_INITDB=`find /usr -name "initdb" 2> /dev/null | grep postgres` || exit_skip " MISSING"
+echo " FOUND at" `dirname $HAVE_INITDB`
echo -n "Setting up Postgres DB"
-INITDB_BIN=`find /usr -name "initdb" | grep bin/initdb | grep postgres | sort -n | tail -n1`
-POSTGRES_PATH=`basename $INITDB_BIN`
+INITDB_BIN=`echo $HAVE_INITDB | grep bin/initdb | grep postgres | sort -n | tail -n1`
+POSTGRES_PATH=`dirname $INITDB_BIN`
TMPDIR=`mktemp -d /tmp/taler-test-postgresXXXXXX`
$INITDB_BIN --no-sync --auth=trust -D ${TMPDIR} > postgres-dbinit.log 2> postgres-dbinit.err
echo " DONE"
@@ -2040,7 +2040,7 @@ mv $TMPDIR/pg_hba.conf.new $TMPDIR/pg_hba.conf
${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null start > postgres-start.log 2> postgres-start.err
echo " DONE"
PGHOST="$TMPDIR/sockets"
-EXPORT PGHOST="@POSTGRES_SOCKET"
+export PGHOST
echo "Generating fresh database at $MYDIR"