Skip to content

Commit

Permalink
Fix shell Services test
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-t committed Jul 13, 2015
1 parent 1e2e38a commit 403c39d
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions hack/e2e-suite/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ function make_namespace() {
__EOF__
}

wait_for_apiserver() {
echo "Waiting for apiserver to be up"

local i
for i in $(seq 1 12); do
results=($(ssh-to-node "${master}" "
wget -q -T 1 -O - http://localhost:8080/healthz || true
"))
if [[ "${results}" == "ok" ]]; then
return
fi
sleep 5 # wait for apiserver to restart
done
error "restarting apiserver timed out"
}

# Args:
# $1: service name
# $2: service port
Expand Down Expand Up @@ -420,7 +436,7 @@ verify_from_container "${svc3_name}" "${svc3_ip}" "${svc3_port}" \
echo "Test 6: Restart the master, make sure VIPs come back."
echo "Restarting the master"
restart-apiserver "${master}"
sleep 5
wait_for_apiserver
echo "Verifying the VIPs from the host"
wait_for_service_up "${svc3_name}" "${svc3_ip}" "${svc3_port}" \
"${svc3_count}" "${svc3_pods}"
Expand Down Expand Up @@ -457,6 +473,4 @@ echo "Verifying the VIPs from a container"
verify_from_container "${svc4_name}" "${svc4_ip}" "${svc4_port}" \
"${svc4_count}" "${svc4_pods}"

# TODO: test createExternalLoadBalancer

exit 0

0 comments on commit 403c39d

Please sign in to comment.