diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-04-14 17:56:01 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-04-14 17:56:01 +0200 |
commit | 1c5fa025cc4a6369f585cb5b169cc677d093d30d (patch) | |
tree | 33f10698bd82a34aa6172f177bd157542953d161 | |
parent | 972e9098215a28f45e8542b0f34b79aa42096f0e (diff) |
test for #6836 -- passes
-rw-r--r-- | src/testing/.gitignore | 4 | ||||
-rw-r--r-- | src/testing/test_key_rotation.conf | 28 | ||||
-rwxr-xr-x | src/testing/test_key_rotation.sh | 23 |
3 files changed, 34 insertions, 21 deletions
diff --git a/src/testing/.gitignore b/src/testing/.gitignore new file mode 100644 index 00000000..5a2773d2 --- /dev/null +++ b/src/testing/.gitignore @@ -0,0 +1,4 @@ +taler-bank.err +test_rotation_home/ +*.err +*.out diff --git a/src/testing/test_key_rotation.conf b/src/testing/test_key_rotation.conf index d6eaaad4..22d04dc4 100644 --- a/src/testing/test_key_rotation.conf +++ b/src/testing/test_key_rotation.conf @@ -18,7 +18,7 @@ UNIXPATH = ${TALER_RUNTIME_DIR}/exchange.http UNIXPATH_MODE = 660 PORT = 8081 BASE_URL = http://localhost:8081/ -SIGNKEY_DURATION = 2 s +SIGNKEY_DURATION = 30 s SIGNKEY_LEGAL_DURATION = 15 m KEYDIR = ${TALER_DATA_HOME}/exchange/live-keys/ REVOCATION_DIR = ${TALER_DATA_HOME}/exchange/revocations/ @@ -26,19 +26,19 @@ TERMS_ETAG = 0 PRIVACY_ETAG = 0 [taler-exchange-secmod-eddsa] -OVERLAP_DURATION = 1 s +OVERLAP_DURATION = 5 s KEY_DIR = ${TALER_DATA_HOME}/crypto-eddsa/ UNIXPATH = $TALER_RUNTIME_DIR/taler-exchange-secmod-eddsa.sock SM_PRIV_KEY = ${TALER_DATA_HOME}/taler-exchange-secmod-eddsa/.private-key -LOOKAHEAD_SIGN = 15 s -DURATION = 2 s +LOOKAHEAD_SIGN = 60 s +DURATION = 30 s [taler-exchange-secmod-rsa] -OVERLAP_DURATION = 1 s +OVERLAP_DURATION = 5 s KEY_DIR = ${TALER_DATA_HOME}/crypto-rsa/ UNIXPATH = $TALER_RUNTIME_DIR/taler-exchange-secmod-rsa.sock SM_PRIV_KEY = ${TALER_DATA_HOME}/taler-exchange-secmod-rsa/.private-key -LOOKAHEAD_SIGN = 15 s +LOOKAHEAD_SIGN = 60 s [merchant] @@ -110,7 +110,7 @@ exchange = http://localhost:8081/ [coin_kudos_ct_1] value = TESTKUDOS:0.01 -duration_withdraw = 2 s +duration_withdraw = 30 s duration_spend = 5 m duration_legal = 15 m fee_withdraw = TESTKUDOS:0.01 @@ -121,7 +121,7 @@ rsa_keysize = 1024 [coin_kudos_ct_10] value = TESTKUDOS:0.10 -duration_withdraw = 2 s +duration_withdraw = 30 s duration_spend = 5 m duration_legal = 15 m fee_withdraw = TESTKUDOS:0.01 @@ -132,7 +132,7 @@ rsa_keysize = 1024 [coin_kudos_1] value = TESTKUDOS:1 -duration_withdraw = 2 s +duration_withdraw = 30 s duration_spend = 5 m duration_legal = 15 m fee_withdraw = TESTKUDOS:0.02 @@ -143,7 +143,7 @@ rsa_keysize = 1024 [coin_kudos_2] value = TESTKUDOS:2 -duration_withdraw = 2 s +duration_withdraw = 30 s duration_spend = 5 m duration_legal = 15 m fee_withdraw = TESTKUDOS:0.03 @@ -154,7 +154,7 @@ rsa_keysize = 1024 [coin_kudos_4] value = TESTKUDOS:4 -duration_withdraw = 2 s +duration_withdraw = 30 s duration_spend = 5 m duration_legal = 15 m fee_withdraw = TESTKUDOS:0.03 @@ -165,7 +165,7 @@ rsa_keysize = 1024 [coin_kudos_5] value = TESTKUDOS:5 -duration_withdraw = 2 s +duration_withdraw = 30 s duration_spend = 5 m duration_legal = 15 m fee_withdraw = TESTKUDOS:0.01 @@ -176,7 +176,7 @@ rsa_keysize = 1024 [coin_kudos_8] value = TESTKUDOS:8 -duration_withdraw = 2 s +duration_withdraw = 30 s duration_spend = 5 m duration_legal = 15 m fee_withdraw = TESTKUDOS:0.05 @@ -187,7 +187,7 @@ rsa_keysize = 1024 [coin_kudos_10] value = TESTKUDOS:10 -duration_withdraw = 2 s +duration_withdraw = 30 s duration_spend = 5 m duration_legal = 15 m fee_withdraw = TESTKUDOS:0.01 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" |