towards testing #4960

This commit is contained in:
Christian Grothoff 2022-08-15 00:01:45 +02:00
parent a8ec6818bb
commit 39640c3339
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
11 changed files with 1131 additions and 1096 deletions

View File

@ -212,6 +212,7 @@ EXTRA_DIST = \
auditor-basedb.sql \
auditor-basedb-libeufin.sql \
auditor-basedb.mpub \
auditor-basedb.mpriv \
revoke-basedb.age \
revoke-basedb.conf \
revoke-basedb.sql \

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
1660496859
1660512360

View File

@ -3,7 +3,7 @@ KEYFILE = ${TALER_DATA_HOME}/merchant/default.priv
NAME = Merchant Inc.
[exchange-account-1]
PAYTO_URI = payto://iban/SANDBOXX/DE514871?receiver-name=Exchange+Company
PAYTO_URI = payto://iban/SANDBOXX/DE220640?receiver-name=Exchange+Company
enable_debit = yes
enable_credit = yes
@ -19,7 +19,7 @@ HONOR_default = YES
ACTIVE_default = YES
[merchant-exchange-default]
MASTER_KEY = 8PZ0QC89YREAFB9TAM2SK8NRA9G2RMXA4Q814N0RX3Y8DQ64H0G0
MASTER_KEY = QWMVWN7QWFVYXBA5KW2T37DEHQA4FGH67FTPEH7766XKK5ZK4B0G
EXCHANGE_BASE_URL = http://localhost:8081/
CURRENCY = TESTKUDOS
@ -155,7 +155,7 @@ UNIXPATH = ${TALER_RUNTIME_DIR}/merchant.http
CONFIG = postgres:///auditor-basedb
[exchange]
MASTER_PUBLIC_KEY = 8PZ0QC89YREAFB9TAM2SK8NRA9G2RMXA4Q814N0RX3Y8DQ64H0G0
MASTER_PUBLIC_KEY = QWMVWN7QWFVYXBA5KW2T37DEHQA4FGH67FTPEH7766XKK5ZK4B0G
SIGNKEY_DURATION = 4 weeks
LOOKAHEAD_SIGN = 32 weeks 1 day
SIGNKEY_LEGAL_DURATION = 4 weeks
@ -177,7 +177,7 @@ CONFIG = postgres:///auditor-basedb
[auditor]
BASE_URL = http://localhost:8083/
TINY_AMOUNT = TESTKUDOS:0.01
PUBLIC_KEY = 41SE6QAX583WXH9BD77YMXJ46DDZRK4Z3FA2H2Y5CH8XD2H547AG
PUBLIC_KEY = NTPD6VPQ0PB2409XQ5HM8TYC5PW66YZ10Q16G8C74PWY56JJ99T0
[PATHS]
TALER_CACHE_HOME = $TALER_HOME/.cache/taler/

Binary file not shown.

View File

@ -1 +1 @@
8PZ0QC89YREAFB9TAM2SK8NRA9G2RMXA4Q814N0RX3Y8DQ64H0G0
QWMVWN7QWFVYXBA5KW2T37DEHQA4FGH67FTPEH7766XKK5ZK4B0G

File diff suppressed because it is too large Load Diff

View File

@ -96,6 +96,7 @@ MASTER_PRIV_FILE=`taler-config -f -c $CONF_ONCE -s exchange-offline -o MASTER_PR
MASTER_PRIV_DIR=`dirname $MASTER_PRIV_FILE`
mkdir -p $MASTER_PRIV_DIR
gnunet-ecc -g1 $MASTER_PRIV_FILE > /dev/null
cp $MASTER_PRIV_FILE ${BASEDB}.mpriv
MASTER_PUB=`gnunet-ecc -p $MASTER_PRIV_FILE`
MERCHANT_PORT=`taler-config -c $CONF_ONCE -s MERCHANT -o PORT`
MERCHANT_URL=http://localhost:${MERCHANT_PORT}/

View File

@ -10,7 +10,7 @@ set -eu
# Set of numbers for all the testcases.
# When adding new tests, increase the last number:
ALL_TESTS=`seq 0 34`
ALL_TESTS=`seq 0 33`
# $TESTS determines which tests we should run.
# This construction is used to make it easy to
@ -211,11 +211,31 @@ function run_audit () {
if test ${2:-no} = "drain"
then
echo -n "Running taler-exchange-offline drain ..."
taler-exchange-offline -L DEBUG -c $CONF \
drain TESTKUDOS:0.1 exchange-account-1 payto://x-taler-bank/localhost/drain-target \
cp "${CONF}" "${CONF}.tmp"
taler-config -c "${CONF}.tmp" -s exchange-offline -o MASTER_PRIV_FILE -V ${DB}.mpriv
echo -n "Starting exchange..."
taler-exchange-httpd -c "${CONF}.tmp" -L INFO 2> exchange-httpd-drain.err &
EPID=$!
# Wait for all services to be available
for n in `seq 1 50`
do
echo -n "."
sleep 0.1
OK=0
# exchange
wget http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null || continue
OK=1
break
done
echo "... DONE."
# FIXME-MS: need to make sure here that the target IBAN exists!
taler-exchange-offline -L DEBUG -c "${CONF}.tmp" \
drain TESTKUDOS:0.1 exchange-account-1 payto://iban/SANDBOXX/DE360679?receiver-name=Exchange+Drain \
upload \
2> taler-exchange-offline-drain.log || exit_fail "offline draining failed"
kill -TERM $EPID
wait $EPID
rm -f "${CONF}.tmp"
echo -n "Running taler-exchange-drain ..."
echo "\n" | taler-exchange-drain -L DEBUG -c $CONF 2> taler-exchange-drain.log || exit_fail "FAIL"
echo " DONE"
@ -223,7 +243,10 @@ function run_audit () {
echo -n "Running taler-exchange-transfer ..."
taler-exchange-transfer -L INFO -t -c $CONF 2> drain-transfer.log || exit_fail "FAIL"
echo " DONE"
# FIXME-MS: transfer tool is happy here, but
# the wire transfer triggered here does NOT
# show up during the audit. Do we have to
# trigger some libeufin/sandbox job first?
fi
audit_only
post_audit
@ -1908,7 +1931,7 @@ fi
function test_34() {
echo "===========34: normal run with aggregator and profit drain==========="
run_audit aggregator
run_audit aggregator drain
echo "Checking output"
# if an emergency was detected, that is a bug and we should fail
@ -2011,6 +2034,12 @@ then
exit_fail "Wrong arithmetic delta from reserves, got unexpected minus of $LOSS"
fi
DRAINED=`jq -r .total_drained < test-audit-wire.json`
if test $DRAINED != "TESTKUDOS:0.1"
then
exit_fail "Wrong amount drained, got unexpected drain of $DRAINED"
fi
jq -e .amount_arithmetic_inconsistencies[0] < test-audit-aggregation.json > /dev/null && exit_fail "Unexpected arithmetic inconsistencies from aggregations detected in ordinary run"
jq -e .amount_arithmetic_inconsistencies[0] < test-audit-coins.json > /dev/null && exit_fail "Unexpected arithmetic inconsistencies from coins detected in ordinary run"
jq -e .amount_arithmetic_inconsistencies[0] < test-audit-reserves.json > /dev/null && exit_fail "Unexpected arithmetic inconsistencies from reserves detected in ordinary run"

View File

@ -3056,6 +3056,8 @@ do_drain (char *const *args)
account_section),
GNUNET_JSON_pack_string ("payto_uri",
payto_uri),
TALER_JSON_pack_amount ("amount",
&amount),
GNUNET_JSON_pack_timestamp ("date",
date),
GNUNET_JSON_pack_data_auto ("master_sig",

View File

@ -88,7 +88,7 @@ CREATE TABLE IF NOT EXISTS profit_drains
,payto_uri VARCHAR NOT NULL
,trigger_date INT8 NOT NULL
,amount_val INT8 NOT NULL
,amount_frac INT8 NOT NULL
,amount_frac INT4 NOT NULL
,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
,executed BOOLEAN NOT NULL DEFAULT FALSE
);