gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 02/02: fix test issues with new DB schema


From: gnunet
Subject: [taler-exchange] 02/02: fix test issues with new DB schema
Date: Thu, 07 Jan 2021 22:24:24 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

commit 421e802fd35888f3432720841bd25527ede29ebc
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jan 7 22:24:19 2021 +0100

    fix test issues with new DB schema
---
 contrib/auditor-report.tex.j2        |  6 +++++-
 src/auditor/test-auditor.sh          | 18 +++++++++---------
 src/auditor/test-revocation.sh       |  8 ++++----
 src/exchange/taler-exchange-closer.c |  2 +-
 4 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/contrib/auditor-report.tex.j2 b/contrib/auditor-report.tex.j2
index c2d406eb..38f44d4e 100644
--- a/contrib/auditor-report.tex.j2
+++ b/contrib/auditor-report.tex.j2
@@ -227,7 +227,11 @@ the tiny threshold. Below, we report {\em non-tiny} wire 
transfers that are lagg
   {{ item.deadline }} &
   {{ item.amount }} &
   {{ item.row }} &
-  {{ item.claimed_done }} \\
+{% if 'claimed_done' in item %}
+  {{ item.claimed_done }}
+{% else %}
+  N/A
+{% endif %}  \\
 \nopagebreak
   \multicolumn{4}{l}{ {\tt \small {{ item.coin_pub }} } } \\
 \nopagebreak
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index ae0c3cba..08e13f98 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -1177,14 +1177,14 @@ then
 
     OLD_TIME=`echo "SELECT execution_date FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
     OLD_VAL=`echo "SELECT credit_val FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
-    RES_PUB=`echo "SELECT reserve_pub FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
-    OLD_EXP=`echo "SELECT expiration_date FROM reserves WHERE 
reserve_pub='${RES_PUB}';" | psql $DB -Aqt`
+    RES_UUID=`echo "SELECT reserve_uuid FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
+    OLD_EXP=`echo "SELECT expiration_date FROM reserves WHERE 
reserve_uuid='${RES_UUID}';" | psql $DB -Aqt`
     VAL_DELTA=1
     NEW_TIME=`expr $OLD_TIME - 3024000000000 || true`  # 5 weeks
     NEW_EXP=`expr $OLD_EXP - 3024000000000 || true`  # 5 weeks
     NEW_CREDIT=`expr $OLD_VAL + $VAL_DELTA || true`
     echo "UPDATE reserves_in SET 
execution_date='${NEW_TIME}',credit_val=${NEW_CREDIT} WHERE 
reserve_in_serial_id=1;" | psql -Aqt $DB
-    echo "UPDATE reserves SET 
current_balance_val=${VAL_DELTA}+current_balance_val,expiration_date='${NEW_EXP}'
 WHERE reserve_pub='${RES_PUB}';" | psql -Aqt $DB
+    echo "UPDATE reserves SET 
current_balance_val=${VAL_DELTA}+current_balance_val,expiration_date='${NEW_EXP}'
 WHERE reserve_uuid='${RES_UUID}';" | psql -Aqt $DB
 
     # Need to run with the aggregator so the reserve closure happens
     run_audit aggregator
@@ -1215,11 +1215,11 @@ echo "===========20: reserve closure missing 
================="
 
 OLD_TIME=`echo "SELECT execution_date FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
 OLD_VAL=`echo "SELECT credit_val FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
-RES_PUB=`echo "SELECT reserve_pub FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
+RES_UUID=`echo "SELECT reserve_uuid FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
 NEW_TIME=`expr $OLD_TIME - 3024000000000 || true`  # 5 weeks
 NEW_CREDIT=`expr $OLD_VAL + 100 || true`
 echo "UPDATE reserves_in SET 
execution_date='${NEW_TIME}',credit_val=${NEW_CREDIT} WHERE 
reserve_in_serial_id=1;" | psql -Aqt $DB
-echo "UPDATE reserves SET current_balance_val=100+current_balance_val WHERE 
reserve_pub='${RES_PUB}';" | psql -Aqt $DB
+echo "UPDATE reserves SET current_balance_val=100+current_balance_val WHERE 
reserve_uuid='${RES_UUID}';" | psql -Aqt $DB
 
 # This time, run without the aggregator so the reserve closure is skipped!
 run_audit
@@ -1236,7 +1236,7 @@ fi
 
 # Undo
 echo "UPDATE reserves_in SET 
execution_date='${OLD_TIME}',credit_val=${OLD_VAL} WHERE 
reserve_in_serial_id=1;" | psql -Aqt $DB
-echo "UPDATE reserves SET current_balance_val=current_balance_val-100 WHERE 
reserve_pub='${RES_PUB}';" | psql -Aqt $DB
+echo "UPDATE reserves SET current_balance_val=current_balance_val-100 WHERE 
reserve_uuid='${RES_UUID}';" | psql -Aqt $DB
 
 }
 
@@ -1255,14 +1255,14 @@ then
 
     OLD_TIME=`echo "SELECT execution_date FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
     OLD_VAL=`echo "SELECT credit_val FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
-    RES_PUB=`echo "SELECT reserve_pub FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
-    OLD_EXP=`echo "SELECT expiration_date FROM reserves WHERE 
reserve_pub='${RES_PUB}';" | psql $DB -Aqt`
+    RES_UUID=`echo "SELECT reserve_uuid FROM reserves_in WHERE 
reserve_in_serial_id=1;" | psql $DB -Aqt`
+    OLD_EXP=`echo "SELECT expiration_date FROM reserves WHERE 
reserve_uuid='${RES_UUID}';" | psql $DB -Aqt`
     VAL_DELTA=1
     NEW_TIME=`expr $OLD_TIME - 3024000000000 || true`  # 5 weeks
     NEW_EXP=`expr $OLD_EXP - 3024000000000 || true`  # 5 weeks
     NEW_CREDIT=`expr $OLD_VAL + $VAL_DELTA || true`
     echo "UPDATE reserves_in SET 
execution_date='${NEW_TIME}',credit_val=${NEW_CREDIT} WHERE 
reserve_in_serial_id=1;" | psql -Aqt $DB
-    echo "UPDATE reserves SET 
current_balance_val=${VAL_DELTA}+current_balance_val,expiration_date='${NEW_EXP}'
 WHERE reserve_pub='${RES_PUB}';" | psql -Aqt $DB
+    echo "UPDATE reserves SET 
current_balance_val=${VAL_DELTA}+current_balance_val,expiration_date='${NEW_EXP}'
 WHERE reserve_uuid='${RES_UUID}';" | psql -Aqt $DB
 
     # Need to first run the aggregator so the transfer is marked as done exists
     pre_audit aggregator
diff --git a/src/auditor/test-revocation.sh b/src/auditor/test-revocation.sh
index d5874a8e..ad62b518 100755
--- a/src/auditor/test-revocation.sh
+++ b/src/auditor/test-revocation.sh
@@ -105,13 +105,13 @@ function audit_only () {
     echo -n "."
     $VALGRIND taler-helper-auditor-deposits -L DEBUG -c $CONF -m $MASTER_PUB > 
test-audit-deposits-inc.json 2> test-audit-deposits-inc.log || exit_fail 
"incremental deposits audit failed"
     echo -n "."
-    $VALGRIND taler-helper-auditor-reserves -L DEBUG -c $CONF -m $MASTER_PUB > 
test-audit-reserves.json 2> test-audit-reserves.log || exit_fail "reserves 
audit failed"
+    $VALGRIND taler-helper-auditor-reserves -i -L DEBUG -c $CONF -m 
$MASTER_PUB > test-audit-reserves.json 2> test-audit-reserves.log || exit_fail 
"reserves audit failed"
     echo -n "."
-    $VALGRIND taler-helper-auditor-reserves -L DEBUG -c $CONF -m $MASTER_PUB > 
test-audit-reserves-inc.json 2> test-audit-reserves-inc.log || exit_fail 
"incremental reserves audit failed"
+    $VALGRIND taler-helper-auditor-reserves -i -L DEBUG -c $CONF -m 
$MASTER_PUB > test-audit-reserves-inc.json 2> test-audit-reserves-inc.log || 
exit_fail "incremental reserves audit failed"
     echo -n "."
-    $VALGRIND taler-helper-auditor-wire -L DEBUG -c $CONF -m $MASTER_PUB > 
test-audit-wire.json 2> test-wire-audit.log || exit_fail "wire audit failed"
+    $VALGRIND taler-helper-auditor-wire -i -L DEBUG -c $CONF -m $MASTER_PUB > 
test-audit-wire.json 2> test-wire-audit.log || exit_fail "wire audit failed"
     echo -n "."
-    $VALGRIND taler-helper-auditor-wire -L DEBUG -c $CONF -m $MASTER_PUB > 
test-audit-wire-inc.json 2> test-wire-audit-inc.log || exit_fail "wire audit 
failed"
+    $VALGRIND taler-helper-auditor-wire -i -L DEBUG -c $CONF -m $MASTER_PUB > 
test-audit-wire-inc.json 2> test-wire-audit-inc.log || exit_fail "wire audit 
failed"
     echo -n "."
 
     echo " DONE"
diff --git a/src/exchange/taler-exchange-closer.c 
b/src/exchange/taler-exchange-closer.c
index c32e933b..d797c545 100644
--- a/src/exchange/taler-exchange-closer.c
+++ b/src/exchange/taler-exchange-closer.c
@@ -475,7 +475,7 @@ run_reserve_closures (void *cls)
     return;
   case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "No more idle reserves, going back to aggregation\n");
+                "No more idle reserves to close, going to sleep.\n");
     db_plugin->rollback (db_plugin->cls,
                          session);
     GNUNET_assert (NULL == task);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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