summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-14 22:32:37 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-14 22:32:37 +0200
commitb8649f414c160fc2882977b0fe11fc272feb879d (patch)
tree1bc4c87367d9c1db5a1bab385bd21087154352cd /src/testing
parentccb863d9287fefc52fdd792b374214cc2bd00812 (diff)
downloadmerchant-b8649f414c160fc2882977b0fe11fc272feb879d.tar.gz
merchant-b8649f414c160fc2882977b0fe11fc272feb879d.tar.bz2
merchant-b8649f414c160fc2882977b0fe11fc272feb879d.zip
bugfixes for wirewatch
Diffstat (limited to 'src/testing')
-rwxr-xr-xsrc/testing/test_merchant_wirewatch.sh31
-rw-r--r--src/testing/test_template.conf16
2 files changed, 18 insertions, 29 deletions
diff --git a/src/testing/test_merchant_wirewatch.sh b/src/testing/test_merchant_wirewatch.sh
index cd3ff4e4..b1fba6b2 100755
--- a/src/testing/test_merchant_wirewatch.sh
+++ b/src/testing/test_merchant_wirewatch.sh
@@ -19,6 +19,10 @@
# Testcase for #6363 (WiP)
set -eu
+echo "Re-initializing database (needed for current libeufin)" # FIXME-MS: enable idempotency AND db-reset!
+dropdb talercheck || true
+createdb talercheck
+
. setup.sh
# Launch exchange, merchant and bank.
setup -c "test_template.conf" -enms -u "exchange-account-1" -d "iban"
@@ -29,8 +33,7 @@ BANK_URL="http://localhost:18082/demobanks/default/"
EXCHANGE_URL="http://localhost:8081/"
-
-export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:libeufin-sandbox.sqlite3"
+export LIBEUFIN_SANDBOX_DB_CONNECTION='jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432'
export LIBEUFIN_SANDBOX_ADMIN_PASSWORD="secret"
export LIBEUFIN_SANDBOX_URL="http://localhost:18082/"
@@ -49,17 +52,13 @@ export SANDBOX_ACCOUNT_NAME="gnunet"
export LIBEUFIN_NEXUS_URL="http://localhost:8082"
# These two are from taler-bank-manage-testing...
-# Make credit user, will be Merchant client.
-CREDIT_USERNAME=$(taler-config -c "$CONF" \
- -s "taler-merchant-wirewatch" \
- -o "USERNAME")
-CREDIT_PASSWORD=$(taler-config -c "$CONF" \
- -s "taler-merchant-wirewatch" \
- -o "PASSWORD")
+# Define credentials for wirewatch user, will be Merchant client.
+CREDIT_USERNAME="merchant-wirewatch"
+CREDIT_PASSWORD="merchant-wirewatch-password"
echo -n "Create credit user (for gnunet-merchant) at Nexus ..."
-export LIBEUFIN_NEXUS_DB_CONNECTION="jdbc:sqlite:libeufin-nexus.sqlite3"
+export LIBEUFIN_NEXUS_DB_CONNECTION='jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432'
libeufin-nexus \
superuser "$CREDIT_USERNAME" \
--password="$CREDIT_PASSWORD" \
@@ -119,12 +118,10 @@ libeufin-cli \
FACADE_URL=$(libeufin-cli facades list | jq .facades[0].baseUrl | tr -d \")
-echo -n "Setting FACADE URL in configuration..."
-taler-config -c "$CONF" \
- -s "taler-merchant-wirewatch" \
- -o "WIRE_GATEWAY_URL" \
- -V "${FACADE_URL}"
-echo " OK"
+# FIXME: is this correct? Strange to use the super-user
+# credentials here!
+FACADE_USERNAME="${CREDIT_USERNAME}"
+FACADE_PASSWORD="${CREDIT_PASSWORD}"
echo -n "First prepare wallet with coins..."
rm -f "${WALLET_DB}"
@@ -168,7 +165,7 @@ GNUNET_PAYTO=$(get_payto_uri gnunet x)
STATUS=$(curl -H "Content-Type: application/json" -X POST \
-H 'Authorization: Bearer secret-token:super_secret' \
http://localhost:9966/management/instances \
- -d '{"auth":{"method":"external"},"accounts":[{"payto_uri":"'"$GNUNET_PAYTO"'"}],"id":"default","name":"default","user_type":"business","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 50000000},"default_pay_delay":{"d_us": 60000000}}' \
+ -d '{"auth":{"method":"external"},"accounts":[{"payto_uri":"'"$GNUNET_PAYTO"'","credit_facade_url":"'"${FACADE_URL}"'","credit_facade_credentials":{"type":"basic","username":"'"$FACADE_USERNAME"'","password":"'"$FACADE_PASSWORD"'"}}],"id":"default","name":"default","user_type":"business","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 50000000},"default_pay_delay":{"d_us": 60000000}}' \
-w "%{http_code}" -s -o /dev/null)
if [ "$STATUS" != "204" ]
diff --git a/src/testing/test_template.conf b/src/testing/test_template.conf
index cbd794c6..a81fba1e 100644
--- a/src/testing/test_template.conf
+++ b/src/testing/test_template.conf
@@ -49,24 +49,16 @@ FORCE_AUDIT = YES
[merchantdb-postgres]
CONFIG = postgres:///talercheck
-[taler-merchant-wirewatch]
-INSTANCE = "default"
-# This one will be set by test_merchant_wirewatch.sh
-# WIRE_GATEWAY_URL =
-WIRE_GATEWAY_AUTH_METHOD = BASIC
-USERNAME = merchant-wirewatch
-PASSWORD = merchant-wirewatch-password
-
[bank]
HTTP_PORT = 8082
[libeufin-nexus]
-#DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432"
-DB_CONNECTION="jdbc:sqlite:libeufin-nexus.sqlite3"
+DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432"
+#DB_CONNECTION="jdbc:sqlite:libeufin-nexus.sqlite3"
[libeufin-sandbox]
-#DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432"
-DB_CONNECTION="jdbc:sqlite:libeufin-sandbox.sqlite3"
+DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432"
+#DB_CONNECTION="jdbc:sqlite:libeufin-sandbox.sqlite3"
[auditor]