summaryrefslogtreecommitdiff
path: root/src/cli/test_anastasis_reducer_enter_secret.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/test_anastasis_reducer_enter_secret.sh')
-rwxr-xr-xsrc/cli/test_anastasis_reducer_enter_secret.sh57
1 files changed, 40 insertions, 17 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