fix testcase, enable new testcases

This commit is contained in:
Christian Grothoff 2019-10-06 12:32:49 +02:00
parent 03439cac91
commit 97075502e0
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -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 17`
ALL_TESTS=`seq 0 21`
# $TESTS determines which tests we should run.
# This construction is used to make it easy to
@ -59,7 +59,7 @@ function pre_audit () {
if test ${1:-no} = "aggregator"
then
echo -n "Running exchange aggregator ..."
taler-exchange-aggregator -t -c $CONF 2> aggregator.log
taler-exchange-aggregator -L INFO -t -c $CONF 2> aggregator.log
echo " DONE"
fi
}
@ -1088,10 +1088,13 @@ echo "===========20: reserve closure done properly ================="
OLD_TIME=`echo "SELECT execution_date FROM reserves_in WHERE reserve_in_serial_id=1;" | psql $DB -Aqt`
OLD_VAL=`echo "SELECT credit_val FROM reserves_in WHERE reserve_in_serial_id=1;" | psql $DB -Aqt`
RES_PUB=`echo "SELECT reserve_pub FROM reserves_in WHERE reserve_in_serial_id=1;" | psql $DB -Aqt`
OLD_EXP=`echo "SELECT expiration_date FROM reserves WHERE reserve_pub='${RES_PUB}';" | psql $DB -Aqt`
VAL_DELTA=1
NEW_TIME=`expr $OLD_TIME - 3024000000000` # 5 weeks
NEW_CREDIT=`expr $OLD_VAL + 100`
NEW_EXP=`expr $OLD_EXP - 3024000000000` # 5 weeks
NEW_CREDIT=`expr $OLD_VAL + $VAL_DELTA`
echo "UPDATE reserves_in SET execution_date='${NEW_TIME}',credit_val=${NEW_CREDIT} WHERE reserve_in_serial_id=1;" | psql -Aqt $DB
echo "UPDATE reserves SET current_balance_val=100+current_balance_val WHERE reserve_pub='${RES_PUB}';" | psql -Aqt $DB
echo "UPDATE reserves SET current_balance_val=${VAL_DELTA}+current_balance_val,expiration_date='${NEW_EXP}' WHERE reserve_pub='${RES_PUB}';" | psql -Aqt $DB
# Need to run with the aggregator so the reserve closure happens
run_audit aggregator
@ -1104,6 +1107,7 @@ echo "PASS"
# Undo
echo "UPDATE reserves_in SET execution_date='${OLD_TIME}',credit_val=${OLD_VAL} WHERE reserve_in_serial_id=1;" | psql -Aqt $DB
echo "UPDATE reserves SET expiration_date='${OLD_EXP}',current_balance_val=current_balance_val-${VAL_DELTA} WHERE reserve_pub='${RES_PUB}';" | psql -Aqt $DB
}