From 1aed3c1fd2a9998800b0ab35e7a7bd3b4da1cf54 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 19 Sep 2022 14:04:53 +0200 Subject: auditor tests: make initdb invocation more portable --- src/auditor/test-revocation.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/auditor/test-revocation.sh') diff --git a/src/auditor/test-revocation.sh b/src/auditor/test-revocation.sh index ddb8476c7..354e7f807 100755 --- a/src/auditor/test-revocation.sh +++ b/src/auditor/test-revocation.sh @@ -600,10 +600,16 @@ 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" 2> /dev/null | grep postgres 2> /dev/null` || exit_skip " MISSING" -echo " FOUND at" `dirname $HAVE_INITDB` +# Available directly in path? +INITDB_BIN=$(command -v initdb) +if [[ ! -z $INITDB_BIN ]]; then + echo " FOUND (in path) at" $INITDB_BIN +else + HAVE_INITDB=`find /usr -name "initdb" 2> /dev/null | grep postgres` || exit_skip " MISSING" + echo " FOUND at" `dirname $HAVE_INITDB` + INITDB_BIN=`echo $HAVE_INITDB | grep bin/initdb | grep postgres | sort -n | tail -n1` +fi echo -n "Setting up Postgres DB" -INITDB_BIN=`echo $HAVE_INITDB | grep bin/initdb | grep postgres | sort -n | tail -n1 2> /dev/null` 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 -- cgit v1.2.3