[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 01/05: Testing.
From: |
gnunet |
Subject: |
[libeufin] 01/05: Testing. |
Date: |
Fri, 10 Mar 2023 17:44:31 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
commit 1eec7fe3e346755731ccc69d6a7d4f7fd09f187b
Author: MS <ms@taler.net>
AuthorDate: Fri Mar 10 17:18:01 2023 +0100
Testing.
Preparation to run the wirewatch.
---
cli/tests/launch_services.sh | 44 +++++++++++++++++++++++++++++++++++++-------
cli/tests/wire-transfer.sh | 13 +++++++++++++
cli/tests/wirewatch.conf | 11 +++++++++++
3 files changed, 61 insertions(+), 7 deletions(-)
diff --git a/cli/tests/launch_services.sh b/cli/tests/launch_services.sh
index fdd5a74d..30ba44e1 100755
--- 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
new file mode 100755
index 00000000..c29aae30
--- /dev/null
+++ 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
new file mode 100644
index 00000000..b82f9e11
--- /dev/null
+++ 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
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.