gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: Add integration test for with


From: gnunet
Subject: [taler-wallet-core] branch master updated: Add integration test for withdrawals
Date: Mon, 18 May 2020 18:46:11 +0200

This is an automated email from the git hooks/post-receive script.

torsten-grote pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new a3354306 Add integration test for withdrawals
a3354306 is described below

commit a3354306c629ab3ab5f45617f31b90976416105a
Author: Torsten Grote <address@hidden>
AuthorDate: Mon May 18 13:45:21 2020 -0300

    Add integration test for withdrawals
---
 integrationtests/common.sh               |  7 +++++++
 integrationtests/test-coin-expiration.sh | 14 ++++++++++++++
 integrationtests/test-withdrawal.sh      | 19 +++++++++++++++++++
 3 files changed, 40 insertions(+)

diff --git a/integrationtests/common.sh b/integrationtests/common.sh
index 86158d15..d228d1ea 100644
--- a/integrationtests/common.sh
+++ b/integrationtests/common.sh
@@ -114,6 +114,9 @@ function wait_for_services() {
         OK=1
         break
     done
+    if [ 1 != $OK ]; then
+        exit_skip "Failed to launch bank"
+    fi
     # Wait for all other services to be available
     for _ in $(seq 1 50); do
         echo -n "."
@@ -170,6 +173,10 @@ function assert_greater_than() {
     fi
 }
 
+function assert_equal() {
+    [[ "$1" == "$2" ]] || exit_error "$1 is not equal to $2"
+}
+
 function shutdown_services() {
     echo "Shutting down services"
     jobs -p | xargs --no-run-if-empty kill || true
diff --git a/integrationtests/test-coin-expiration.sh 
b/integrationtests/test-coin-expiration.sh
new file mode 100755
index 00000000..83f7477b
--- /dev/null
+++ b/integrationtests/test-coin-expiration.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# Script to check that the wallet automatically refreshes coins for they expire
+
+source "common.sh"
+normal_start_and_wait "coin-expiration"
+
+echo "Withdraw TESTKUDOS"
+taler-wallet-cli --wallet-db="$WALLET_DB" --no-throttle testing withdraw -e 
"$EXCHANGE_URL" -b "$BANK_URL" -a "TESTKUDOS:10" >>"$LOG" 2>>"$LOG"
+echo "Balance after withdrawal: $(get_balance)"
+
+# TODO time-travel to check that wallet actually refreshed coin before 
expiration
+taler-wallet-cli --wallet-db="$WALLET_DB" advanced dump-coins
+
+exit_success
diff --git a/integrationtests/test-withdrawal.sh 
b/integrationtests/test-withdrawal.sh
new file mode 100755
index 00000000..1450f625
--- /dev/null
+++ b/integrationtests/test-withdrawal.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Script to check that the wallet does a withdrawal correctly
+
+source "common.sh"
+normal_start_and_wait "withdrawal"
+
+echo "Withdraw 5 TESTKUDOS"
+taler-wallet-cli --wallet-db="$WALLET_DB" --no-throttle testing withdraw -e 
"$EXCHANGE_URL" -b "$BANK_URL" -a "TESTKUDOS:5" >>"$LOG" 2>>"$LOG"
+BALANCE_1=$(get_balance)
+assert_equal "$BALANCE_1" "TESTKUDOS:4.84"
+echo "Balance after withdrawal: $BALANCE_1"
+
+echo "Withdraw 10 TESTKUDOS"
+taler-wallet-cli --wallet-db="$WALLET_DB" --no-throttle testing withdraw -e 
"$EXCHANGE_URL" -b "$BANK_URL" -a "TESTKUDOS:10" >>"$LOG" 2>>"$LOG"
+BALANCE_2=$(get_balance)
+assert_equal "$BALANCE_2" "TESTKUDOS:14.66"
+echo "Balance after withdrawal: $BALANCE_2"
+
+exit_success

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]