summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-09-02 10:49:18 -0300
committerSebastian <sebasjm@gmail.com>2021-09-02 10:49:18 -0300
commiteac1b39e5b5b5ada08d030c91e5abb9a80e0c127 (patch)
treeeec5c10f5508c4ae926185364856770405fb773e
parent4b8dc55c4330df6a3d2a552985afdd6a80737405 (diff)
downloadmerchant-eac1b39e5b5b5ada08d030c91e5abb9a80e0c127.tar.gz
merchant-eac1b39e5b5b5ada08d030c91e5abb9a80e0c127.tar.bz2
merchant-eac1b39e5b5b5ada08d030c91e5abb9a80e0c127.zip
check the exchange get its keys before trying to sign them
-rwxr-xr-xsrc/testing/initialize_taler_system.sh34
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 &
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 \