diff options
Diffstat (limited to 'src/auditor/test-sync.sh')
-rwxr-xr-x | src/auditor/test-sync.sh | 17 |
1 files changed, 8 insertions, 9 deletions
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 2>/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 |