exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 9232a29bd72e405ec9a82474c766c74753b54154
parent c46e1ea462d01cea5e0aeaa5cae4339813f40731
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 27 May 2025 15:35:03 +0200

remove auditor test #12: no longer applicable with new refresh protocol (part of fixing #9900)

Diffstat:
Msrc/auditor/test-auditor.sh | 391+++++++++++++++++++++++++++++++++++++------------------------------------------
1 file changed, 183 insertions(+), 208 deletions(-)

diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh @@ -30,7 +30,7 @@ set -eu # Set of numbers for all the testcases. # When adding new tests, increase the last number: -ALL_TESTS=$(seq 0 32) +ALL_TESTS=$(seq 0 31) # $TESTS determines which tests we should run. # This construction is used to make it easy to @@ -1159,27 +1159,195 @@ function test_11() { } -# Test for hanging/pending refresh. function test_12() { - echo "===========12: incomplete refresh ===========" - OLD_ACC=$(echo "DELETE FROM exchange.refresh_revealed_coins;" | psql "$DB" -Aqt) - - run_audit + echo "===========12: normal run with aggregator and profit drain===========" + run_audit aggregator drain check_auditor_running + echo "Checking output" + # if an emergency was detected, that is a bug and we should fail + echo -n "Test for emergencies... " + check_no_report "emergency" + echo -n "Test for deposit confirmation detection... " + check_no_report "deposit-confirmation" + echo -n "Test for emergencies by count... " + check_no_report "emergency-by-count" + + echo -n "Testing bad sig loss balance... " + check_balance \ + "aggregation_total_bad_sig_loss" \ + "TESTKUDOS:0" \ + "Wrong total bad sig loss from aggregation, got unexpected loss" + + echo -n "Testing coin irregular loss balances... " + check_balance \ + "coin_irregular_loss" \ + "TESTKUDOS:0" \ + "Wrong total bad sig loss from coins" + + echo -n "Testing reserves bad sig loss balances... " + check_balance \ + "reserves_total_bad_sig_loss" \ + "TESTKUDOS:0" \ + "Wrong total bad sig loss from reserves" + + echo -n "Test for aggregation wire out delta plus... " + check_balance \ + "aggregation_total_wire_out_delta_plus" \ + "TESTKUDOS:0" \ + "Expected total wire out delta plus wrong" + + echo -n "Test for aggregation wire out delta minus... " + check_balance \ + "aggregation_total_wire_out_delta_minus" \ + "TESTKUDOS:0" \ + "Expected total wire out delta minus wrong" + + echo -n "Test for bad incoming delta plus... " + check_balance \ + "total_bad_amount_in_plus" \ + "TESTKUDOS:0" \ + "Expected total wire in delta plus wrong" + + echo -n "Test for total misattribution in ... " + check_balance \ + "total_misattribution_in" \ + "TESTKUDOS:0" \ + "Expected total wire in delta plus wrong" + + echo -n "Test for bad incoming delta minus... " + check_balance \ + "total_bad_amount_in_minus" \ + "TESTKUDOS:0" \ + "Expected total wire in delta minus wrong" + + echo -n "Test for bad outgoing delta plus... " + check_balance \ + "total_bad_amount_out_plus" \ + "TESTKUDOS:0" \ + "Expected total wire out delta plus wrong" + + echo -n "Test for bad outgoing delta minus... " + check_balance \ + "total_bad_amount_out_minus" \ + "TESTKUDOS:0" \ + "Expected total wire in delta minus wrong" + + echo -n "Test for misattribution amounts... " + check_balance \ + "total_misattribution_in" \ + "TESTKUDOS:0" \ + "Expected total misattribution in wrong" + + echo -n "Checking for unexpected aggregation delta plus differences... " + check_balance \ + "aggregation_total_arithmetic_delta_plus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta plus from aggregations" + + echo -n "Checking for unexpected aggregation delta minus differences... " + check_balance \ + "aggregation_total_arithmetic_delta_minus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta minus from aggregations" + + echo -n "Checking for unexpected coin delta plus differences... " + check_balance \ + "coins_total_arithmetic_delta_plus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta plus from coins" + + echo -n "Checking for unexpected coin delta minus differences... " + check_balance \ + "coins_total_arithmetic_delta_minus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta minus from coins" + + echo -n "Checking for unexpected reserves delta plus... " + check_balance \ + "reserves_total_arithmetic_delta_plus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta plus from reserves" + + echo -n "Checking for unexpected reserves delta minus... " + check_balance \ + "reserves_total_arithmetic_delta_minus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta minus from reserves" + + echo -n "Checking for unexpected wire out differences... " + check_no_report "wire-out-inconsistency" + + # Just to test the endpoint and for logging ... call_endpoint "balances" - echo -n "Checking hanging refresh detected ... " - check_report_neg \ - "refreshes-hanging" \ - "amount" "TESTKUDOS:0" - echo -n "Checking total balance updated ... " - check_not_balance \ - "total_refresh_hanging" \ + + echo -n "Testing for aggregation bad sig loss... " + check_balance \ + "aggregation_total_bad_sig_loss" \ "TESTKUDOS:0" \ - "Hanging amount zero" + "Wrong total bad sig loss from aggregation, got unexpected loss" - # cannot easily undo DELETE, hence full reload + echo -n "Testing for coin bad sig loss... " + check_balance \ + "coin_irregular_loss" \ + "TESTKUDOS:0" \ + "Wrong total bad sig loss from coins, got unexpected loss" + + echo -n "Testing for reserves bad sig loss... " + check_balance \ + "reserves_total_bad_sig_loss" \ + "TESTKUDOS:0" \ + "Wrong total bad sig loss from reserves, got unexpected loss" + + echo -n "Checking for unexpected aggregation delta plus differences... " + check_balance \ + "aggregation_total_arithmetic_delta_plus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta plus from aggregations" + + echo -n "Checking for unexpected aggregation delta minus differences... " + check_balance \ + "aggregation_total_arithmetic_delta_minus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta minus from aggregations" + + echo -n "Checking for unexpected coin delta plus differences... " + check_balance \ + "coins_total_arithmetic_delta_plus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta plus from coins" + + echo -n "Checking for unexpected coin delta minus differences... " + check_balance \ + "coins_total_arithmetic_delta_minus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta minus from coins" + + echo -n "Checking for unexpected reserves delta plus... " + check_balance \ + "reserves_total_arithmetic_delta_plus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta plus from reserves" + + echo -n "Checking for unexpected reserves delta minus... " + check_balance \ + "reserves_total_arithmetic_delta_minus" \ + "TESTKUDOS:0" \ + "Wrong arithmetic delta minus from reserves" + + echo -n "Checking amount arithmetic inconsistency" + check_no_report "amount-arithmetic-inconsistency" + + echo -n "Checking for unexpected wire out differences " + check_no_report "wire-out-inconsistency" + + echo -n "Checking total drained... " + check_balance \ + "total_drained" \ + "TESTKUDOS:0.1" \ + "Wrong total drained amount reported" + # cannot easily undo aggregator, hence full reload full_reload } @@ -1932,199 +2100,6 @@ function test_31() { } -function test_32() { - - echo "===========32: normal run with aggregator and profit drain===========" - run_audit aggregator drain - check_auditor_running - - echo "Checking output" - # if an emergency was detected, that is a bug and we should fail - echo -n "Test for emergencies... " - check_no_report "emergency" - echo -n "Test for deposit confirmation detection... " - check_no_report "deposit-confirmation" - echo -n "Test for emergencies by count... " - check_no_report "emergency-by-count" - - echo -n "Testing bad sig loss balance... " - check_balance \ - "aggregation_total_bad_sig_loss" \ - "TESTKUDOS:0" \ - "Wrong total bad sig loss from aggregation, got unexpected loss" - - echo -n "Testing coin irregular loss balances... " - check_balance \ - "coin_irregular_loss" \ - "TESTKUDOS:0" \ - "Wrong total bad sig loss from coins" - - echo -n "Testing reserves bad sig loss balances... " - check_balance \ - "reserves_total_bad_sig_loss" \ - "TESTKUDOS:0" \ - "Wrong total bad sig loss from reserves" - - echo -n "Test for aggregation wire out delta plus... " - check_balance \ - "aggregation_total_wire_out_delta_plus" \ - "TESTKUDOS:0" \ - "Expected total wire out delta plus wrong" - - echo -n "Test for aggregation wire out delta minus... " - check_balance \ - "aggregation_total_wire_out_delta_minus" \ - "TESTKUDOS:0" \ - "Expected total wire out delta minus wrong" - - echo -n "Test for bad incoming delta plus... " - check_balance \ - "total_bad_amount_in_plus" \ - "TESTKUDOS:0" \ - "Expected total wire in delta plus wrong" - - echo -n "Test for total misattribution in ... " - check_balance \ - "total_misattribution_in" \ - "TESTKUDOS:0" \ - "Expected total wire in delta plus wrong" - - echo -n "Test for bad incoming delta minus... " - check_balance \ - "total_bad_amount_in_minus" \ - "TESTKUDOS:0" \ - "Expected total wire in delta minus wrong" - - echo -n "Test for bad outgoing delta plus... " - check_balance \ - "total_bad_amount_out_plus" \ - "TESTKUDOS:0" \ - "Expected total wire out delta plus wrong" - - echo -n "Test for bad outgoing delta minus... " - check_balance \ - "total_bad_amount_out_minus" \ - "TESTKUDOS:0" \ - "Expected total wire in delta minus wrong" - - echo -n "Test for misattribution amounts... " - check_balance \ - "total_misattribution_in" \ - "TESTKUDOS:0" \ - "Expected total misattribution in wrong" - - echo -n "Checking for unexpected aggregation delta plus differences... " - check_balance \ - "aggregation_total_arithmetic_delta_plus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta plus from aggregations" - - echo -n "Checking for unexpected aggregation delta minus differences... " - check_balance \ - "aggregation_total_arithmetic_delta_minus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta minus from aggregations" - - echo -n "Checking for unexpected coin delta plus differences... " - check_balance \ - "coins_total_arithmetic_delta_plus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta plus from coins" - - echo -n "Checking for unexpected coin delta minus differences... " - check_balance \ - "coins_total_arithmetic_delta_minus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta minus from coins" - - echo -n "Checking for unexpected reserves delta plus... " - check_balance \ - "reserves_total_arithmetic_delta_plus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta plus from reserves" - - echo -n "Checking for unexpected reserves delta minus... " - check_balance \ - "reserves_total_arithmetic_delta_minus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta minus from reserves" - - echo -n "Checking for unexpected wire out differences... " - check_no_report "wire-out-inconsistency" - - # Just to test the endpoint and for logging ... - call_endpoint "balances" - - echo -n "Testing for aggregation bad sig loss... " - check_balance \ - "aggregation_total_bad_sig_loss" \ - "TESTKUDOS:0" \ - "Wrong total bad sig loss from aggregation, got unexpected loss" - - echo -n "Testing for coin bad sig loss... " - check_balance \ - "coin_irregular_loss" \ - "TESTKUDOS:0" \ - "Wrong total bad sig loss from coins, got unexpected loss" - - echo -n "Testing for reserves bad sig loss... " - check_balance \ - "reserves_total_bad_sig_loss" \ - "TESTKUDOS:0" \ - "Wrong total bad sig loss from reserves, got unexpected loss" - - echo -n "Checking for unexpected aggregation delta plus differences... " - check_balance \ - "aggregation_total_arithmetic_delta_plus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta plus from aggregations" - - echo -n "Checking for unexpected aggregation delta minus differences... " - check_balance \ - "aggregation_total_arithmetic_delta_minus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta minus from aggregations" - - echo -n "Checking for unexpected coin delta plus differences... " - check_balance \ - "coins_total_arithmetic_delta_plus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta plus from coins" - - echo -n "Checking for unexpected coin delta minus differences... " - check_balance \ - "coins_total_arithmetic_delta_minus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta minus from coins" - - echo -n "Checking for unexpected reserves delta plus... " - check_balance \ - "reserves_total_arithmetic_delta_plus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta plus from reserves" - - echo -n "Checking for unexpected reserves delta minus... " - check_balance \ - "reserves_total_arithmetic_delta_minus" \ - "TESTKUDOS:0" \ - "Wrong arithmetic delta minus from reserves" - - echo -n "Checking amount arithmetic inconsistency" - check_no_report "amount-arithmetic-inconsistency" - - echo -n "Checking for unexpected wire out differences " - check_no_report "wire-out-inconsistency" - - echo -n "Checking total drained... " - check_balance \ - "total_drained" \ - "TESTKUDOS:0.1" \ - "Wrong total drained amount reported" - # cannot easily undo aggregator, hence full reload - full_reload -} - - # *************** Main test loop starts here **************