diff options
Diffstat (limited to 'src/cli/test_anastasis_reducer_enter_secret.sh')
-rwxr-xr-x | src/cli/test_anastasis_reducer_enter_secret.sh | 57 |
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() { | |||
22 | exit 1 | 22 | exit 1 |
23 | } | 23 | } |
24 | 24 | ||
25 | # Stop libeufin sandbox and nexus (if running) | ||
26 | function stop_libeufin() | ||
27 | { | ||
28 | echo "Stopping libeufin..." | ||
29 | if test -f libeufin-sandbox.pid | ||
30 | then | ||
31 | PID=`cat libeufin-sandbox.pid 2> /dev/null` | ||
32 | echo "Killing libeufin sandbox $PID" | ||
33 | rm libeufin-sandbox.pid | ||
34 | kill $PID 2> /dev/null || true | ||
35 | fi | ||
36 | if test -f libeufin-nexus.pid | ||
37 | then | ||
38 | PID=`cat libeufin-nexus.pid 2> /dev/null` | ||
39 | echo "Killing libeufin nexus $PID" | ||
40 | rm libeufin-nexus.pid | ||
41 | kill $PID 2> /dev/null || true | ||
42 | fi | ||
43 | echo "Stopping libeufin DONE" | ||
44 | } | ||
45 | |||
25 | # Cleanup to run whenever we exit | 46 | # Cleanup to run whenever we exit |
26 | function cleanup() | 47 | function cleanup() |
27 | { | 48 | { |
@@ -29,6 +50,7 @@ function cleanup() | |||
29 | do | 50 | do |
30 | kill $n 2> /dev/null || true | 51 | kill $n 2> /dev/null || true |
31 | done | 52 | done |
53 | stop_libeufin | ||
32 | rm -rf $CONF $WALLET_DB $TFILE $UFILE $TMP_DIR | 54 | rm -rf $CONF $WALLET_DB $TFILE $UFILE $TMP_DIR |
33 | wait | 55 | wait |
34 | } | 56 | } |
@@ -113,8 +135,8 @@ MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE` | |||
113 | EXCHANGE_URL=`taler-config -c $CONF -s EXCHANGE -o BASE_URL` | 135 | EXCHANGE_URL=`taler-config -c $CONF -s EXCHANGE -o BASE_URL` |
114 | MERCHANT_PORT=`taler-config -c $CONF -s MERCHANT -o PORT` | 136 | MERCHANT_PORT=`taler-config -c $CONF -s MERCHANT -o PORT` |
115 | MERCHANT_URL=http://localhost:${MERCHANT_PORT}/ | 137 | MERCHANT_URL=http://localhost:${MERCHANT_PORT}/ |
116 | BANK_PORT=`taler-config -c $CONF -s BANK -o HTTP_PORT` | 138 | NEXUS_PORT=8082 |
117 | BANK_URL=http://localhost:${BANK_PORT}/ | 139 | BANK_URL=http://localhost:1${NEXUS_PORT}/ |
118 | AUDITOR_URL=http://localhost:8083/ | 140 | AUDITOR_URL=http://localhost:8083/ |
119 | AUDITOR_PRIV_FILE=`taler-config -f -c $CONF -s AUDITOR -o AUDITOR_PRIV_FILE` | 141 | AUDITOR_PRIV_FILE=`taler-config -f -c $CONF -s AUDITOR -o AUDITOR_PRIV_FILE` |
120 | AUDITOR_PRIV_DIR=`dirname $AUDITOR_PRIV_FILE` | 142 | AUDITOR_PRIV_DIR=`dirname $AUDITOR_PRIV_FILE` |
@@ -149,13 +171,14 @@ echo " OK" | |||
149 | 171 | ||
150 | # Launch services | 172 | # Launch services |
151 | echo -n "Launching taler services ..." | 173 | echo -n "Launching taler services ..." |
152 | taler-bank-manage-testing $BANK_PORT $TALER_DB $EXCHANGE_URL $CONF > taler-bank.log 2> taler-bank.err & | 174 | rm -f $TALER_DB |
175 | taler-bank-manage-testing $NEXUS_PORT $TALER_DB $EXCHANGE_URL $CONF > taler-bank.log 2> taler-bank.err & | ||
153 | taler-exchange-secmod-eddsa -c $CONF 2> taler-exchange-secmod-eddsa.log & | 176 | taler-exchange-secmod-eddsa -c $CONF 2> taler-exchange-secmod-eddsa.log & |
154 | taler-exchange-secmod-rsa -c $CONF 2> taler-exchange-secmod-rsa.log & | 177 | taler-exchange-secmod-rsa -c $CONF 2> taler-exchange-secmod-rsa.log & |
155 | taler-exchange-secmod-cs -c $CONF 2> taler-exchange-secmod-cs.log & | 178 | taler-exchange-secmod-cs -c $CONF 2> taler-exchange-secmod-cs.log & |
156 | taler-exchange-httpd -c $CONF 2> taler-exchange-httpd.log & | 179 | taler-exchange-httpd -L INFO -c $CONF 2> taler-exchange-httpd.log & |
157 | taler-merchant-httpd -c $CONF -L INFO 2> taler-merchant-httpd.log & | 180 | taler-merchant-httpd -L INFO -c $CONF -L INFO 2> taler-merchant-httpd.log & |
158 | taler-exchange-wirewatch -c $CONF 2> taler-exchange-wirewatch.log & | 181 | taler-exchange-wirewatch -L INFO --longpoll-timeout=1s -c $CONF 2> taler-exchange-wirewatch.log & |
159 | taler-auditor-httpd -L INFO -c $CONF 2> taler-auditor-httpd.log & | 182 | taler-auditor-httpd -L INFO -c $CONF 2> taler-auditor-httpd.log & |
160 | 183 | ||
161 | echo " OK" | 184 | echo " OK" |
@@ -211,9 +234,9 @@ echo -n "Setting up keys ..." | |||
211 | taler-exchange-offline -c $CONF \ | 234 | taler-exchange-offline -c $CONF \ |
212 | download \ | 235 | download \ |
213 | sign \ | 236 | sign \ |
214 | enable-account payto://x-taler-bank/localhost/Exchange \ | 237 | enable-account `taler-config -c $CONF -s exchange-account-1 -o PAYTO_URI` \ |
215 | enable-auditor $AUDITOR_PUB $AUDITOR_URL "TESTKUDOS Auditor" \ | 238 | enable-auditor $AUDITOR_PUB $AUDITOR_URL "TESTKUDOS Auditor" \ |
216 | wire-fee now x-taler-bank TESTKUDOS:0.01 TESTKUDOS:0.01 \ | 239 | wire-fee now iban TESTKUDOS:0.01 TESTKUDOS:0.01 \ |
217 | upload &> taler-exchange-offline.log | 240 | upload &> taler-exchange-offline.log |
218 | 241 | ||
219 | echo -n "." | 242 | echo -n "." |
@@ -345,17 +368,17 @@ fi | |||
345 | echo -en $COLOR$BOLD"Withdrawing amount to wallet ..."$NORM$NOCOLOR | 368 | echo -en $COLOR$BOLD"Withdrawing amount to wallet ..."$NORM$NOCOLOR |
346 | 369 | ||
347 | rm $WALLET_DB | 370 | rm $WALLET_DB |
348 | taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api 'withdrawTestBalance' \ | 371 | taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api --expect-success 'withdrawTestBalance' \ |
349 | "$(jq -n ' | 372 | "$(jq -n ' |
350 | { | 373 | { |
351 | amount: "TESTKUDOS:40", | 374 | amount: "TESTKUDOS:40", |
352 | bankBaseUrl: $BANK_URL, | 375 | bankBaseUrl: $BANK_URL, |
353 | exchangeBaseUrl: $EXCHANGE_URL | 376 | exchangeBaseUrl: $EXCHANGE_URL |
354 | }' \ | 377 | }' \ |
355 | --arg BANK_URL "$BANK_URL" \ | 378 | --arg BANK_URL "${BANK_URL}demobanks/default/access-api/" \ |
356 | --arg EXCHANGE_URL "$EXCHANGE_URL" | 379 | --arg EXCHANGE_URL "$EXCHANGE_URL" |
357 | )" 2>wallet.err >wallet.log | 380 | )" 2>wallet-withdraw.err >wallet-withdraw.log |
358 | taler-wallet-cli --wallet-db=$WALLET_DB run-until-done 2>wallet.err >wallet.log | 381 | taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB run-until-done 2>wallet-withdraw-finish.err >wallet-withdraw-finish.log |
359 | 382 | ||
360 | echo " OK" | 383 | echo " OK" |
361 | 384 | ||
@@ -366,12 +389,12 @@ do | |||
366 | PAY_URI=`jq --argjson INDEX $INDEX -r -e '.payments[$INDEX]' < $TFILE` | 389 | PAY_URI=`jq --argjson INDEX $INDEX -r -e '.payments[$INDEX]' < $TFILE` |
367 | # run wallet CLI | 390 | # run wallet CLI |
368 | echo -n "$INDEX" | 391 | echo -n "$INDEX" |
369 | taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>wallet.err >wallet.log | 392 | taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB handle-uri ${PAY_URI} -y 2>wallet-pay1.err >wallet-pay1.log |
370 | echo -n "," | 393 | echo -n "," |
371 | done | 394 | done |
372 | echo " OK" | 395 | echo " OK" |
373 | echo -e $COLOR$BOLD"Running wallet run-pending..."$NORM$NOCOLOR | 396 | echo -e $COLOR$BOLD"Running wallet run-pending..."$NORM$NOCOLOR |
374 | taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet.err >wallet.log | 397 | taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet-pay-finish.err >wallet-pay-finish.log |
375 | echo -e $COLOR$BOLD"Payments done"$NORM$NOCOLOR | 398 | echo -e $COLOR$BOLD"Payments done"$NORM$NOCOLOR |
376 | 399 | ||
377 | 400 | ||
@@ -398,12 +421,12 @@ do | |||
398 | # run wallet CLI | 421 | # run wallet CLI |
399 | export PAY_URI | 422 | export PAY_URI |
400 | echo -n "$INDEX" | 423 | echo -n "$INDEX" |
401 | taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>wallet.err >wallet.log | 424 | taler-wallet-cli --wallet-db=$WALLET_DB handle-uri $PAY_URI -y 2>wallet-pay2-$INDEX.err >wallet-pay2-$INDEX.log |
402 | echo -n "," | 425 | echo -n "," |
403 | done | 426 | done |
404 | echo " OK" | 427 | echo " OK" |
405 | echo -e $COLOR$BOLD"Running wallet run-pending..."$NORM$NOCOLOR | 428 | echo -e $COLOR$BOLD"Running wallet run-pending..."$NORM$NOCOLOR |
406 | taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet.err >wallet.log | 429 | taler-wallet-cli --wallet-db=$WALLET_DB run-pending 2>wallet-pay2-finish.err >wallet-pay2-finish.log |
407 | echo -e $COLOR$BOLD"Payments done"$NORM$NOCOLOR | 430 | echo -e $COLOR$BOLD"Payments done"$NORM$NOCOLOR |
408 | 431 | ||
409 | echo -en $COLOR$BOLD"Try to upload again ..."$NORM$NOCOLOR | 432 | echo -en $COLOR$BOLD"Try to upload again ..."$NORM$NOCOLOR |
@@ -422,5 +445,5 @@ fi | |||
422 | jq -r -e .core_secret < $UFILE > /dev/null && exit_fail "'core_secret' was not cleared upon success" | 445 | jq -r -e .core_secret < $UFILE > /dev/null && exit_fail "'core_secret' was not cleared upon success" |
423 | 446 | ||
424 | echo " OK" | 447 | echo " OK" |
425 | 448 | rm -f $TALER_DB | |
426 | exit 0 | 449 | exit 0 |