From 47ab7c4c41f4655280b3d84eb6f90582b5b1b822 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 13 Sep 2022 15:29:04 +0200 Subject: -fix test-sync --- src/auditor/generate-auditor-basedb.sh | 4 ++-- src/auditor/test-auditor.sh | 7 ++++--- src/auditor/test-revocation.sh | 3 --- src/auditor/test-sync.sh | 17 ++++++++--------- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/auditor/generate-auditor-basedb.sh b/src/auditor/generate-auditor-basedb.sh index 09018f0cb..17cfc4b46 100755 --- a/src/auditor/generate-auditor-basedb.sh +++ b/src/auditor/generate-auditor-basedb.sh @@ -103,7 +103,7 @@ MASTER_PRIV_DIR=`dirname $MASTER_PRIV_FILE` taler-config -f -c ${CONF_ONCE} -s exchange-offline -o MASTER_PRIV_FILE -V ${MASTER_PRIV_FILE} rm -f "${MASTER_PRIV_FILE}" mkdir -p $MASTER_PRIV_DIR -gnunet-ecc -g1 $MASTER_PRIV_FILE > /dev/null +gnunet-ecc -l/dev/null -g1 $MASTER_PRIV_FILE > /dev/null MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE` MERCHANT_PORT=`taler-config -c $CONF_ONCE -s MERCHANT -o PORT` MERCHANT_URL=http://localhost:${MERCHANT_PORT}/ @@ -112,7 +112,7 @@ AUDITOR_PRIV_FILE=$1.apriv AUDITOR_PRIV_DIR=`dirname $AUDITOR_PRIV_FILE` taler-config -f -c ${CONF_ONCE} -s auditor -o AUDITOR_PRIV_FILE -V ${AUDITOR_PRIV_FILE} mkdir -p $AUDITOR_PRIV_DIR -gnunet-ecc -g1 $AUDITOR_PRIV_FILE > /dev/null +gnunet-ecc -l/dev/null -g1 $AUDITOR_PRIV_FILE > /dev/null AUDITOR_PUB=`gnunet-ecc -p $AUDITOR_PRIV_FILE` EXCHANGE_URL=`taler-config -c $CONF_ONCE -s EXCHANGE -o BASE_URL` BANK_PORT=`taler-config -c $CONF_ONCE -s BANK -o HTTP_PORT` diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh index 803d3ad92..92e242a1f 100755 --- a/src/auditor/test-auditor.sh +++ b/src/auditor/test-auditor.sh @@ -66,7 +66,7 @@ function cleanup() { if test ! -z ${EPID:-} then - echo -n "Stopping exchange..." + echo -n "Stopping exchange $EPID..." kill -TERM $EPID wait $EPID echo " DONE" @@ -96,12 +96,12 @@ function exit_cleanup() echo "Stopping Postgres at ${POSTGRES_PATH}" ${POSTGRES_PATH}/pg_ctl -D $TMPDIR -l /dev/null stop &> /dev/null || true fi + cleanup for n in `jobs -p` do kill $n 2> /dev/null || true done wait - cleanup echo "DONE" } @@ -282,6 +282,7 @@ function run_audit () { 2> taler-exchange-offline-drain.log || exit_fail "offline draining failed" kill -TERM $EPID wait $EPID + unset EPID echo -n "Running taler-exchange-drain ..." echo "\n" | taler-exchange-drain -L DEBUG -c $CONF 2> taler-exchange-drain.log || exit_fail "FAIL" echo " DONE" @@ -1531,7 +1532,7 @@ function test_24() { echo "===========24: deposits missing ===========" # Modify denom_sig, so it is wrong - CNT=`echo "SELECT COUNT(*) FROM exchange.deposit_confirmations;" | psql -Aqt $DB` + CNT=`echo "SELECT COUNT(*) FROM auditor.deposit_confirmations;" | psql -Aqt $DB` if test x$CNT = x0 then echo "Skipping deposits missing test: no deposit confirmations in database!" diff --git a/src/auditor/test-revocation.sh b/src/auditor/test-revocation.sh index 4fa26f3e0..ddb8476c7 100755 --- a/src/auditor/test-revocation.sh +++ b/src/auditor/test-revocation.sh @@ -625,9 +625,6 @@ echo " DONE" PGHOST="$TMPDIR/sockets" export PGHOST -bash - - MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX` echo "Generating fresh database at $MYDIR" if faketime -f '-1 d' ./generate-revoke-basedb.sh $MYDIR/revoke-basedb diff --git a/src/auditor/test-sync.sh b/src/auditor/test-sync.sh index e3afeb709..c8f6ea8f7 100755 --- a/src/auditor/test-sync.sh +++ b/src/auditor/test-sync.sh @@ -85,6 +85,7 @@ function check_with_database() dropdb talercheck-out echo "PASS" + fail=0 } @@ -108,11 +109,11 @@ echo "Testing for taler-wallet-cli" taler-wallet-cli -h >/dev/null /dev/null || exit_skip "taler-wallet-cli required" 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" @@ -131,15 +132,13 @@ 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 MYDIR=`mktemp -d /tmp/taler-auditor-basedbXXXXXX` echo "Generating fresh database at $MYDIR" -if faketime -f '-1 d' ./generate-auditor-basedb.sh $MYDIR/basedb +if faketime -f '-1 d' ./generate-auditor-basedb.sh $MYDIR/auditor-basedb then - check_with_database $MYDIR/basedb + check_with_database $MYDIR/auditor-basedb if test x$fail != x0 then exit $fail -- cgit v1.2.3