diff options
author | Sebastian <sebasjm@gmail.com> | 2021-09-02 10:49:18 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-09-02 10:49:18 -0300 |
commit | eac1b39e5b5b5ada08d030c91e5abb9a80e0c127 (patch) | |
tree | eec5c10f5508c4ae926185364856770405fb773e | |
parent | 4b8dc55c4330df6a3d2a552985afdd6a80737405 (diff) | |
download | merchant-eac1b39e5b5b5ada08d030c91e5abb9a80e0c127.tar.gz merchant-eac1b39e5b5b5ada08d030c91e5abb9a80e0c127.zip |
check the exchange get its keys before trying to sign them
-rwxr-xr-x | src/testing/initialize_taler_system.sh | 34 |
1 files 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 & | |||
138 | 138 | ||
139 | echo " OK" | 139 | echo " OK" |
140 | 140 | ||
141 | echo -n "Wait RSA service to build keys..." | ||
142 | ( tail -f -n0 taler-exchange-secmod-rsa.log & ) | grep -q "Sending RSA SYNCED message" | ||
143 | echo " done" | ||
144 | |||
145 | echo -n "Waiting for the bank" | 141 | echo -n "Waiting for the bank" |
146 | # Wait for bank to be available (usually the slowest) | 142 | # Wait for bank to be available (usually the slowest) |
147 | for n in `seq 1 50` | 143 | for n in `seq 1 50` |
@@ -159,12 +155,14 @@ if [ 1 != $OK ] | |||
159 | then | 155 | then |
160 | exit_skip "Failed to launch services (bank)" | 156 | exit_skip "Failed to launch services (bank)" |
161 | fi | 157 | fi |
158 | echo " OK" | ||
162 | 159 | ||
160 | echo -n "Waiting for taler services " | ||
163 | # Wait for all other taler services to be available | 161 | # Wait for all other taler services to be available |
164 | for n in `seq 1 50` | 162 | for n in `seq 1 10` |
165 | do | 163 | do |
166 | echo -n "." | 164 | echo -n "." |
167 | sleep 0.1 | 165 | sleep 1 |
168 | OK=0 | 166 | OK=0 |
169 | # exchange | 167 | # exchange |
170 | wget --tries=1 --timeout=1 http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null || continue | 168 | wget --tries=1 --timeout=1 http://localhost:8081/seed -o /dev/null -O /dev/null >/dev/null || continue |
@@ -183,6 +181,30 @@ fi | |||
183 | 181 | ||
184 | echo "OK" | 182 | echo "OK" |
185 | 183 | ||
184 | set +e | ||
185 | echo -n 'Wait the exchange for gather its keys ' | ||
186 | for n in `seq 1 10` | ||
187 | do | ||
188 | echo -n "." | ||
189 | sleep 1 | ||
190 | OK=0 | ||
191 | # exchange | ||
192 | wget --tries=3 --waitretry=0 --timeout=1 http://localhost:8081/management/keys -o /dev/null -O $LAST_RESPONSE >/dev/null | ||
193 | DENOMS_COUNT=`jq '.future_denoms|length' < $LAST_RESPONSE` | ||
194 | SIGNKEYS_COUNT=`jq '.future_signkeys|length' < $LAST_RESPONSE` | ||
195 | [[ -z "$SIGNKEYS_COUNT" || "$SIGNKEYS_COUNT" == "0" || -z "$DENOMS_COUNT" || "$DENOMS_COUNT" == "0" ]] && continue | ||
196 | OK=1 | ||
197 | break; | ||
198 | done | ||
199 | set -e | ||
200 | |||
201 | if [ 1 != $OK ] | ||
202 | then | ||
203 | exit_skip "Failed to setup exchange keys, check secmod logs" | ||
204 | fi | ||
205 | |||
206 | echo " OK" | ||
207 | |||
186 | echo -n "Setting up keys ..." | 208 | echo -n "Setting up keys ..." |
187 | taler-exchange-offline -c $CONF \ | 209 | taler-exchange-offline -c $CONF \ |
188 | download \ | 210 | download \ |