gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: adding test for #6054 (duplicate


From: gnunet
Subject: [taler-exchange] branch master updated: adding test for #6054 (duplicate WTID)
Date: Sat, 08 Feb 2020 17:41:29 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 964cd7a4 adding test for #6054 (duplicate WTID)
964cd7a4 is described below

commit 964cd7a459763a3ddc21f2b32f81a1dad5b7a4ce
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Feb 8 17:41:27 2020 +0100

    adding test for #6054 (duplicate WTID)
---
 src/auditor/test-auditor.sh | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index 00ed0523..5f7d0c8c 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -1473,6 +1473,49 @@ echo "UPDATE deposits SET wire='$OLD_WIRE' WHERE 
deposit_serial_id=${SERIAL}" |
 
 }
 
+# Test for duplicate wire transfer subject
+function test_27() {
+echo "===========27: duplicate WTID detection ================="
+
+# Check wire transfer lag reported (no aggregator!)
+# NOTE: This test is EXPECTED to fail for ~1h after
+# re-generating the test database as we do not
+# report lag of less than 1h (see GRACE_PERIOD in
+# taler-wire-auditor.c)
+if [ $DATABASE_AGE -gt 3600 ]
+then
+
+    pre_audit aggregator
+
+    # Obtain data to duplicate.
+    ID=`echo "SELECT id FROM app_banktransaction WHERE debit_account_id=2 
LIMIT 1" | psql $DB -Aqt`
+    WTID=`echo "SELECT subject FROM app_banktransaction WHERE 
debit_account_id=2 LIMIT 1" | psql $DB -Aqt`
+    echo "INSERT INTO app_banktransaction 
(amount,subject,date,credit_account_id,debit_account_id,cancelled) VALUES 
('TESTKUDOS:1','$WTID',NOW(),12,2,'f')" | psql -Aqt $DB
+
+    audit_only
+    post_audit
+
+    echo -n "Testing inconsistency detection... "
+
+    AMOUNT=`jq -r .wire_format_inconsistencies[0].amount < 
test-wire-audit.json`
+    if test "${AMOUNT}" != "TESTKUDOS:1"
+    then
+        exit_fail "Amount wrong, got ${AMOUNT}"
+    fi
+
+    AMOUNT=`jq -r .total_wire_format_amount < test-wire-audit.json`
+    if test "${AMOUNT}" != "TESTKUDOS:1"
+    then
+        exit_fail "Wrong total wire format amount, got $AMOUNT"
+    fi
+
+    # cannot easily undo aggregator, hence full reload
+    full_reload
+else
+    echo "Test skipped (database too new)"
+fi
+
+}
 
 
 # **************************************************

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



reply via email to

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