From a9d8713db4d03faac18c7f25aa43cfacab926646 Mon Sep 17 00:00:00 2001 From: Rajat Chopra Date: Fri, 6 Feb 2015 18:34:27 -0800 Subject: [PATCH] fix e2e services for vagrant --- cluster/vagrant/util.sh | 11 ++++++++++- hack/e2e-suite/services.sh | 8 ++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/cluster/vagrant/util.sh b/cluster/vagrant/util.sh index 4336c7a5166..33285e6d202 100644 --- a/cluster/vagrant/util.sh +++ b/cluster/vagrant/util.sh @@ -268,6 +268,10 @@ function find-vagrant-name-by-ip { # Find the vagrant machien name based on the host name of the minion function find-vagrant-name-by-minion-name { local ip="$1" + if [[ "$ip" == "${INSTANCE_PREFIX}-master" ]]; then + echo "master" + return $? + fi local ip_pattern="${INSTANCE_PREFIX}-minion-(.*)" [[ $ip =~ $ip_pattern ]] || { @@ -291,7 +295,7 @@ function ssh-to-node { return 1 } - vagrant ssh "${machine}" -c "${cmd}" | grep -v "Connection to.*closed" + vagrant ssh "${machine}" -c "${cmd}" } # Restart the kube-proxy on a node ($1) @@ -299,6 +303,11 @@ function restart-kube-proxy { ssh-to-node "$1" "sudo systemctl restart kube-proxy" } +# Restart the apiserver +function restart-apiserver { + ssh-to-node "${master}" "sudo systemctl restart kube-apiserver" +} + function setup-monitoring-firewall { echo "TODO" 1>&2 } diff --git a/hack/e2e-suite/services.sh b/hack/e2e-suite/services.sh index d24639d04c1..73e049582fc 100755 --- a/hack/e2e-suite/services.sh +++ b/hack/e2e-suite/services.sh @@ -261,7 +261,7 @@ function verify_from_container() { for i in $(seq -s' ' 1 $4); do ok=false for j in $(seq -s' ' 1 10); do - if wget -q -T 1 -O - http://$2:$3; then + if wget -q -T 5 -O - http://$2:$3; then echo ok=true break @@ -415,7 +415,11 @@ verify_from_container "${svc3_name}" "${svc3_ip}" "${svc3_port}" \ # echo "Test 6: Restart the master, make sure portals come back." echo "Restarting the master" -ssh-to-node "${master}" "sudo /etc/init.d/kube-apiserver restart" +if [[ "$KUBERNETES_PROVIDER" == "vagrant" ]]; then + restart-apiserver "${master}" +else + ssh-to-node "${master}" "sudo /etc/init.d/kube-apiserver restart" +fi sleep 5 echo "Verifying the portals from the host" wait_for_service_up "${svc3_name}" "${svc3_ip}" "${svc3_port}" \