summaryrefslogtreecommitdiff
path: root/src/cli
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-17 21:48:15 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-17 21:48:15 +0100
commit92343ce802a7cddabf36ba7c1aa330ae5558480d (patch)
tree9bdf7f6a5b80d24f998211ed200ac523dbd6b098 /src/cli
parentf7742d1a5ac891f0fc2cb162d8c94daa37eb9fd2 (diff)
downloadanastasis-92343ce802a7cddabf36ba7c1aa330ae5558480d.tar.gz
anastasis-92343ce802a7cddabf36ba7c1aa330ae5558480d.tar.bz2
anastasis-92343ce802a7cddabf36ba7c1aa330ae5558480d.zip
work on test_anastasis_reducer_enter_secret.sh
Diffstat (limited to 'src/cli')
-rwxr-xr-xsrc/cli/test_anastasis_reducer_enter_secret.sh57
-rw-r--r--src/cli/test_reducer.conf26
2 files changed, 54 insertions, 29 deletions
diff --git a/src/cli/test_anastasis_reducer_enter_secret.sh b/src/cli/test_anastasis_reducer_enter_secret.sh
index 2103679..36a764d 100755
--- a/src/cli/test_anastasis_reducer_enter_secret.sh
+++ b/src/cli/test_anastasis_reducer_enter_secret.sh
@@ -22,6 +22,27 @@ function exit_fail() {
exit 1
}
+# Stop libeufin sandbox and nexus (if running)
+function stop_libeufin()
+{
+ echo "Stopping libeufin..."
+ if test -f libeufin-sandbox.pid
+ then
+ PID=`cat libeufin-sandbox.pid 2> /dev/null`
+ echo "Killing libeufin sandbox $PID"
+ rm libeufin-sandbox.pid
+ kill $PID 2> /dev/null || true
+ fi
+ if test -f libeufin-nexus.pid
+ then
+ PID=`cat libeufin-nexus.pid 2> /dev/null`
+ echo "Killing libeufin nexus $PID"
+ rm libeufin-nexus.pid
+ kill $PID 2> /dev/null || true
+ fi
+ echo "Stopping libeufin DONE"
+}
+
# Cleanup to run whenever we exit
function cleanup()
{
@@ -29,6 +50,7 @@ function cleanup()
do
kill $n 2> /dev/null || true
done
+ stop_libeufin
rm -rf $CONF $WALLET_DB $TFILE $UFILE $TMP_DIR
wait
}
@@ -113,8 +135,8 @@ MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE`
EXCHANGE_URL=`taler-config -c $CONF -s EXCHANGE -o BASE_URL`
MERCHANT_PORT=`taler-config -c $CONF -s MERCHANT -o PORT`
MERCHANT_URL=http://localhost:${MERCHANT_PORT}/
-BANK_PORT=`taler-config -c $CONF -s BANK -o HTTP_PORT`
-BANK_URL=http://localhost:${BANK_PORT}/
+NEXUS_PORT=8082
+BANK_URL=http://localhost:1${NEXUS_PORT}/
AUDITOR_URL=http://localhost:8083/
AUDITOR_PRIV_FILE=`taler-config -f -c $CONF -s AUDITOR -o AUDITOR_PRIV_FILE`
AUDITOR_PRIV_DIR=`dirname $AUDITOR_PRIV_FILE`
@@ -149,13 +171,14 @@ echo " OK"
# Launch services
echo -n "Launching taler services ..."
-taler-bank-manage-testing $BANK_PORT $TALER_DB $EXCHANGE_URL $CONF > taler-bank.log 2> taler-bank.err &
+rm -f $TALER_DB
+taler-bank-manage-testing $NEXUS_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 &
taler-exchange-secmod-cs -c $CONF 2> taler-exchange-secmod-cs.log &
-taler-exchange-httpd -c $CONF 2> taler-exchange-httpd.log &
-taler-merchant-httpd -c $CONF -L INFO 2> taler-merchant-httpd.log &
-taler-exchange-wirewatch -c $CONF 2> taler-exchange-wirewatch.log &
+taler-exchange-httpd -L INFO -c $CONF 2> taler-exchange-httpd.log &
+taler-merchant-httpd -L INFO -c $CONF -L INFO 2> taler-merchant-httpd.log &
+taler-exchange-wirewatch -L INFO --longpoll-timeout=1s -c $CONF 2> taler-exchange-wirewatch.log &
taler-auditor-httpd -L INFO -c $CONF 2> taler-auditor-httpd.log &
echo " OK"
@@ -211,9 +234,9 @@ echo -n "Setting up keys ..."
taler-exchange-offline -c $CONF \
download \
sign \
- enable-account payto://x-taler-bank/localhost/Exchange \
+ enable-account `taler-config -c $CONF -s exchange-account-1 -o PAYTO_URI` \
enable-auditor $AUDITOR_PUB $AUDITOR_URL "TESTKUDOS Auditor" \
- wire-fee now x-taler-bank TESTKUDOS:0.01 TESTKUDOS:0.01 \
+ wire-fee now iban TESTKUDOS:0.01 TESTKUDOS:0.01 \
upload &> taler-exchange-offline.log
echo -n "."
@@ -345,17 +368,17 @@ fi
echo -en $COLOR$BOLD"Withdrawing amount to wallet ..."$NORM$NOCOLOR
rm $WALLET_DB
-taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api 'withdrawTestBalance' \
+taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api --expect-success 'withdrawTestBalance' \
"$(jq -n '
{
amount: "TESTKUDOS:40",
bankBaseUrl: $BANK_URL,
exchangeBaseUrl: $EXCHANGE_URL
}' \
- --arg BANK_URL "$BANK_URL" \
+ --arg BANK_URL "${BANK_URL}demobanks/default/access-api/" \
--arg EXCHANGE_URL "$EXCHANGE_URL"
- )" 2>wallet.err >wallet.log
-taler-wallet-cli --wallet-db=$WALLET_DB run-until-done 2>wallet.err >wallet.log
+ )" 2>wallet-withdraw.err >wallet-withdraw.log
+taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB run-until-done 2>wallet-withdraw-finish.err >wallet-withdraw-finish.log
echo " OK"
@@ -366,12 +389,12 @@ do
PAY_URI=`jq --argjson INDEX $INDEX -r -e '.payments[$INDEX]' < $TFILE`
# run wallet CLI
echo -n "$INDEX"
- taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>wallet.err >wallet.log
+ taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB handle-uri ${PAY_URI} -y 2>wallet-pay1.err >wallet-pay1.log
echo -n ","
done
echo " OK"
echo -e $COLOR$BOLD"Running wallet run-pending..."$NORM$NOCOLOR
-taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet.err >wallet.log
+taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet-pay-finish.err >wallet-pay-finish.log
echo -e $COLOR$BOLD"Payments done"$NORM$NOCOLOR
@@ -398,12 +421,12 @@ do
# run wallet CLI
export PAY_URI
echo -n "$INDEX"
- taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>wallet.err >wallet.log
+ taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>wallet-pay2-$INDEX.err >wallet-pay2-$INDEX.log
echo -n ","
done
echo " OK"
echo -e $COLOR$BOLD"Running wallet run-pending..."$NORM$NOCOLOR
-taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet.err >wallet.log
+taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet-pay2-finish.err >wallet-pay2-finish.log
echo -e $COLOR$BOLD"Payments done"$NORM$NOCOLOR
echo -en $COLOR$BOLD"Try to upload again ..."$NORM$NOCOLOR
@@ -422,5 +445,5 @@ fi
jq -r -e .core_secret < $UFILE > /dev/null && exit_fail "'core_secret' was not cleared upon success"
echo " OK"
-
+rm -f $TALER_DB
exit 0
diff --git a/src/cli/test_reducer.conf b/src/cli/test_reducer.conf
index e87313b..2c4ca04 100644
--- a/src/cli/test_reducer.conf
+++ b/src/cli/test_reducer.conf
@@ -44,6 +44,19 @@ REVOCATION_DIR = ${TALER_DATA_HOME}/exchange/revocations/
TERMS_ETAG = 0
PRIVACY_ETAG = 0
+# Account of the EXCHANGE
+[exchange-account-1]
+# What is the exchange's bank account (with the "Taler Bank" demo system)?
+PAYTO_URI = payto://iban/SANDBOXX/DE989651?receiver-name=Exchange+Company
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-1]
+WIRE_GATEWAY_URL = http://localhost:8082/facades/test-facade/taler-wire-gateway/
+WIRE_GATEWAY_AUTH_METHOD = basic
+USERNAME = exchange
+PASSWORD = x
+
[merchant]
SERVE = tcp
PORT = 9966
@@ -79,7 +92,7 @@ BASE_URL = "http://localhost:8083/"
DATABASE = postgres:///taler-auditor-basedb
MAX_DEBT = TESTKUDOS:50.0
MAX_DEBT_BANK = TESTKUDOS:100000.0
-HTTP_PORT = 8082
+HTTP_PORT = 18082
SUGGESTED_EXCHANGE = http://localhost:8081/
SUGGESTED_EXCHANGE_PAYTO = payto://x-taler-bank/localhost/2
ALLOW_REGISTRATIONS = YES
@@ -89,17 +102,6 @@ SERVE = http
IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
LEGAL_RESERVE_EXPIRATION_TIME = 7 years
-[exchange-account-1]
-PAYTO_URI = payto://x-taler-bank/localhost/Exchange
-enable_debit = yes
-enable_credit = yes
-
-[exchange-accountcredentials-1]
-WIRE_GATEWAY_URL = "http://localhost:8082/taler-wire-gateway/Exchange/"
-WIRE_GATEWAY_AUTH_METHOD = basic
-USERNAME = Exchange
-PASSWORD = x
-
[merchant-exchange-default]
EXCHANGE_BASE_URL = http://localhost:8081/
CURRENCY = TESTKUDOS