aboutsummaryrefslogtreecommitdiff
path: root/src/auditor/test-auditor.sh
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-07-26 04:05:39 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-07-26 04:05:39 +0200
commit0f17931b108deacb75eafa36234de088d38be22e (patch)
tree80a55ae8dd9f849b17a5dcbb93708be3e1d172ec /src/auditor/test-auditor.sh
parent1ce9312d0293444e55512bba69265f4671d387e9 (diff)
parenteae030fc4ff5df08eb113e49eb640e7cbe2b25cb (diff)
Merge branch 'master' of ssh://git.taler.net/exchange
Diffstat (limited to 'src/auditor/test-auditor.sh')
-rwxr-xr-xsrc/auditor/test-auditor.sh71
1 files changed, 1 insertions, 70 deletions
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index fb350a79..9912a02a 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -55,28 +55,6 @@ LIBEUFIN_SETTLE_TIME=1
. setup.sh
-# Stop libeufin sandbox and nexus (if running)
-function stop_libeufin()
-{
- echo -n "Stopping libeufin... "
- if test -f ${MY_TMP_DIR:-/}/libeufin-sandbox.pid
- then
- PID=$(cat ${MY_TMP_DIR}/libeufin-sandbox.pid 2> /dev/null)
- echo "Killing libeufin sandbox $PID"
- rm "${MY_TMP_DIR}/libeufin-sandbox.pid"
- kill "$PID" 2> /dev/null || true
- wait "$PID" || true
- fi
- if test -f ${MY_TMP_DIR:-/}/libeufin-nexus.pid
- then
- PID=$(cat ${MY_TMP_DIR}/libeufin-nexus.pid 2> /dev/null)
- echo "Killing libeufin nexus $PID"
- rm "${MY_TMP_DIR}/libeufin-nexus.pid"
- kill "$PID" 2> /dev/null || true
- wait "$PID" || true
- fi
- echo "DONE"
-}
# Cleanup exchange and libeufin between runs.
function cleanup()
@@ -118,52 +96,6 @@ function exit_cleanup()
# Install cleanup handler (except for kill -9)
trap exit_cleanup EXIT
-function launch_libeufin () {
-# shellcheck disable=SC2016
- export LIBEUFIN_SANDBOX_DB_CONNECTION='jdbc:postgresql://localhost/'"${DB}"'?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg='"$SOCKETDIR"'/.s.PGSQL.5432'
- export MY_TMP_DIR
- libeufin-sandbox serve --no-auth --port 18082 \
- > "${MY_TMP_DIR}/libeufin-sandbox-stdout.log" \
- 2> "${MY_TMP_DIR}/libeufin-sandbox-stderr.log" &
- echo $! > "${MY_TMP_DIR}/libeufin-sandbox.pid"
-# shellcheck disable=SC2016
- export LIBEUFIN_NEXUS_DB_CONNECTION='jdbc:postgresql://localhost/'"${DB}"'?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg='"$SOCKETDIR"'/.s.PGSQL.5432'
- libeufin-nexus serve --port 8082 \
- 2> "${MY_TMP_DIR}/libeufin-nexus-stderr.log" \
- > "${MY_TMP_DIR}/libeufin-nexus-stdout.log" &
- echo $! > "${MY_TMP_DIR}/libeufin-nexus.pid"
-}
-
-# Downloads new transactions from the bank.
-function nexus_fetch_transactions () {
- export LIBEUFIN_NEXUS_USERNAME="exchange"
- export LIBEUFIN_NEXUS_PASSWORD="x"
- export LIBEUFIN_NEXUS_URL="http://localhost:8082/"
- libeufin-cli accounts \
- fetch-transactions \
- --range-type since-last \
- --level report \
- exchange-nexus > /dev/null
- unset LIBEUFIN_NEXUS_USERNAME
- unset LIBEUFIN_NEXUS_PASSWORD
- unset LIBEUFIN_NEXUS_URL
-}
-
-
-# Instruct Nexus to all the prepared payments (= those
-# POSTed to /transfer by the exchange).
-function nexus_submit_to_sandbox () {
- export LIBEUFIN_NEXUS_USERNAME="exchange"
- export LIBEUFIN_NEXUS_PASSWORD="x"
- export LIBEUFIN_NEXUS_URL="http://localhost:8082/"
- libeufin-cli accounts \
- submit-payments\
- exchange-nexus
- unset LIBEUFIN_NEXUS_USERNAME
- unset LIBEUFIN_NEXUS_PASSWORD
- unset LIBEUFIN_NEXUS_URL
-}
-
# Operations to run before the actual audit
function pre_audit () {
@@ -2238,7 +2170,6 @@ function check_with_database()
{
BASEDB="$1"
CONF="$1.conf"
- ORIGIN=$(pwd)
echo "Running test suite with database $BASEDB using configuration $CONF"
MASTER_PRIV_FILE="${BASEDB}.mpriv"
taler-config \
@@ -2344,7 +2275,7 @@ 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 "$MYDIR/$DB"
+if faketime -f '-1 d' ./generate-auditor-basedb.sh -d "$MYDIR/$DB"
then
echo -n "Reset 'auditor-basedb' database at $PGHOST ..."
dropdb "auditor-basedb" >/dev/null 2>/dev/null || true