fix e2e services for vagrant

This commit is contained in:
Rajat Chopra 2015-02-06 18:34:27 -08:00
parent b61ea1bbf1
commit a9d8713db4
2 changed files with 16 additions and 3 deletions

View File

@ -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
}

View File

@ -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}" \