From 4f514abead3961805385f69671ebceac88e967f7 Mon Sep 17 00:00:00 2001 From: MS Date: Wed, 11 Jan 2023 16:29:10 +0100 Subject: tests: fix libeufin user registration. --- src/cli/test_anastasis_reducer_enter_secret.sh | 2 -- src/cli/test_iban.sh | 36 ++++++++++++-------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/cli/test_anastasis_reducer_enter_secret.sh b/src/cli/test_anastasis_reducer_enter_secret.sh index 1de5289..39529d7 100755 --- a/src/cli/test_anastasis_reducer_enter_secret.sh +++ b/src/cli/test_anastasis_reducer_enter_secret.sh @@ -149,8 +149,6 @@ echo " OK" # Launch services echo -n "Launching taler services ..." -# FIXME-MS: I tired to convert this from taler-bank-manage to -# taler-bank-manage-testing, but it still fails to launch the bank :-( taler-bank-manage-testing $BANK_PORT $TALER_DB $EXCHANGE_URL $CONF > taler-bank.log 2> taler-bank.err & taler-exchange-secmod-eddsa -c $CONF 2> taler-exchange-secmod-eddsa.log & taler-exchange-secmod-rsa -c $CONF 2> taler-exchange-secmod-rsa.log & diff --git a/src/cli/test_iban.sh b/src/cli/test_iban.sh index 8278961..135ab02 100755 --- a/src/cli/test_iban.sh +++ b/src/cli/test_iban.sh @@ -29,26 +29,21 @@ function cleanup() # $1=ebics username, $2=ebics partner name, $3=person name, $4=sandbox bank account name, $5=iban function prepare_sandbox_account() { - echo -n "Activating ebics subscriber $1 at the sandbox ..." - libeufin-cli \ - sandbox --sandbox-url=$SANDBOX_URL \ - ebicssubscriber create \ - --host-id=$EBICS_HOST \ - --partner-id=$2 \ - --user-id=$1 + echo -n "Registering $4 to the Sandbox..." + export LIBEUFIN_SANDBOX_USERNAME=$4 + export LIBEUFIN_SANDBOX_PASSWORD=unused + libeufin-cli sandbox --sandbox-url=$SANDBOX_URL demobank register --name "$3" echo " OK" - echo -n "Giving a bank account ($4) to $1 ..." - libeufin-cli \ - sandbox --sandbox-url=$SANDBOX_URL \ - ebicsbankaccount create \ - --iban=$5 \ - --bic="BCMAESM1XXX"\ - --person-name="$3" \ - --account-name=$4 \ - --ebics-user-id=$1 \ - --ebics-host-id=$EBICS_HOST \ - --ebics-partner-id=$2 + echo -n "Associating a EBICS subscriber to $4..." + export LIBEUFIN_SANDBOX_USERNAME=admin + libeufin-cli sandbox --sandbox-url=$SANDBOX_URL demobank new-ebicssubscriber \ + --host-id $EBICS_HOST \ + --user-id $1 --partner-id $2 \ + --bank-account $4 # that's a username _and_ a bank account name echo " OK" + + unset LIBEUFIN_SANDBOX_USERNAME + unset LIBEUFIN_SANDBOX_PASSWORD } function sync_providers() { @@ -189,6 +184,9 @@ if ! curl -s --retry 5 --retry-connrefused $NEXUS_URL > /dev/null; then fi echo " OK" +echo -n "Configuring Sandbox..." +libeufin-sandbox config default &> sandbox.log +echo " OK" echo -n "Starting Sandbox ..." libeufin-sandbox serve --no-auth &> sandbox.log & sandbox_pid=$! @@ -204,7 +202,7 @@ EBICS_HOST="ebicstesthost" export IBAN_CREDIT="DE89370400440532013000" export IBAN_DEBIT="FR1420041010050500013M02606" -echo -n "Preparing Sandbox ..." +echo -n "Preparing Sandbox (creating the EBICS host) ..." libeufin-cli \ sandbox --sandbox-url=$SANDBOX_URL \ ebicshost create \ -- cgit v1.2.3