Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit cd2dfa8

Browse files
author
dmitsh
authored
fixed bug in cluster-tests/dcos/test.sh (#741)
* fixed bug in cluster-tests/dcos/test.sh
1 parent f24aea3 commit cd2dfa8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/cluster-tests/dcos/test.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set -x
1717
source "$DIR/../utils.sh"
1818

1919
remote_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"
2121
remote_cp="scp -i "${SSH_KEY}" -P 2200 -o StrictHostKeyChecking=no"
2222

2323
function 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

4141
log "Adding marathon app"
42-
count=10
42+
count=20
4343
while (( $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))
4949
done
5050
if [[ "$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
8181
log "Checking Service"
8282
count=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

Comments
 (0)