Skip to content

Commit

Permalink
Extend waiting script to work with mtls tests (#2321)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrankowski authored Nov 17, 2023
1 parent 75a3e03 commit d6bf9a5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packaging/tests/scripts/wait-for-alfresco-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ then
exit 1
fi

# If MTLS enabled configure keystore/truststore for curl command
if [[ $ALFRESCO_URL == https* ]]; then
KEYSTORE_TRUSTSTORE_PATH="${CI_WORKSPACE}/keystores/testClient"
KEYSTORE_PASSWORD="password"

ADDITIONAL_MTLS_CONFIG="--key $KEYSTORE_TRUSTSTORE_PATH/client-key.pem --cert $KEYSTORE_TRUSTSTORE_PATH/client-cert.pem:$KEYSTORE_PASSWORD --cacert $KEYSTORE_TRUSTSTORE_PATH/testClient_truststore.pem"
if [[ ${HOSTNAME_VERIFICATION_DISABLED} == true ]]; then
ADDITIONAL_MTLS_CONFIG=$ADDITIONAL_MTLS_CONFIG" -k"
fi
else
ADDITIONAL_MTLS_CONFIG=""
fi

WAIT_INTERVAL=1
COUNTER=0
TIMEOUT=300
t0=$(date +%s)

echo "Waiting for alfresco to start"
until $(curl --output /dev/null --silent --head --fail ${ALFRESCO_URL}) || [ "$COUNTER" -eq "$TIMEOUT" ]; do
echo curl --output /dev/null --silent --head --fail ${ADDITIONAL_MTLS_CONFIG} ${ALFRESCO_URL}
until $(curl --output /dev/null --silent --head --fail ${ADDITIONAL_MTLS_CONFIG} ${ALFRESCO_URL}) || [ "$COUNTER" -eq "$TIMEOUT" ]; do
printf '.'
sleep $WAIT_INTERVAL
COUNTER=$(($COUNTER+$WAIT_INTERVAL))
Expand Down

0 comments on commit d6bf9a5

Please sign in to comment.