gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated (956f6dca -> 55dd10e9)


From: gnunet
Subject: [taler-exchange] branch master updated (956f6dca -> 55dd10e9)
Date: Tue, 29 Oct 2019 11:36:27 +0100

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

grothoff pushed a change to branch master
in repository exchange.

    from 956f6dca disable failing test
     new a1b01f11 better auditor logging
     new 5ddbdfe9 do NOT drop deposit confirmations on taler-auditor restart 
(-r)
     new 85a9ee6a fix report generation
     new 55dd10e9 activate now passing test #25"

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 contrib/auditor-report.tex.j2             |  9 ++++----
 src/auditor/taler-auditor.c               | 13 +++++++++--
 src/auditor/test-auditor.sh               | 36 +++++++++++++------------------
 src/auditordb/plugin_auditordb_postgres.c |  6 +++---
 src/include/taler_auditordb_plugin.h      |  2 +-
 5 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/contrib/auditor-report.tex.j2 b/contrib/auditor-report.tex.j2
index 2830a6bc..e26d562e 100644
--- a/contrib/auditor-report.tex.j2
+++ b/contrib/auditor-report.tex.j2
@@ -218,7 +218,7 @@ and should be answered by revoking the exchange's online 
siging keys.
 % FIXME: reference PhD thesis?
 
 The total amount the exchange currently lags behind is
-{\bf {{ data.missing_deposit_confirmation_total }} } or
+{\bf {{ data.missing_deposit_confirmation_total }} } from a total number of
 {\bf {{ data.missing_deposit_confirmation_count }} } deposit confirmations.
 
 Note that some lag is perfectly normal.
@@ -229,7 +229,7 @@ Below, we report {\em all} deposit confirmations that are 
lagging behind.
 {% if data.deposit_confirmation_inconsistencies|length() == 0 %}
   {\bf No deposit confirmations that are lagging behind detected.}
 {% else %}
-  \begin{longtable}{p{1.5cm}|r|c|r}
+  \begin{longtable}{r|r|r}
   {\bf Timestamp} & {\bf Amount} & {\bf Row} \\
   \multicolumn{3}{l}{\bf Target account} \\ \hline \hline
 \endfirsthead
@@ -247,12 +247,11 @@ Below, we report {\em all} deposit confirmations that are 
lagging behind.
     \label{table:missing_dc}
 \endlastfoot
 {% for item in data.deposit_confirmation_inconsistencies %}
-  &
   {{ item.timestamp }} &
   {{ item.amount }} &
-  {{ item.row }} \\
+  {{ item.rowid }} \\
 \nopagebreak
-  \multicolumn{3}{l}{ {\tt {{ item.account }} } } \\ \hline
+  \multicolumn{3}{l}{ {\tt \truncate{0.95\textwidth}{ {{ item.account }} } } } 
\\ \hline
 {% endfor %}
   \end{longtable}
 {% endif %}
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index 838b79d3..dbbc6c23 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -4876,7 +4876,12 @@ test_dc (void *cls,
                           &dep,
                           GNUNET_NO /* do not check refund deadline */);
   if (qs > 0)
-    return; /* found, all good */
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Found deposit %s in exchange database\n",
+                GNUNET_h2s (&dc->h_contract_terms));
+    return;   /* found, all good */
+  }
   if (qs < 0)
   {
     GNUNET_break (0); /* DB error, complain */
@@ -4920,7 +4925,7 @@ analyze_deposit_confirmations (void *cls)
   enum GNUNET_DB_QueryStatus qsx;
   enum GNUNET_DB_QueryStatus qsp;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Analyzing deposit confirmations\n");
   ppdc.last_deposit_confirmation_serial_id = 0;
   qsp = adb->get_auditor_progress_deposit_confirmation (adb->cls,
@@ -4963,6 +4968,10 @@ analyze_deposit_confirmations (void *cls)
     GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qsx);
     return qsx;
   }
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Analyzed %d deposit confirmations (above serial ID %llu)\n",
+              (int) qsx,
+              (unsigned long long) ppdc.last_deposit_confirmation_serial_id);
   if (0 > dcc.qs)
   {
     GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == dcc.qs);
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index c7373fd0..7100c5a4 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -9,7 +9,7 @@ set -eu
 
 # Set of numbers for all the testcases.
 # When adding new tests, increase the last number:
-ALL_TESTS=`seq 0 24`
+ALL_TESTS=`seq 0 25`
 
 # $TESTS determines which tests we should run.
 # This construction is used to make it easy to
@@ -68,15 +68,15 @@ function pre_audit () {
 function audit_only () {
     # Run the auditor!
     echo -n "Running audit(s) ..."
-    taler-auditor -L INFO -r -c $CONF -m $MASTER_PUB > test-audit.json 2> 
test-audit.log || exit_fail "auditor failed"
+    taler-auditor -L DEBUG -r -c $CONF -m $MASTER_PUB > test-audit.json 2> 
test-audit.log || exit_fail "auditor failed"
     echo -n "."
     # Also do incremental run
-    taler-auditor -L INFO -c $CONF -m $MASTER_PUB > test-audit-inc.json 2> 
test-audit-inc.log || exit_fail "auditor failed"
+    taler-auditor -L DEBUG -c $CONF -m $MASTER_PUB > test-audit-inc.json 2> 
test-audit-inc.log || exit_fail "auditor failed"
     echo -n "."
-    taler-wire-auditor -L INFO -r -c $CONF -m $MASTER_PUB > 
test-wire-audit.json 2> test-wire-audit.log || exit_fail "wire auditor failed"
+    taler-wire-auditor -L DEBUG -r -c $CONF -m $MASTER_PUB > 
test-wire-audit.json 2> test-wire-audit.log || exit_fail "wire auditor failed"
     # Also do incremental run
     echo -n "."
-    taler-wire-auditor -L INFO -c $CONF -m $MASTER_PUB > 
test-wire-audit-inc.json 2> test-wire-audit-inc.log || exit_fail "wire auditor 
failed"
+    taler-wire-auditor -L DEBUG -c $CONF -m $MASTER_PUB > 
test-wire-audit-inc.json 2> test-wire-audit-inc.log || exit_fail "wire auditor 
failed"
     echo " DONE"
 }
 
@@ -1422,22 +1422,16 @@ echo -n "Testing inconsistency detection... "
 
 jq -e .deposit_confirmation_inconsistencies[0] < test-audit.json > /dev/null 
|| exit_fail "Deposit confirmation inconsistency NOT detected"
 
-#OP=`jq -er .bad_sig_losses[0].operation < test-audit.json`
-#if test x$OP != xmelt
-#then
-#    exit_fail "Operation wrong, got $OP"
-#fi
-
-#LOSS=`jq -er .bad_sig_losses[0].loss < test-audit.json`
-#TOTAL_LOSS=`jq -er .total_bad_sig_loss < test-audit.json`
-#if test x$LOSS != x$TOTAL_LOSS
-#then
-#    exit_fail "Loss inconsistent, got $LOSS and $TOTAL_LOSS"
-#fi
-#if test x$TOTAL_LOSS = TESTKUDOS:0
-#then
-#    exit_fail "Loss zero"
-#fi
+AMOUNT=`jq -er .missing_deposit_confirmation_total < test-audit.json`
+if test x$AMOUNT = xTESTKUDOS:0
+then
+    exit_fail "Expected non-zero total missing deposit confirmation amount"
+fi
+COUNT=`jq -er .missing_deposit_confirmation_count < test-audit.json`
+if test x$AMOUNT = x0
+then
+    exit_fail "Expected non-zero total missing deposit confirmation count"
+fi
 
 echo PASS
 
diff --git a/src/auditordb/plugin_auditordb_postgres.c 
b/src/auditordb/plugin_auditordb_postgres.c
index b4bb5007..e5445f2a 100644
--- a/src/auditordb/plugin_auditordb_postgres.c
+++ b/src/auditordb/plugin_auditordb_postgres.c
@@ -95,7 +95,7 @@ struct PostgresClosure
  * Drop all Taler tables.  This should only be used by testcases.
  *
  * @param cls the `struct PostgresClosure` with the plugin-specific state
- * @param drop_exchangelist should we also drop the exchange table?
+ * @param drop_exchangelist should we also drop the exchange and 
deposit_confirmations table?
  * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
  */
 static int
@@ -123,13 +123,13 @@ postgres_drop_tables (void *cls,
     GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS wire_auditor_progress;"),
     GNUNET_PQ_make_execute (
       "DROP TABLE IF EXISTS wire_auditor_account_progress;"),
-    GNUNET_PQ_make_execute (
-      "DROP TABLE IF EXISTS deposit_confirmations CASCADE;"),
     GNUNET_PQ_make_execute (
       "DROP TABLE IF EXISTS auditor_historic_reserve_summary CASCADE;"),
     GNUNET_PQ_EXECUTE_STATEMENT_END
   };
   struct GNUNET_PQ_ExecuteStatement esx[] = {
+    GNUNET_PQ_make_execute (
+      "DROP TABLE IF EXISTS deposit_confirmations CASCADE;"),
     GNUNET_PQ_make_execute ("DROP TABLE IF EXISTS auditor_exchanges CASCADE;"),
     GNUNET_PQ_EXECUTE_STATEMENT_END
   };
diff --git a/src/include/taler_auditordb_plugin.h 
b/src/include/taler_auditordb_plugin.h
index 1ec03e65..6241d819 100644
--- a/src/include/taler_auditordb_plugin.h
+++ b/src/include/taler_auditordb_plugin.h
@@ -428,7 +428,7 @@ struct TALER_AUDITORDB_Plugin
    * Drop the Taler tables.  This should only be used in testcases.
    *
    * @param cls the @e cls of this struct with the plugin-specific state
-   * @param drop_exchangelist should we also drop the list of audited exchanges
+   * @param drop_exchangelist should we also drop the exchange and 
deposit_confirmations table?
    * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure
    */
   int

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



reply via email to

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