gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: -more work on test_iban.sh


From: gnunet
Subject: [taler-anastasis] branch master updated: -more work on test_iban.sh
Date: Tue, 24 Aug 2021 21:41:38 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new fae146d  -more work on test_iban.sh
fae146d is described below

commit fae146d1def6167b9fcc144c01ba37e6671cf159
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Aug 24 21:41:36 2021 +0200

    -more work on test_iban.sh
---
 .../anastasis-helper-authorization-iban.c          |  7 ++-
 src/authorization/iban.c                           |  2 +-
 src/cli/test_free_reducer.conf                     |  4 +-
 src/cli/test_iban.sh                               | 59 +++++-----------------
 4 files changed, 23 insertions(+), 49 deletions(-)

diff --git a/src/authorization/anastasis-helper-authorization-iban.c 
b/src/authorization/anastasis-helper-authorization-iban.c
index d509c0e..4a14d05 100644
--- a/src/authorization/anastasis-helper-authorization-iban.c
+++ b/src/authorization/anastasis-helper-authorization-iban.c
@@ -216,6 +216,11 @@ history_cb (void *cls,
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "End of list.\n");
     GNUNET_assert (NULL == task);
+    if (test_mode)
+    {
+      GNUNET_SCHEDULER_shutdown ();
+      return GNUNET_OK; /* will be ignored anyway */
+    }
     task = GNUNET_SCHEDULER_add_delayed (idle_sleep_interval,
                                          &find_transfers,
                                          NULL);
@@ -240,7 +245,7 @@ history_cb (void *cls,
                                             details->wire_subject,
                                             &details->amount,
                                             details->debit_account_uri,
-                                            details->credit_account_uri,
+                                            credit_account_uri,
                                             details->execution_date);
   switch (qs)
   {
diff --git a/src/authorization/iban.c b/src/authorization/iban.c
index 9547790..f2bb211 100644
--- a/src/authorization/iban.c
+++ b/src/authorization/iban.c
@@ -14,7 +14,7 @@ extract_code (const char *wire_subject,
   unsigned long long c;
   const char *pos;
 
-  if (0 !=
+  if (NULL ==
       strcasestr (wire_subject,
                   "anastasis"))
   {
diff --git a/src/cli/test_free_reducer.conf b/src/cli/test_free_reducer.conf
index ba11c56..9445c7e 100644
--- a/src/cli/test_free_reducer.conf
+++ b/src/cli/test_free_reducer.conf
@@ -14,6 +14,9 @@ PORT = 8086
 SERVER_SALT = BUfO1KGOKYIFlFQg
 BUSINESS_NAME = "Data loss Inc."
 
+[stasis]
+CONFIG = postgres:///anastasischeck
+
 [anastasis-merchant-backend]
 # Technically not needed...
 PAYMENT_BACKEND_URL = http://localhost:9966/
@@ -24,4 +27,3 @@ COST = EUR:0.0
 [authorization-iban]
 ENABLED = YES
 COST = EUR:5
-BUSINESS_NAME = "Data loss inc."
diff --git a/src/cli/test_iban.sh b/src/cli/test_iban.sh
index 8d090e1..f3f9f79 100755
--- a/src/cli/test_iban.sh
+++ b/src/cli/test_iban.sh
@@ -129,41 +129,6 @@ export B1FILE
 export R2FILE
 export R1FILE
 
-
-
-# Script's guidelines:
-
-#* uses 'CURRENCY=TESTKUDOS' and uses $CURRENCY for all
-#  currencies in what follows ...
-#* for databases, use either 'anastasischeck' for Postgres
-#  or an sqlite file created via "mktemp /tmp/test-XXXXXX"
-#  or something like that
-#* exits with 77 if libeufin is not properly installed/available
-#  installed/available
-#* starts Nexus (in background)
-#* starts sandbox (in background)
-#* creates two IBAN accounts
-#* stores IBANs of both accounts in shell variables,
-#  call them IBAN_CREDIT and IBAN_DEBIT.
-#* configures an Anastasis facade for IBAN_CREDIT.
-#* exports authentication credentials (URL, access token)
-#  for the facade to shell variables
-#  (FACADE_URL, FACADE_AUTH_TOKEN)
-#  ~~~~~~~~~
-#* contains a command to do a wire-transfer (pick your amount)
-#  from DEBIT to CREDIT (setup authentication as needed to
-#  trigger the transfer)
-#
-#
-#Make sure 'set -eu' and include some progress indicators, like:
-#
-#echo -n "Starting nexus ..."
-## DO WORK
-#echo " DONE"
-#echo -n "Starting sandbox ..."
-## DO WORK
-#echo " DONE"
-
 echo -n "Testing for libeufin-cli"
 libeufin-cli --version > /dev/null || exit_skip "libeufin-cli required"
 echo " FOUND"
@@ -214,19 +179,20 @@ IBAN_DEBIT="FR1420041010050500013M02606"
 export IBAN_CREDIT
 export IBAN_DEBIT
 
-echo Preparing Sandbox ...
-echo -n "Making an ebics host at the sandbox "
+echo -n "Preparing Sandbox ..."
 libeufin-cli \
   sandbox --sandbox-url=$SANDBOX_URL \
     ebicshost create \
       --host-id=$EBICS_HOST
 echo " OK"
 
+PERSON_CREDIT_NAME="Person Credit"
+
 # note: Ebisc schema doesn't allow dashed names.
 prepare_sandbox_account \
   ebicsuserCredit \
   ebicspartnerCredit \
-  "Person Credit" \
+  "${PERSON_CREDIT_NAME}" \
   sandbox-account-credit \
   $IBAN_CREDIT
 prepare_sandbox_account \
@@ -235,13 +201,12 @@ prepare_sandbox_account \
   "Person Debit" \
   sandbox-account-debit \
   $IBAN_DEBIT
-echo Sandbox preparation done
-echo Preparing Nexus ...
+echo "Sandbox preparation done"
+echo -n "Preparing Nexus ..."
 export LIBEUFIN_NEXUS_URL=$NEXUS_URL
 # Make debit user, will buy Anastasis services.
 DEBIT_USERNAME=anastasis-debit-user
 DEBIT_PASSWORD=anastasis-debit-password
-echo -n create debit user at Nexus ...
 libeufin-nexus superuser $DEBIT_USERNAME --password=$DEBIT_PASSWORD
 echo " OK"
 export LIBEUFIN_NEXUS_USERNAME=$DEBIT_USERNAME
@@ -257,7 +222,7 @@ prepare_nexus_account \
 # Make credit user, will be Anastasis client.
 CREDIT_USERNAME=anastasis-credit-user
 CREDIT_PASSWORD=anastasis-credit-password
-echo -n "create credit user (for anastasis) at Nexus ..."
+echo -n "Create credit user (for anastasis) at Nexus ..."
 libeufin-nexus superuser $CREDIT_USERNAME --password=$CREDIT_PASSWORD
 echo " OK"
 export LIBEUFIN_NEXUS_USERNAME=$CREDIT_USERNAME
@@ -270,7 +235,7 @@ prepare_nexus_account \
   nexus-bankaccount-credit \
   sandbox-account-credit
 
-echo -n create facade ...
+echo -n "Create facade ..."
 libeufin-cli facades new-anastasis-facade \
   --currency=$CURRENCY \
   --facade-name=facade-credit \
@@ -279,7 +244,6 @@ echo " OK"
 FACADE_URL=$(libeufin-cli facades list | jq .facades[0].baseUrl | tr -d \")
 
 ## Reach facade with: $FACADE_URL + $CREDIT_USERNAME + $CREDIT_PASSWORD
-echo Nexus preparation done.
 
 echo -n "Initialize Anastasis database ..."
 # Name of the Postgres database we will use for the script.
@@ -299,6 +263,10 @@ anastasis-config -c $CONF \
                  -s authorization-iban \
                  -o CREDIT_IBAN \
                  -V "${IBAN_CREDIT}"
+anastasis-config -c $CONF \
+                 -s authorization-iban \
+                 -o BUSINESS_NAME \
+                 -V "${PERSON_CREDIT_NAME}"
 anastasis-config -c $CONF \
                  -s authorization-iban \
                  -o WIRE_GATEWAY_URL \
@@ -313,7 +281,7 @@ anastasis-config -c $CONF \
                  -V "${LIBEUFIN_NEXUS_USERNAME}"
 anastasis-config -c $CONF \
                  -s authorization-iban \
-                 -o WIRE_GATEWAY_AUTH_METHOD \
+                 -o PASSWORD \
                  -V "${LIBEUFIN_NEXUS_PASSWORD}"
 echo " OK"
 
@@ -461,7 +429,6 @@ wire_transfer_to_anastasis "${AMOUNT}" "${SUBJECT}"
 
 echo " OK"
 
-bash
 echo -n "Triggering inbound check ..."
 anastasis-helper-authorization-iban -c $CONF -t
 echo " OK"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]