1717source " $DIR /../utils.sh"
1818
1919remote_exec=" ssh -i " ${SSH_KEY} " -o ConnectTimeout=30 -o StrictHostKeyChecking=no azureuser@${INSTANCE_NAME} .${LOCATION} .cloudapp.azure.com -p2200"
20- agentFQDN=" dcos-agent-ip- ${INSTANCE_NAME} .${LOCATION} .cloudapp.azure.com"
20+ agentFQDN=" ${INSTANCE_NAME} 0 .${LOCATION} .cloudapp.azure.com"
2121remote_cp=" scp -i " ${SSH_KEY} " -P 2200 -o StrictHostKeyChecking=no"
2222
2323function teardown {
@@ -39,13 +39,13 @@ log "Configuring marathon.json"
3939${remote_exec} sed -i " s/{agentFQDN}/${agentFQDN} /g" marathon.json || (log " Failed to configure marathon.json" ; exit 1)
4040
4141log " Adding marathon app"
42- count=10
42+ count=20
4343while (( $count > 0 )) ; do
4444 log " ... counting down $count "
4545 ${remote_exec} ./dcos marathon app add marathon.json
4646 retval=$?
4747 if [[ " $retval " == " 0" ]]; then break ; fi
48- sleep 5 ; count=$(( count- 1 ))
48+ sleep 15 ; count=$(( count- 1 ))
4949done
5050if [[ " $retval " != " 0" ]]; then
5151 log " gave up waiting for marathon to be added"
@@ -80,11 +80,12 @@ ${remote_exec} ./dcos package install marathon-lb --yes || (log "Failed to insta
8080# curl simpleweb through external haproxy
8181log " Checking Service"
8282count=10
83- while (( $count > 0 )) ; do
83+ while true ; do
8484 log " ... counting down $count "
85- [[ $( curl -sI --max-time 60 " http://${agentFQDN} " | head -n1 | cut -d$' ' -f2) -eq " 200" ]] && log " Successfully hitting simpleweb through external haproxy http://${agentFQDN} " && break
86- if [[ " ${count} " -le 0 ]]; then
87- log " failed to get expected response from nginx through the loadbalancer"
85+ rc=$( curl -sI --max-time 60 " http://${agentFQDN} " | head -n1 | cut -d$' ' -f2)
86+ [[ " $rc " -eq " 200" ]] && log " Successfully hitting simpleweb through external haproxy http://${agentFQDN} " && break
87+ if [[ " ${count} " -le 1 ]]; then
88+ log " failed to get expected response from nginx through the loadbalancer: Error $rc "
8889 exit 1
8990 fi
9091 sleep 5; count=$(( count- 1 ))
0 commit comments