aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_merchant_product_creation.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-08-23 14:14:28 +0200
committerChristian Grothoff <christian@grothoff.org>2023-08-23 14:14:33 +0200
commit7eccc771b6bd99a1feacbd4321767ae8e76e2d2c (patch)
tree55eb6e390baf0712906382f828510422605bc40a /src/testing/test_merchant_product_creation.sh
parentc98d960d1badd1eeb834bacbc133960e2f86d304 (diff)
switch merchant tests to fakebank, libeufin is a dumpster on fire
Diffstat (limited to 'src/testing/test_merchant_product_creation.sh')
-rwxr-xr-xsrc/testing/test_merchant_product_creation.sh51
1 files changed, 36 insertions, 15 deletions
diff --git a/src/testing/test_merchant_product_creation.sh b/src/testing/test_merchant_product_creation.sh
index 1da57a04..dd3a60b5 100755
--- a/src/testing/test_merchant_product_creation.sh
+++ b/src/testing/test_merchant_product_creation.sh
@@ -19,21 +19,36 @@
set -eu
-
-echo "Re-initializing database (needed for current libeufin)" # FIXME-MS: enable idempotency AND db-reset!
-dropdb talercheck || true
-createdb talercheck
-
+# Replace with 0 for nexus...
+USE_FAKEBANK=1
+if [ 1 = "$USE_FAKEBANK" ]
+then
+ ACCOUNT="exchange-account-2"
+ WIRE_METHOD="x-taler-bank"
+ BANK_FLAGS="-f -d $WIRE_METHOD -u $ACCOUNT"
+ BANK_URL="http://localhost:8082/taler-bank-access/"
+else
+ ACCOUNT="exchange-account-1"
+ WIRE_METHOD="iban"
+ BANK_FLAGS="-ns -d $WIRE_METHOD -u $ACCOUNT"
+ BANK_URL="http://localhost:18082/demobanks/default/access-api/"
+fi
. setup.sh
# Launch system.
-setup -c "test_template.conf" -enms -u "exchange-account-1" -d "iban"
-LAST_RESPONSE=$(mktemp test_response.conf-XXXXXX)
-WALLET_DB=$(mktemp test_wallet.json-XXXXXX)
+setup -c "test_template.conf" \
+ -em \
+ $BANK_FLAGS
+LAST_RESPONSE=$(mktemp -p "${TMPDIR:-/tmp}" test_response.conf-XXXXXX)
+WALLET_DB=$(mktemp -p "${TMPDIR:-/tmp}" test_wallet.json-XXXXXX)
CONF="test_template.conf.edited"
-BANK_URL="http://localhost:18082/demobanks/default/"
-FORTYTHREE=$(get_payto_uri fortythree x)
+if [ 1 = "$USE_FAKEBANK" ]
+then
+ FORTYTHREE="payto://x-taler-bank/localhost/fortythree?receiver-name=fortythree"
+else
+ FORTYTHREE=$(get_payto_uri fortythree x)
+fi
EXCHANGE_URL="http://localhost:8081/"
echo -n "Configuring merchant instance ..."
@@ -189,14 +204,20 @@ taler-wallet-cli \
bankAccessApiBaseUrl: $BANK_URL,
exchangeBaseUrl: $EXCHANGE_URL
}' \
- --arg BANK_URL "$BANK_URL/access-api/" \
+ --arg BANK_URL "$BANK_URL" \
--arg EXCHANGE_URL "$EXCHANGE_URL"
)" 2>wallet-withdraw-1.err >wallet-withdraw-1.out
echo -n "."
-sleep 10
-# NOTE: once libeufin can do long-polling, we should
-# be able to reduce the delay here and run wirewatch
-# always in the background via setup
+if [ 1 = "$USE_FAKEBANK" ]
+then
+ # Fakebank is instant...
+ sleep 0
+else
+ sleep 10
+ # NOTE: once libeufin can do long-polling, we should
+ # be able to reduce the delay here and run wirewatch
+ # always in the background via setup
+fi
echo -n "."
taler-exchange-wirewatch -L "INFO" -c "$CONF" -t &> taler-exchange-wirewatch.out
echo -n "."