diff options
Diffstat (limited to 'src/auditor/test-auditor.sh')
-rwxr-xr-x | src/auditor/test-auditor.sh | 28 |
1 files changed, 20 insertions, 8 deletions
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() { | |||
43 | function run_audit () { | 43 | function run_audit () { |
44 | # Launch bank | 44 | # Launch bank |
45 | echo -n "Launching bank " | 45 | echo -n "Launching bank " |
46 | taler-bank-manage -c test-auditor.conf serve-http 2>bank.err >bank.log & | 46 | taler-bank-manage -c $CONF serve-http 2>bank.err >bank.log & |
47 | while true | 47 | while true |
48 | do | 48 | do |
49 | echo -n "." | 49 | echo -n "." |
@@ -55,15 +55,15 @@ function run_audit () { | |||
55 | if test ${1:-no} = "aggregator" | 55 | if test ${1:-no} = "aggregator" |
56 | then | 56 | then |
57 | echo -n "Running exchange aggregator ..." | 57 | echo -n "Running exchange aggregator ..." |
58 | taler-exchange-aggregator -t -c test-auditor.conf | 58 | taler-exchange-aggregator -t -c $CONF 2> aggregator.log |
59 | echo " DONE" | 59 | echo " DONE" |
60 | fi | 60 | fi |
61 | 61 | ||
62 | # Run the auditor! | 62 | # Run the auditor! |
63 | echo -n "Running audit(s) ..." | 63 | echo -n "Running audit(s) ..." |
64 | taler-auditor -r -c test-auditor.conf -m $MASTER_PUB > test-audit.json 2> test-audit.log || exit_fail "auditor failed" | 64 | taler-auditor -r -c $CONF -m $MASTER_PUB > test-audit.json 2> test-audit.log || exit_fail "auditor failed" |
65 | 65 | ||
66 | 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" | 66 | taler-wire-auditor -r -c $CONF -m $MASTER_PUB > test-wire-audit.json 2> test-wire-audit.log || exit_fail "wire auditor failed" |
67 | echo " DONE" | 67 | echo " DONE" |
68 | 68 | ||
69 | kill `jobs -p` || true | 69 | kill `jobs -p` || true |
@@ -83,7 +83,7 @@ full_reload() | |||
83 | dropdb $DB 2> /dev/null || true | 83 | dropdb $DB 2> /dev/null || true |
84 | createdb -T template0 $DB || exit_skip "could not create database" | 84 | createdb -T template0 $DB || exit_skip "could not create database" |
85 | # Import pre-generated database, -q(ietly) using single (-1) transaction | 85 | # Import pre-generated database, -q(ietly) using single (-1) transaction |
86 | psql -Aqt $DB -q -1 -f ../benchmark/auditor-basedb.sql > /dev/null | 86 | psql -Aqt $DB -q -1 -f ${BASEDB}.sql > /dev/null |
87 | } | 87 | } |
88 | 88 | ||
89 | 89 | ||
@@ -726,9 +726,20 @@ echo "DONE" | |||
726 | 726 | ||
727 | # *************** Main logic starts here ************** | 727 | # *************** Main logic starts here ************** |
728 | 728 | ||
729 | # Setup globals | 729 | # ####### Setup globals ###### |
730 | # Postgres database to use | ||
730 | DB=taler-auditor-test | 731 | DB=taler-auditor-test |
731 | MASTER_PUB=`cat ../benchmark/auditor-basedb.mpub` | 732 | # Prefix for the data resources to use |
733 | BASEDB="../benchmark/auditor-basedb" | ||
734 | MASTER_PUB=`cat ${BASEDB}.mpub` | ||
735 | # Configuration file to use | ||
736 | CONF=test-auditor.conf | ||
737 | |||
738 | # Where to store wire fee details for aggregator | ||
739 | WIRE_FEE_DIR=`taler-config -c $CONF -f -s exchangedb -o WIREFEE_BASE_DIR` | ||
740 | mkdir -p $WIRE_FEE_DIR | ||
741 | cp ${BASEDB}.fees $WIRE_FEE_DIR/x-taler-bank.fee | ||
742 | |||
732 | 743 | ||
733 | # test required commands exist | 744 | # test required commands exist |
734 | echo "Testing for jq" | 745 | echo "Testing for jq" |
@@ -754,8 +765,9 @@ do | |||
754 | done | 765 | done |
755 | 766 | ||
756 | 767 | ||
757 | echo "Cleanup" | 768 | echo "Cleanup (disabled)" |
758 | # dropdb $DB | 769 | # dropdb $DB |
770 | # rm -r $WIRE_FEE_DIR | ||
759 | # rm -f test-audit.log test-wire-audit.log | 771 | # rm -f test-audit.log test-wire-audit.log |
760 | 772 | ||
761 | exit $fail | 773 | exit $fail |