From eac1b39e5b5b5ada08d030c91e5abb9a80e0c127 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 2 Sep 2021 10:49:18 -0300 Subject: check the exchange get its keys before trying to sign them --- src/testing/initialize_taler_system.sh | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/testing/initialize_taler_system.sh b/src/testing/initialize_taler_system.sh index 15e59988..b66780a1 100755 --- a/src/testing/initialize_taler_system.sh +++ b/src/testing/initialize_taler_system.sh @@ -138,10 +138,6 @@ taler-auditor-httpd -L INFO -c $CONF 2> taler-auditor-httpd.log & echo " OK" -echo -n "Wait RSA service to build keys..." -( tail -f -n0 taler-exchange-secmod-rsa.log & ) | grep -q "Sending RSA SYNCED message" -echo " done" - echo -n "Waiting for the bank" # Wait for bank to be available (usually the slowest) for n in `seq 1 50` @@ -159,12 +155,14 @@ if [ 1 != $OK ] then exit_skip "Failed to launch services (bank)" fi +echo " OK" +echo -n "Waiting for taler services " # Wait for all other taler services to be available -for n in `seq 1 50` +for n in `seq 1 10` do echo -n "." - sleep 0.1 + sleep 1 OK=0 # exchange wget --tries=1 --timeout=1 http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null || continue @@ -183,6 +181,30 @@ fi echo "OK" +set +e +echo -n 'Wait the exchange for gather its keys ' +for n in `seq 1 10` +do + echo -n "." + sleep 1 + OK=0 + # exchange + wget --tries=3 --waitretry=0 --timeout=1 http://localhost:8081/management/keys -o /dev/null -O $LAST_RESPONSE >/dev/null + DENOMS_COUNT=`jq '.future_denoms|length' < $LAST_RESPONSE` + SIGNKEYS_COUNT=`jq '.future_signkeys|length' < $LAST_RESPONSE` + [[ -z "$SIGNKEYS_COUNT" || "$SIGNKEYS_COUNT" == "0" || -z "$DENOMS_COUNT" || "$DENOMS_COUNT" == "0" ]] && continue + OK=1 + break; +done +set -e + +if [ 1 != $OK ] +then + exit_skip "Failed to setup exchange keys, check secmod logs" +fi + +echo " OK" + echo -n "Setting up keys ..." taler-exchange-offline -c $CONF \ download \ -- cgit v1.2.3