From 403c39d742138c4e65ac14dd2510555aafa22937 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Mon, 13 Jul 2015 11:21:07 +0200 Subject: [PATCH] Fix shell Services test --- hack/e2e-suite/services.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/hack/e2e-suite/services.sh b/hack/e2e-suite/services.sh index 23372dae510..6918bcd2fae 100755 --- a/hack/e2e-suite/services.sh +++ b/hack/e2e-suite/services.sh @@ -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 @@ -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}" @@ -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