From f9c43fecf48930d711908b8fb7035669be47e426 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Thu, 7 May 2015 17:00:01 +0000 Subject: [PATCH] Wait for VMs to come up before connecting --- test/gce.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/gce.sh b/test/gce.sh index d30b86bb..0a42948a 100755 --- a/test/gce.sh +++ b/test/gce.sh @@ -44,6 +44,14 @@ function internal_ip { gcloud compute instances list $1 --format=yaml | grep "^ networkIP\:" | cut -d: -f2 | tr -d ' ' } +function try_connect { + for i in $(seq 0 10); do + if ssh -t $1 true; then + return + fi + done +} + function install_docker_on { name=$1 ssh -t $name sudo bash -x -s <>/etc/hosts" + try_connect $hostname # Add the local ips to the remote /etc/hosts for othername in $names; do