summaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
Diffstat (limited to 'src/auditor')
-rwxr-xr-xsrc/auditor/generate-auditor-basedb.sh1
-rw-r--r--src/auditor/taler-auditor-httpd.c2
-rwxr-xr-xsrc/auditor/test-auditor.sh73
3 files changed, 44 insertions, 32 deletions
diff --git a/src/auditor/generate-auditor-basedb.sh b/src/auditor/generate-auditor-basedb.sh
index 65aae3134..bbce37cdc 100755
--- a/src/auditor/generate-auditor-basedb.sh
+++ b/src/auditor/generate-auditor-basedb.sh
@@ -119,7 +119,6 @@ taler-wallet-cli \
echo " DONE"
taler-wallet-cli --wallet-db="$WALLET_DB" run-until-done
-taler-wallet-cli --wallet-db="$WALLET_DB" advanced run-pending
# Dump database
mkdir -p "$(dirname "$BASEDB")"
diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c
index d9cdff8d2..59bd849bc 100644
--- a/src/auditor/taler-auditor-httpd.c
+++ b/src/auditor/taler-auditor-httpd.c
@@ -169,7 +169,7 @@ handle_config (struct TAH_RequestHandler *rh,
GNUNET_JSON_pack_string ("version",
AUDITOR_PROTOCOL_VERSION),
GNUNET_JSON_pack_string ("implementation",
- "urn:net:taler:specs:auditor:c-reference"),
+ "urn:net:taler:specs:taler-auditor:c-reference"),
GNUNET_JSON_pack_string ("currency",
TAH_currency),
GNUNET_JSON_pack_data_auto ("auditor_public_key",
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index ea8637cfa..2cfea0532 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -166,7 +166,7 @@ function audit_only () {
-t \
> "${MY_TMP_DIR}/test-audit-aggregation.out" \
2> "${MY_TMP_DIR}/test-audit-aggregation.err" \
- || exit_fail "aggregation audit failed"
+ || exit_fail "aggregation audit failed (see ${MY_TMP_DIR}/test-audit-aggregation.*)"
echo -n "."
$VALGRIND taler-helper-auditor-aggregation \
-L DEBUG \
@@ -174,7 +174,7 @@ function audit_only () {
-t \
> "${MY_TMP_DIR}/test-audit-aggregation-inc.out" \
2> "${MY_TMP_DIR}/test-audit-aggregation-inc.err" \
- || exit_fail "incremental aggregation audit failed"
+ || exit_fail "incremental aggregation audit failed (see ${MY_TMP_DIR}/test-audit-aggregation-inc.*)"
echo -n "."
$VALGRIND taler-helper-auditor-coins \
-L DEBUG \
@@ -182,7 +182,7 @@ function audit_only () {
-t \
> "${MY_TMP_DIR}/test-audit-coins.out" \
2> "${MY_TMP_DIR}/test-audit-coins.err" \
- || exit_fail "coin audit failed"
+ || exit_fail "coin audit failed (see ${MY_TMP_DIR}/test-audit-coins.*)"
echo -n "."
$VALGRIND taler-helper-auditor-coins \
-L DEBUG \
@@ -190,7 +190,7 @@ function audit_only () {
-t \
> "${MY_TMP_DIR}/test-audit-coins-inc.out" \
2> "${MY_TMP_DIR}/test-audit-coins-inc.err" \
- || exit_fail "incremental coin audit failed"
+ || exit_fail "incremental coin audit failed (see ${MY_TMP_DIR}/test-audit-coins-inc.*)"
echo -n "."
$VALGRIND taler-helper-auditor-deposits \
-L DEBUG \
@@ -198,7 +198,7 @@ function audit_only () {
-t \
> "${MY_TMP_DIR}/test-audit-deposits.out" \
2> "${MY_TMP_DIR}/test-audit-deposits.err" \
- || exit_fail "deposits audit failed"
+ || exit_fail "deposits audit failed (see ${MY_TMP_DIR}/test-audit-deposits.*)"
echo -n "."
$VALGRIND taler-helper-auditor-deposits \
-L DEBUG \
@@ -206,7 +206,7 @@ function audit_only () {
-t \
> "${MY_TMP_DIR}/test-audit-deposits-inc.out" \
2> "${MY_TMP_DIR}/test-audit-deposits-inc.err" \
- || exit_fail "incremental deposits audit failed"
+ || exit_fail "incremental deposits audit failed (see ${MY_TMP_DIR}/test-audit-deposits-inc.*)"
echo -n "."
$VALGRIND taler-helper-auditor-reserves \
-i \
@@ -215,7 +215,7 @@ function audit_only () {
-t \
> "${MY_TMP_DIR}/test-audit-reserves.out" \
2> "${MY_TMP_DIR}/test-audit-reserves.err" \
- || exit_fail "reserves audit failed"
+ || exit_fail "reserves audit failed (see ${MY_TMP_DIR}/test-audit-reserves.*)"
echo -n "."
$VALGRIND taler-helper-auditor-reserves \
-i \
@@ -224,25 +224,25 @@ function audit_only () {
-t \
> "${MY_TMP_DIR}/test-audit-reserves-inc.out" \
2> "${MY_TMP_DIR}/test-audit-reserves-inc.err" \
- || exit_fail "incremental reserves audit failed"
+ || exit_fail "incremental reserves audit failed (see ${MY_TMP_DIR}/test-audit-reserves-inc.*)"
echo -n "."
$VALGRIND taler-helper-auditor-wire \
-i \
-L DEBUG \
-c "$CONF" \
-t \
- > "${MY_TMP_DIR}/test-wire-audit.out" \
- 2> "${MY_TMP_DIR}/test-wire-audit.err" \
- || exit_fail "wire audit failed"
+ > "${MY_TMP_DIR}/test-audit-wire.out" \
+ 2> "${MY_TMP_DIR}/test-audit-wire.err" \
+ || exit_fail "wire audit failed (see ${MY_TMP_DIR}/test-audit-wire.*)"
echo -n "."
$VALGRIND taler-helper-auditor-wire \
-i \
-L DEBUG \
-c "$CONF" \
-t \
- > "${MY_TMP_DIR}/test-wire-audit-inc.out" \
- 2> "${MY_TMP_DIR}/test-wire-audit-inc.err" \
- || exit_fail "wire audit inc failed"
+ > "${MY_TMP_DIR}/test-audit-wire-inc.out" \
+ 2> "${MY_TMP_DIR}/test-audit-wire-inc.err" \
+ || exit_fail "wire audit inc failed (see ${MY_TMP_DIR}/test-audit-wire-inc.*)"
echo -n "."
echo " DONE"
@@ -2211,32 +2211,45 @@ grep -v host \
> "$TMPDIR/pg_hba.conf.new"
mv "$TMPDIR/pg_hba.conf.new" "$TMPDIR/pg_hba.conf"
"${POSTGRES_PATH}/pg_ctl" \
- -D "$TMPDIR" \
- -l "${MY_TMP_DIR}/postgres.log" \
- start \
- > "${MY_TMP_DIR}/postgres-start.log" \
- 2> "${MY_TMP_DIR}/postgres-start.err"
+ -D "$TMPDIR" \
+ -l "${MY_TMP_DIR}/postgres.log" \
+ start \
+ > "${MY_TMP_DIR}/postgres-start.log" \
+ 2> "${MY_TMP_DIR}/postgres-start.err"
echo " DONE"
PGHOST="$TMPDIR/sockets"
export PGHOST
MYDIR="${MY_TMP_DIR}/basedb"
mkdir -p "${MYDIR}"
-echo "Generating fresh database at $MYDIR"
-if faketime -f '-1 d' ./generate-auditor-basedb.sh -d "$MYDIR/$DB"
+if [ -z $REUSE_BASEDB_DIR ]
then
- echo -n "Reset 'auditor-basedb' database at $PGHOST ..."
- dropdb "auditor-basedb" >/dev/null 2>/dev/null || true
- createdb "auditor-basedb" || exit_skip "Could not create database '$BASEDB' at $PGHOST"
- echo " DONE"
- check_with_database "$MYDIR/$DB"
- if [ "$fail" != "0" ]
+ echo "Generating fresh database at $MYDIR"
+
+ if faketime -f '-1 d' ./generate-auditor-basedb.sh -d "$MYDIR/$DB"
then
- exit "$fail"
+ echo -n "Reset 'auditor-basedb' database at $PGHOST ..."
+ dropdb "auditor-basedb" >/dev/null 2>/dev/null || true
+ createdb "auditor-basedb" || exit_skip "Could not create database '$BASEDB' at $PGHOST"
+ echo " DONE"
+ else
+ echo "Generation failed"
+ exit 1
fi
else
- echo "Generation failed"
- exit 1
+ echo "Reusing existing database from ${REUSE_BASEDB_DIR}"
+ cp -r "${REUSE_BASEDB_DIR}/basedb"/* "${MYDIR}/"
+fi
+
+check_with_database "$MYDIR/$DB"
+if [ "$fail" != "0" ]
+then
+ exit "$fail"
+fi
+
+if [ -z $REUSE_BASEDB_DIR ]
+then
+ echo "Run 'export REUSE_BASEDB_DIR=${MY_TMP_DIR}' to re-run tests against the same database"
fi
exit 0