aboutsummaryrefslogtreecommitdiff
path: root/integrationtests/test-retries.sh
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-05-08 15:02:07 -0300
committerTorsten Grote <t@grobox.de>2020-05-08 15:02:07 -0300
commit7e947ca2cdd8e66ea49822acbad81e7d35289c0a (patch)
treedb9240c5c67d69d89785110c4f2bf346a87d2622 /integrationtests/test-retries.sh
parent1cf48054c47d9562876b5f021dc398b050b959fd (diff)
Add functions for getting and comparing balances to integration tests
Diffstat (limited to 'integrationtests/test-retries.sh')
-rwxr-xr-xintegrationtests/test-retries.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/integrationtests/test-retries.sh b/integrationtests/test-retries.sh
index 01bfa5774..3d953eab0 100755
--- a/integrationtests/test-retries.sh
+++ b/integrationtests/test-retries.sh
@@ -8,8 +8,8 @@ normal_start_and_wait "retries"
echo "Withdraw TESTKUDOS"
taler-wallet-cli --wallet-db="$WALLET_DB" --no-throttle testing withdraw -e "$EXCHANGE_URL" -b "$BANK_URL" -a "TESTKUDOS:10" 2>>"$LOG" >>"$LOG"
-echo -n "Balance after withdrawal: "
-taler-wallet-cli --wallet-db="$WALLET_DB" balance 2>>"$LOG"
+BALANCE_1=$(get_balance)
+echo "Balance after withdrawal: $BALANCE_1"
echo "Getting pay taler:// Uri"
PAY_URI=$(taler-wallet-cli testing gen-pay-uri -m "$MERCHANT_URL" -k sandbox -a "TESTKUDOS:1" -s "foo" | grep -E -o 'taler://.*')
echo "Trying to pay with exchange down, will fail"
@@ -23,8 +23,9 @@ echo -n "Wait for exchange to start"
wait_for_service "$EXCHANGE_URL"
echo "Retrying operations with exchange up"
taler-wallet-cli --wallet-db="$WALLET_DB" run-until-done 2>>"$LOG" >>"$LOG"
-echo -n "Balance after re-tried payment: "
-taler-wallet-cli --wallet-db="$WALLET_DB" balance 2>>"$LOG"
+BALANCE_2=$(get_balance)
+echo "Balance after re-tried payment: $BALANCE_2"
+assert_less_than "$BALANCE_2" "$BALANCE_1"
echo "Getting pay taler:// Uri"
PAY_URI=$(taler-wallet-cli testing gen-pay-uri -m "$MERCHANT_URL" -k sandbox -a "TESTKUDOS:1" -s "foo" | grep -E -o 'taler://.*')
@@ -39,7 +40,8 @@ echo -n "Wait for merchant to start"
wait_for_service "$MERCHANT_URL"
echo "Retrying payment with merchant up"
taler-wallet-cli --wallet-db="$WALLET_DB" --no-throttle handle-uri --yes "$PAY_URI" 2>>"$LOG" >>"$LOG"
-echo -n "Balance after re-tried payment: "
-taler-wallet-cli --wallet-db="$WALLET_DB" balance 2>>"$LOG"
+BALANCE_3=$(get_balance)
+echo "Balance after re-tried payment: $BALANCE_3"
+assert_less_than "$BALANCE_3" "$BALANCE_2"
exit_success