aboutsummaryrefslogtreecommitdiff
path: root/src/auditor/test-auditor.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-09-13 12:19:02 +0200
committerChristian Grothoff <christian@grothoff.org>2022-09-13 12:20:10 +0200
commitfed7102ad5e24382c1ceed089e92498098084075 (patch)
treeccb0de9506ac548d5ad979105b7d64efa7046c2a /src/auditor/test-auditor.sh
parent0a618f77cd6d9dca248877e7f51409e8c420891a (diff)
downloadexchange-fed7102ad5e24382c1ceed089e92498098084075.tar.xz
-fix test-auditor.sh
Diffstat (limited to 'src/auditor/test-auditor.sh')
-rwxr-xr-xsrc/auditor/test-auditor.sh31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index 89350cbec..1b48acbd4 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -255,10 +255,6 @@ function run_audit () {
done
echo "... DONE."
export CONF
- MASTER_PRIV_FILE=`taler-config -f -c ${CONF} -s exchange-offline -o MASTER_PRIV_FILE`
- MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE`
-
- echo "MASTER PUB is ${MASTER_PUB} using file ${MASTER_PRIV_FILE}"
echo -n "Running taler-exchange-offline drain "
@@ -280,8 +276,15 @@ function run_audit () {
export LIBEUFIN_NEXUS_PASSWORD=x
export LIBEUFIN_NEXUS_URL=http://localhost:8082/
PAIN_UUID=`libeufin-cli accounts list-payments exchange-nexus | jq .initiatedPayments[] | jq 'select(.submitted==false)' | jq -r .paymentInitiationId`
- libeufin-cli accounts submit-payments --payment-uuid ${PAIN_UUID} exchange-nexus
-
+ if test -z "${PAIN_UUID}"
+ then
+ echo -n "Payment likely already submitted, running submit-payments without UUID anyway ..."
+ libeufin-cli accounts submit-payments exchange-nexus
+ else
+ echo -n "Running submitting payment ${PAIN_UUID} ..."
+ libeufin-cli accounts submit-payments --payment-uuid ${PAIN_UUID} exchange-nexus
+ fi
+ echo " DONE"
fi
audit_only
post_audit
@@ -1959,13 +1962,16 @@ function test_33() {
# Run all the tests against the database given in $1.
# Sets $fail to 0 on success, non-zero on failure.
-check_with_database()
+function check_with_database()
{
BASEDB=$1
+ CONF=$1.conf
echo "Running test suite with database $BASEDB using configuration $CONF"
+ MASTER_PRIV_FILE=${BASEDB}.mpriv
+ taler-config -f -c ${CONF} -s exchange-offline -o MASTER_PRIV_FILE -V ${MASTER_PRIV_FILE}
+ MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE`
- # Setup database-specific globals
- MASTER_PUB=`cat ${BASEDB}.mpub`
+ echo "MASTER PUB is ${MASTER_PUB} using file ${MASTER_PRIV_FILE}"
# Load database
full_reload
@@ -1995,9 +2001,6 @@ check_with_database()
# Postgres database to use
DB=auditor-basedb
-# Configuration file to use
-CONF=${DB}.conf
-
# test required commands exist
echo "Testing for jq"
jq -h > /dev/null || exit_skip "jq required"
@@ -2041,9 +2044,9 @@ EXPORT PGHOST="@POSTGRES_SOCKET"
echo "Generating fresh database at $MYDIR"
-if faketime -f '-1 d' ./generate-auditor-basedb.sh $MYDIR/basedb
+if faketime -f '-1 d' ./generate-auditor-basedb.sh $MYDIR/auditor-basedb
then
- check_with_database $MYDIR/basedb
+ check_with_database $MYDIR/auditor-basedb
if test x$fail != x0
then
exit $fail