commit 1eec7fe3e346755731ccc69d6a7d4f7fd09f187b
parent 325b16de31568310d48fad2409dd8752dc4b3ac1
Author: MS <ms@taler.net>
Date: Fri, 10 Mar 2023 17:18:01 +0100
Testing.
Preparation to run the wirewatch.
Diffstat:
3 files changed, 61 insertions(+), 7 deletions(-)
diff --git a/cli/tests/launch_services.sh b/cli/tests/launch_services.sh
@@ -4,6 +4,8 @@
# EBICS pair, in order to try CLI commands.
set -eu
+WITH_TASKS=1
+# WITH_TASKS=0
function exit_cleanup()
{
echo "Running exit-cleanup"
@@ -20,15 +22,23 @@ echo RUNNING SANDBOX-NEXUS EBICS PAIR
jq --version &> /dev/null || (echo "'jq' command not found"; exit 77)
curl --version &> /dev/null || (echo "'curl' command not found"; exit 77)
-DB_PATH=/tmp/libeufin-cli-test.sqlite3
-export LIBEUFIN_SANDBOX_DB_CONNECTION=jdbc:sqlite:$DB_PATH
+SQLITE_FILE_PATH=/tmp/libeufin-cli-test.sqlite3
+DB_CONN=jdbc:postgresql://localhost:5432/taler?user=$(whoami)
+# export LIBEUFIN_SANDBOX_DB_CONNECTION=jdbc:sqlite:$SQLITE_FILE_PATH
+export LIBEUFIN_SANDBOX_DB_CONNECTION=$DB_CONN
echo -n Delete previous data...
-rm -f $DB_PATH
+rm -f $SQLITE_FILE_PATH
echo DONE
echo -n Configure the default demobank with MANA...
libeufin-sandbox config --with-signup-bonus --currency MANA default
echo DONE
+echo -n Setting the default exchange at Sandbox...
+libeufin-sandbox \
+ default-exchange \
+ "https://exchange.example.com/" \
+ "payto://iban/NOTUSED"
+echo DONE
echo -n Start the bank...
export LIBEUFIN_SANDBOX_ADMIN_PASSWORD=foo
libeufin-sandbox serve &> sandbox.log &
@@ -38,7 +48,7 @@ echo -n Wait for the bank...
curl --max-time 2 --retry-connrefused --retry-delay 1 --retry 10 http://localhost:5000/ &> /dev/null
echo DONE
echo -n Make one superuser at Nexus...
-export LIBEUFIN_NEXUS_DB_CONNECTION=jdbc:sqlite:$DB_PATH
+export LIBEUFIN_NEXUS_DB_CONNECTION=$DB_CONN
libeufin-nexus superuser test-user --password x
echo DONE
echo -n Launching Nexus...
@@ -100,7 +110,27 @@ libeufin-cli facades \
--currency TESTKUDOS --facade-name test-facade \
wwwconn www-nexus
echo OK
-echo -n "Ticking, to let statements be generated..."
-libeufin-sandbox camt053tick
-echo OK
+
+if test 1 = $WITH_TASKS; then
+ echo -n Creating submit transactions task..
+ libeufin-cli accounts task-schedule \
+ --task-type submit \
+ --task-name www-payments \
+ --task-cronspec "* * *" \
+ www-nexus || true
+ # Tries every second. Ask C52
+ echo OK
+ echo -n Creating fetch transactions task..
+ # Not idempotent, FIXME #7739
+ libeufin-cli accounts task-schedule \
+ --task-type fetch \
+ --task-name www-history \
+ --task-cronspec "* * *" \
+ --task-param-level report \
+ --task-param-range-type latest \
+ www-nexus || true
+ echo OK
+else
+ echo NOT creating backound tasks!
+fi
read -p "Press Enter to terminate..."
diff --git a/cli/tests/wire-transfer.sh b/cli/tests/wire-transfer.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -eu
+# Pays the www Sandbox user, usually owned by the Exchange.
+RESERVE_PUB=$(gnunet-ecc -g1 /tmp/www &> /dev/null && gnunet-ecc -p /tmp/www)
+# Must match the one from launch_services.sh
+export LIBEUFIN_SANDBOX_DB_CONNECTION=jdbc:postgresql://localhost:5432/taler?user=$(whoami)
+libeufin-sandbox \
+ make-transaction \
+ --credit-account=www \
+ --debit-account=admin MANA:2 \
+ $RESERVE_PUB
+echo Now paid reserve $RESERVE_PUB
diff --git a/cli/tests/wirewatch.conf b/cli/tests/wirewatch.conf
@@ -0,0 +1,11 @@
+[exchange-accountcredentials-1]
+WIRE_GATEWAY_URL = "http://localhost:5001/facades/test-facade/taler-wire-gateway/"
+WIRE_GATEWAY_AUTH_METHOD = basic
+USERNAME = test-user
+PASSWORD = x
+
+[exchange-account-1]
+# What is the account URL?
+PAYTO_URI = "payto://iban/NOTUSED"
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES