fix test wrt lag

This commit is contained in:
Christian Grothoff 2019-09-05 10:21:33 +02:00
parent afe455c0b6
commit e0979ecf5e
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 42 additions and 11 deletions

View File

@ -19,6 +19,24 @@
% linking to them from the report. (This file _is_ source code, % linking to them from the report. (This file _is_ source code,
% the generated PDF is the service under definition of the AGPL.) % the generated PDF is the service under definition of the AGPL.)
% %
%
% NOTE WELL:
%
% When modifying this document, please verify that the output
% still looks good. For this, we have noted which testcases
% trigger the respective table being generated using comments
% of the form:
%
% "Table generation tested by testcase #XX in test-auditor.sh"
%
% Thus, whenever modifying such a table, please verify that the
% output still looks OK by manually inspecting the generated
% PDF from running
%
% $ test-auditor.sh XX
%
% in the src/auditor/ directory.
\documentclass{article} % {acmart} \documentclass{article} % {acmart}
\usepackage{url} \usepackage{url}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
@ -94,40 +112,41 @@ Note that some lag is perfectly normal, as tiny amounts that are too small to be
are deferred beyond the due date, hoping that additional transfers will push them above are deferred beyond the due date, hoping that additional transfers will push them above
the tiny threshold. Below, we report {\em non-tiny} wire transfers that are lagging behind. the tiny threshold. Below, we report {\em non-tiny} wire transfers that are lagging behind.
% Table generation tested by testcase #1 in test-auditor.sh
{% if wire.lag_details|length() == 0 %} {% if wire.lag_details|length() == 0 %}
{\bf No non-tiny wire transfers that are lagging behind detected.} {\bf No non-tiny wire transfers that are lagging behind detected.}
{% else %} {% else %}
\begin{longtable}{p{1.5cm}|r|c|rl} \begin{longtable}{l|r|r|c}
\multicolumn{4}{l}{\bf Coin} \\
{\bf Deadline} & {\bf Amount} & {\bf Row} & {\bf Claimed done} \\ {\bf Deadline} & {\bf Amount} & {\bf Row} & {\bf Claimed done} \\
\multicolumn{4}{l}{\bf Coin} \\
\multicolumn{4}{l}{\bf Target account} \\ \hline \hline \multicolumn{4}{l}{\bf Target account} \\ \hline \hline
\endfirsthead \endfirsthead
\multicolumn{4}{l}{\bf Coin} \\
{\bf Deadline} & {\bf Amount} & {\bf Row} & {\bf Claimed done} \\ {\bf Deadline} & {\bf Amount} & {\bf Row} & {\bf Claimed done} \\
\multicolumn{4}{l}{\bf Coin} \\
\multicolumn{4}{l}{\bf Target account} \\ \hline \hline \multicolumn{4}{l}{\bf Target account} \\ \hline \hline
\endhead \endhead
\hline \hline \hline \hline
\multicolumn{4}{l}{\bf Coin} \\
{\bf Deadline} & {\bf Amount} & {\bf Row} & {\bf Claimed done} \\ {\bf Deadline} & {\bf Amount} & {\bf Row} & {\bf Claimed done} \\
\multicolumn{4}{l}{\bf Coin} \\
\multicolumn{4}{l}{\bf Target account} \\ \multicolumn{4}{l}{\bf Target account} \\
\endfoot \endfoot
\hline \hline \hline \hline
\multicolumn{4}{l}{\bf Coin} \\
{\bf Deadline} & {\bf Amount} & {\bf Row} & {\bf Claimed done} \\ {\bf Deadline} & {\bf Amount} & {\bf Row} & {\bf Claimed done} \\
\multicolumn{4}{l}{\bf Coin} \\
\multicolumn{4}{l}{\bf Target account} \\ \multicolumn{4}{l}{\bf Target account} \\
\caption{Lagging non-tiny transactions.} \caption{Lagging non-tiny transactions.}
\label{table:lag} \label{table:lag}
\endlastfoot \endlastfoot
{% for item in wire.lag_details %} {% for item in wire.lag_details %}
\multicolumn{4}{l}{ {\tt \small {{ item.coin_pub }} } } \\
\nopagebreak
&
{{ item.deadline }} & {{ item.deadline }} &
{{ item.amount }} & {{ item.amount }} &
{{ item.row }} & {{ item.row }} &
{{ item.claimed_done }} \\ {{ item.claimed_done }} \\
\nopagebreak \nopagebreak
\multicolumn{4}{l}{ {\tt {{ item.account }} } } \\ \hline \multicolumn{4}{l}{ {\tt \small {{ item.coin_pub }} } } \\
\nopagebreak
\multicolumn{4}{l}{ {\tt {{ item.account.url }} } } \\ \hline
{% endfor %} {% endfor %}
\end{longtable} \end{longtable}
{% endif %} {% endif %}

View File

@ -188,7 +188,6 @@ jq -e .reserve_in_amount_inconsistencies[0] < test-wire-audit.json > /dev/null &
jq -e .missattribution_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected missattribution inconsistency detected in ordinary run" jq -e .missattribution_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected missattribution inconsistency detected in ordinary run"
jq -e .row_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected row inconsistency detected in ordinary run" jq -e .row_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected row inconsistency detected in ordinary run"
jq -e .row_minor_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected minor row inconsistency detected in ordinary run" jq -e .row_minor_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected minor row inconsistency detected in ordinary run"
jq -e .lag_details[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected lag detected in ordinary run"
jq -e .wire_format_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected wire format inconsistencies detected in ordinary run" jq -e .wire_format_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail "Unexpected wire format inconsistencies detected in ordinary run"
# FIXME: check operation balances are correct (once we have more transaction types) # FIXME: check operation balances are correct (once we have more transaction types)
@ -196,7 +195,20 @@ jq -e .wire_format_inconsistencies[0] < test-wire-audit.json > /dev/null && exit
echo PASS echo PASS
# FIXME: check wire transfer lag reported (no aggregator!) echo -n "Check for lag 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)
jq -e .lag_details[0] < test-wire-audit.json > /dev/null || exit_fail "Lag not detected in run without aggregator"
LAG=`jq -r .total_amount_lag < test-wire-audit.json`
if test $LAG = "TESTKUDOS:0"
then
exit_fail "Expected total lag to be non-zero"
fi
echo "PASS"
echo -n "Test for wire amounts... " echo -n "Test for wire amounts... "
WIRED=`jq -r .total_wire_in_delta_plus < test-wire-audit.json` WIRED=`jq -r .total_wire_in_delta_plus < test-wire-audit.json`