From cc5297a7f14faf4aa9ed08fe3e571a0c49c743b5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 5 Sep 2019 05:49:25 +0200 Subject: pass wire fees to aggregator in test case --- src/auditor/test-auditor.conf | 3 +++ src/auditor/test-auditor.sh | 28 ++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'src/auditor') diff --git a/src/auditor/test-auditor.conf b/src/auditor/test-auditor.conf index 0f16fbd9a..966ee5b5d 100644 --- a/src/auditor/test-auditor.conf +++ b/src/auditor/test-auditor.conf @@ -12,6 +12,9 @@ TALER_BANK_AUTH_METHOD = basic USERNAME = Exchange PASSWORD = x +[exchangedb] +WIREFEE_BASE_DIR = ${PWD}/wirefees/ + [auditordb-postgres] CONFIG = postgres:///taler-auditor-test diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh index 0a79385f5..5124999ed 100755 --- a/src/auditor/test-auditor.sh +++ b/src/auditor/test-auditor.sh @@ -43,7 +43,7 @@ function exit_fail() { function run_audit () { # Launch bank echo -n "Launching bank " - taler-bank-manage -c test-auditor.conf serve-http 2>bank.err >bank.log & + taler-bank-manage -c $CONF serve-http 2>bank.err >bank.log & while true do echo -n "." @@ -55,15 +55,15 @@ function run_audit () { if test ${1:-no} = "aggregator" then echo -n "Running exchange aggregator ..." - taler-exchange-aggregator -t -c test-auditor.conf + taler-exchange-aggregator -t -c $CONF 2> aggregator.log echo " DONE" fi # Run the auditor! echo -n "Running audit(s) ..." - taler-auditor -r -c test-auditor.conf -m $MASTER_PUB > test-audit.json 2> test-audit.log || exit_fail "auditor failed" + taler-auditor -r -c $CONF -m $MASTER_PUB > test-audit.json 2> test-audit.log || exit_fail "auditor failed" - taler-wire-auditor -r -c test-auditor.conf -m $MASTER_PUB > test-wire-audit.json 2> test-wire-audit.log || exit_fail "wire auditor failed" + taler-wire-auditor -r -c $CONF -m $MASTER_PUB > test-wire-audit.json 2> test-wire-audit.log || exit_fail "wire auditor failed" echo " DONE" kill `jobs -p` || true @@ -83,7 +83,7 @@ full_reload() dropdb $DB 2> /dev/null || true createdb -T template0 $DB || exit_skip "could not create database" # Import pre-generated database, -q(ietly) using single (-1) transaction - psql -Aqt $DB -q -1 -f ../benchmark/auditor-basedb.sql > /dev/null + psql -Aqt $DB -q -1 -f ${BASEDB}.sql > /dev/null } @@ -726,9 +726,20 @@ echo "DONE" # *************** Main logic starts here ************** -# Setup globals +# ####### Setup globals ###### +# Postgres database to use DB=taler-auditor-test -MASTER_PUB=`cat ../benchmark/auditor-basedb.mpub` +# Prefix for the data resources to use +BASEDB="../benchmark/auditor-basedb" +MASTER_PUB=`cat ${BASEDB}.mpub` +# Configuration file to use +CONF=test-auditor.conf + +# Where to store wire fee details for aggregator +WIRE_FEE_DIR=`taler-config -c $CONF -f -s exchangedb -o WIREFEE_BASE_DIR` +mkdir -p $WIRE_FEE_DIR +cp ${BASEDB}.fees $WIRE_FEE_DIR/x-taler-bank.fee + # test required commands exist echo "Testing for jq" @@ -754,8 +765,9 @@ do done -echo "Cleanup" +echo "Cleanup (disabled)" # dropdb $DB +# rm -r $WIRE_FEE_DIR # rm -f test-audit.log test-wire-audit.log exit $fail -- cgit v1.2.3