summaryrefslogtreecommitdiff
path: root/src/testing/test_key_rotation.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-04-14 17:56:01 +0200
committerChristian Grothoff <christian@grothoff.org>2021-04-14 17:56:01 +0200
commit1c5fa025cc4a6369f585cb5b169cc677d093d30d (patch)
tree33f10698bd82a34aa6172f177bd157542953d161 /src/testing/test_key_rotation.sh
parent972e9098215a28f45e8542b0f34b79aa42096f0e (diff)
downloadmerchant-1c5fa025cc4a6369f585cb5b169cc677d093d30d.tar.gz
merchant-1c5fa025cc4a6369f585cb5b169cc677d093d30d.tar.bz2
merchant-1c5fa025cc4a6369f585cb5b169cc677d093d30d.zip
test for #6836 -- passes
Diffstat (limited to 'src/testing/test_key_rotation.sh')
-rwxr-xr-xsrc/testing/test_key_rotation.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/testing/test_key_rotation.sh b/src/testing/test_key_rotation.sh
index 73e55120..ad5d4ae4 100755
--- a/src/testing/test_key_rotation.sh
+++ b/src/testing/test_key_rotation.sh
@@ -8,6 +8,10 @@ NORM="$(tput sgr0)"
set -eu
+# We use VERY short withdraw periods, set flag to
+# tell wallet explicitly that this is OK...
+export TALER_WALLET_DEBUG_DENOMSEL_ALLOW_LATE=1
+
# Exit, with status code "skip" (no 'real' failure)
function exit_skip() {
echo " SKIP: $1"
@@ -189,7 +193,7 @@ ORDER_2=`curl -s -H "Content-Type: application/json" -X POST \
http://localhost:9966/private/orders \
-d '{"create_token":false, "order":{"amount":"TESTKUDOS:0.01","summary":"Minimal test order #2"}}' \
| jq -er '.order_id'`
-PAY2=taler+http://pay/localhost:9966/${ORDER_1}/
+PAY2=taler+http://pay/localhost:9966/${ORDER_2}/
if [ "$STATUS" != "204" ]
@@ -201,7 +205,11 @@ fi
echo "OK"
-bash
+export CONF
+export AUDITOR_PUB
+export AUDITOR_URL
+export EXCHANGE_URL
+export WALLET_DB
echo -n "Setting up keys ..."
taler-exchange-offline -c $CONF \
@@ -248,16 +256,17 @@ taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api 'withdrawTestBalance'
}' \
--arg BANK_URL "$BANK_URL" \
--arg EXCHANGE_URL "$EXCHANGE_URL"
- )" 2> /dev/null >/dev/null
-taler-wallet-cli --wallet-db=$WALLET_DB run-until-done 2>/dev/null >/dev/null
+ )" 2>wallet-withdraw-1.err >wallet-withdraw-1.out
+taler-wallet-cli --wallet-db=$WALLET_DB run-until-done 2>wallet-withdraw-finish-1.err >wallet-withdraw-finish-1.out
echo " OK"
+
echo -n "Pay first order ..."
-taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB handle-uri ${PAY1} 2> wallet-pay1.err > wallet-pay1.log
+taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB handle-uri ${PAY1} -y 2> wallet-pay1.err > wallet-pay1.log
echo " OK"
echo -n "Wait for old keys to definitively expire..."
-sleep 15
+sleep 60
echo " OK"
echo -n "Updating keys ..."
@@ -285,7 +294,7 @@ taler-wallet-cli --wallet-db=$WALLET_DB run-until-done 2>/dev/null >/dev/null
echo " OK"
echo -n "Pay second order ..."
-taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB handle-uri ${PAY2} 2> wallet-pay1.err > wallet-pay1.log
+taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB handle-uri ${PAY2} -y 2> wallet-pay2.err > wallet-pay2.log
echo " OK"