-work on auditor tests
This commit is contained in:
parent
fed7102ad5
commit
bca7f21fdd
@ -1 +1 @@
|
|||||||
Subproject commit 75c838e74c41bf9a6c02cdfe8109a444056bf26d
|
Subproject commit 5f6a1413a6053d1999064768188f1671eb015897
|
@ -1 +1 @@
|
|||||||
Subproject commit 74d9c44ebc257a3d8b9c2c0a806508bd0cc5269a
|
Subproject commit b988d98d4856758484eb23c27bfdc9e602d4235a
|
@ -36,10 +36,18 @@ function cleanup()
|
|||||||
do
|
do
|
||||||
kill $n 2> /dev/null || true
|
kill $n 2> /dev/null || true
|
||||||
done
|
done
|
||||||
echo Killing euFin..
|
|
||||||
kill `cat libeufin-sandbox.pid 2> /dev/null` &> /dev/null || true
|
|
||||||
kill `cat libeufin-nexus.pid 2> /dev/null` &> /dev/null || true
|
|
||||||
wait
|
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)
|
# Install cleanup handler (except for kill -9)
|
||||||
|
@ -73,7 +73,7 @@ function cleanup()
|
|||||||
kill $n 2> /dev/null || true
|
kill $n 2> /dev/null || true
|
||||||
done
|
done
|
||||||
wait
|
wait
|
||||||
# kill euFin
|
echo "killing libeufin..."
|
||||||
if test -f libeufin-sandbox.pid
|
if test -f libeufin-sandbox.pid
|
||||||
then
|
then
|
||||||
echo "Killing libeufin sandbox"
|
echo "Killing libeufin sandbox"
|
||||||
@ -292,12 +292,12 @@ function run_audit () {
|
|||||||
|
|
||||||
|
|
||||||
# Do a full reload of the (original) database
|
# Do a full reload of the (original) database
|
||||||
full_reload()
|
function full_reload()
|
||||||
{
|
{
|
||||||
echo "Doing full reload of the database ($BASEDB)... "
|
echo "Doing full reload of the database ($BASEDB)... "
|
||||||
dropdb $DB 2> /dev/null || true
|
dropdb $DB 2> /dev/null || true
|
||||||
rm -f $DB.sqlite3 2> /dev/null || true # libeufin
|
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
|
# 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"
|
||||||
echo "Loading libeufin basedb: ${BASEDB}-libeufin.sql"
|
echo "Loading libeufin basedb: ${BASEDB}-libeufin.sql"
|
||||||
@ -2017,11 +2017,11 @@ MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX`
|
|||||||
|
|
||||||
|
|
||||||
echo -n "Testing for Postgres"
|
echo -n "Testing for Postgres"
|
||||||
HAVE_INITDB=`find /usr -name "initdb" | grep postgres` || exit_skip " MISSING"
|
HAVE_INITDB=`find /usr -name "initdb" 2> /dev/null | grep postgres` || exit_skip " MISSING"
|
||||||
echo " FOUND"
|
echo " FOUND at" `dirname $HAVE_INITDB`
|
||||||
echo -n "Setting up Postgres DB"
|
echo -n "Setting up Postgres DB"
|
||||||
INITDB_BIN=`find /usr -name "initdb" | grep bin/initdb | grep postgres | sort -n | tail -n1`
|
INITDB_BIN=`echo $HAVE_INITDB | grep bin/initdb | grep postgres | sort -n | tail -n1`
|
||||||
POSTGRES_PATH=`basename $INITDB_BIN`
|
POSTGRES_PATH=`dirname $INITDB_BIN`
|
||||||
TMPDIR=`mktemp -d /tmp/taler-test-postgresXXXXXX`
|
TMPDIR=`mktemp -d /tmp/taler-test-postgresXXXXXX`
|
||||||
$INITDB_BIN --no-sync --auth=trust -D ${TMPDIR} > postgres-dbinit.log 2> postgres-dbinit.err
|
$INITDB_BIN --no-sync --auth=trust -D ${TMPDIR} > postgres-dbinit.log 2> postgres-dbinit.err
|
||||||
echo " DONE"
|
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
|
${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null start > postgres-start.log 2> postgres-start.err
|
||||||
echo " DONE"
|
echo " DONE"
|
||||||
PGHOST="$TMPDIR/sockets"
|
PGHOST="$TMPDIR/sockets"
|
||||||
EXPORT PGHOST="@POSTGRES_SOCKET"
|
export PGHOST
|
||||||
|
|
||||||
|
|
||||||
echo "Generating fresh database at $MYDIR"
|
echo "Generating fresh database at $MYDIR"
|
||||||
|
@ -600,16 +600,16 @@ echo "Testing for taler-wallet-cli"
|
|||||||
taler-wallet-cli -h >/dev/null </dev/null 2>/dev/null || exit_skip "taler-wallet-cli required"
|
taler-wallet-cli -h >/dev/null </dev/null 2>/dev/null || exit_skip "taler-wallet-cli required"
|
||||||
|
|
||||||
echo -n "Testing for Postgres"
|
echo -n "Testing for Postgres"
|
||||||
HAVE_INITDB=`find /usr -name "initdb" | grep postgres` || exit_skip " MISSING"
|
HAVE_INITDB=`find /usr -name "initdb" 2> /dev/null | grep postgres 2> /dev/null` || exit_skip " MISSING"
|
||||||
echo " FOUND"
|
echo " FOUND at" `dirname $HAVE_INITDB`
|
||||||
echo -n "Setting up Postgres DB"
|
echo -n "Setting up Postgres DB"
|
||||||
INITDB_BIN=`find /usr -name "initdb" | grep bin/initdb | grep postgres | sort -n | tail -n1`
|
INITDB_BIN=`echo $HAVE_INITDB | grep bin/initdb | grep postgres | sort -n | tail -n1 2> /dev/null`
|
||||||
POSTGRES_PATH=`basename $INITDB_BIN`
|
POSTGRES_PATH=`dirname $INITDB_BIN`
|
||||||
TMPDIR=`mktemp -d /tmp/taler-test-postgresXXXXXX`
|
TMPDIR=`mktemp -d /tmp/taler-test-postgresXXXXXX`
|
||||||
$INITDB_BIN --no-sync --auth=trust -D ${TMPDIR} > postgres-dbinit.log 2> postgres-dbinit.err
|
$INITDB_BIN --no-sync --auth=trust -D ${TMPDIR} > postgres-dbinit.log 2> postgres-dbinit.err
|
||||||
echo " DONE"
|
echo " DONE"
|
||||||
mkdir ${TMPDIR}/sockets
|
mkdir ${TMPDIR}/sockets
|
||||||
echo -n "Launching Postgres service"
|
echo -n "Launching Postgres service at $POSTGRES_PATH"
|
||||||
cat - >> $TMPDIR/postgresql.conf <<EOF
|
cat - >> $TMPDIR/postgresql.conf <<EOF
|
||||||
unix_socket_directories='${TMPDIR}/sockets'
|
unix_socket_directories='${TMPDIR}/sockets'
|
||||||
fsync=off
|
fsync=off
|
||||||
@ -623,7 +623,9 @@ 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
|
${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null start > postgres-start.log 2> postgres-start.err
|
||||||
echo " DONE"
|
echo " DONE"
|
||||||
PGHOST="$TMPDIR/sockets"
|
PGHOST="$TMPDIR/sockets"
|
||||||
EXPORT PGHOST="@POSTGRES_SOCKET"
|
export PGHOST
|
||||||
|
|
||||||
|
bash
|
||||||
|
|
||||||
|
|
||||||
MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX`
|
MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX`
|
||||||
|
Loading…
Reference in New Issue
Block a user