full audit generation in test
This commit is contained in:
parent
33217d730f
commit
b58410ce13
@ -10,3 +10,10 @@ CONFIG = postgres:///taler-auditor-test
|
|||||||
[taler]
|
[taler]
|
||||||
CURRENCY = TESTKUDOS
|
CURRENCY = TESTKUDOS
|
||||||
|
|
||||||
|
[bank]
|
||||||
|
DATABASE = postgres:///taler-auditor-test
|
||||||
|
MAX_DEBT = TESTKUDOS:50.0
|
||||||
|
MAX_DEBT_BANK = TESTKUDOS:0.0
|
||||||
|
HTTP_PORT = 8082
|
||||||
|
SUGGESTED_EXCHANGE = http://localhost:8081/
|
||||||
|
SUGGESTED_EXCHANGE_PAYTO = payto://x-taler-bank/localhost:8082/2
|
@ -6,6 +6,8 @@
|
|||||||
#
|
#
|
||||||
# Requires 'jq' tool and Postgres superuser rights!
|
# Requires 'jq' tool and Postgres superuser rights!
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
echo "Database setup"
|
||||||
DB=taler-auditor-test
|
DB=taler-auditor-test
|
||||||
dropdb $DB 2> /dev/null || true
|
dropdb $DB 2> /dev/null || true
|
||||||
createdb -T template0 $DB || exit 77
|
createdb -T template0 $DB || exit 77
|
||||||
@ -14,12 +16,26 @@ jq -h > /dev/null || exit 77
|
|||||||
psql $DB -q -1 -f ../benchmark/auditor-basedb.sql > /dev/null
|
psql $DB -q -1 -f ../benchmark/auditor-basedb.sql > /dev/null
|
||||||
MASTER_PUB=`cat ../benchmark/auditor-basedb.mpub`
|
MASTER_PUB=`cat ../benchmark/auditor-basedb.mpub`
|
||||||
|
|
||||||
|
# Launch bank
|
||||||
|
echo "Launching bank"
|
||||||
|
taler-bank-manage -c test-auditor.conf serve-http 2>/dev/null >/dev/null &
|
||||||
|
sleep 10
|
||||||
|
|
||||||
# Run the auditor!
|
# Run the auditor!
|
||||||
|
echo "Running audit(s)"
|
||||||
taler-auditor -c test-auditor.conf -m $MASTER_PUB > test-audit.json
|
taler-auditor -c test-auditor.conf -m $MASTER_PUB > test-audit.json
|
||||||
|
taler-wire-auditor -c test-auditor.conf -m $MASTER_PUB > test-wire-audit.json
|
||||||
|
|
||||||
# TODO:
|
echo "Shutting down services"
|
||||||
# launch bank and run wire-auditor eventually as well!
|
kill `jobs -p`
|
||||||
|
|
||||||
|
|
||||||
|
echo "TeXing"
|
||||||
|
../../contrib/render.py test-audit.json test-wire-audit.json < ../../contrib/auditor-report.tex.j2 > test-report.tex
|
||||||
|
pdflatex test-report.tex >/dev/null
|
||||||
|
pdflatex test-report.tex >/dev/null
|
||||||
|
|
||||||
|
echo "Checking output"
|
||||||
fail=0
|
fail=0
|
||||||
# if an emergency was detected, that is a bug and we should fail
|
# if an emergency was detected, that is a bug and we should fail
|
||||||
echo -n "Test for emergencies... "
|
echo -n "Test for emergencies... "
|
||||||
@ -27,6 +43,8 @@ jq -e .emergencies[0] < test-audit.json > /dev/null && (echo Failed; fail=1) ||
|
|||||||
|
|
||||||
# TODO: Add more checks to ensure test-audit.json matches expectations
|
# TODO: Add more checks to ensure test-audit.json matches expectations
|
||||||
|
|
||||||
|
|
||||||
|
echo "Cleanup"
|
||||||
dropdb $DB
|
dropdb $DB
|
||||||
|
|
||||||
exit $fail
|
exit $fail
|
||||||
|
Loading…
Reference in New Issue
Block a user