diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-01-19 00:14:54 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-01-19 02:28:14 +0100 |
commit | 021a2003d59282e6508618f34e80c0ac61774624 (patch) | |
tree | dfd3984d272fb43c945be4705c3f07bb35095ba3 /src/auditor | |
parent | b683fd114ac1ce65cbe480bd8319f513e08fe893 (diff) |
adjust tests
Diffstat (limited to 'src/auditor')
-rwxr-xr-x | src/auditor/test-auditor.sh | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh index 1b3755c25..ea3f13733 100755 --- a/src/auditor/test-auditor.sh +++ b/src/auditor/test-auditor.sh @@ -644,7 +644,7 @@ function test_9() { echo "===========9: wire-origin disagreement===========" OLD_ID=`echo "SELECT id FROM app_banktransaction WHERE amount='TESTKUDOS:10' ORDER BY id LIMIT 1;" | psql $DB -Aqt` OLD_ACC=`echo "SELECT debit_account_id FROM app_banktransaction WHERE id='$OLD_ID';" | psql $DB -Aqt` -echo "UPDATE app_banktransaction SET debit_account_id=1;" | psql -Aqt $DB +echo "UPDATE app_banktransaction SET debit_account_id=1 WHERE id='$OLD_ID';" | psql -Aqt $DB run_audit @@ -662,7 +662,7 @@ fi echo PASS # Undo database modification -echo "UPDATE app_banktransaction SET debit_account_id=$OLD_ACC;" | psql -Aqt $DB +echo "UPDATE app_banktransaction SET debit_account_id=$OLD_ACC WHERE id='$OLD_ID';" | psql -Aqt $DB } @@ -759,13 +759,13 @@ echo -n "Testing hung refresh detection... " HANG=`jq -er .refresh_hanging[0].amount < test-audit.json` TOTAL_HANG=`jq -er .total_refresh_hanging < test-audit.json` -if test x$HANG != x$TOTAL_HANG +if test x$HANG = TESTKUDOS:0 then - exit_fail "Hanging amount inconsistent, got $HANG and $TOTAL_HANG" + exit_fail "Hanging amount zero" fi if test x$TOTAL_HANG = TESTKUDOS:0 then - exit_fail "Hanging amount zero" + exit_fail "Total hanging amount zero" fi echo PASS @@ -1063,18 +1063,8 @@ jq -e .amount_arithmetic_inconsistencies[0] < test-audit.json > /dev/null || exi echo PASS -echo -n "Testing risk/loss calculation... " +echo -n "Testing loss calculation... " -AMOUNT=`jq -r .emergencies_risk_by_amount < test-audit.json` -if test "x$AMOUNT" == "xTESTKUDOS:0" -then - exit_fail "Reported amount wrong: $AMOUNT" -fi -AMOUNT=`jq -r .emergencies_risk_by_count < test-audit.json` -if test "x$AMOUNT" == "xTESTKUDOS:0" -then - exit_fail "Reported amount wrong: $AMOUNT" -fi AMOUNT=`jq -r .emergencies_loss < test-audit.json` if test "x$AMOUNT" == "xTESTKUDOS:0" then |