Skip to content

Commit 09a681e

Browse files
committed
e2e.sh: ensure vSphere connectivity is up
1 parent 2368da2 commit 09a681e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

hack/e2e.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,24 @@ if [[ "${GOVC_URL:-}" == "10.2.224.4" ]]; then
137137
E2E_CONF_OVERRIDE_FILE="$(pwd)/test/e2e/config/config-overrides-mirror-prow.yaml"
138138
fi
139139

140+
# Ensure vSphere is reachable
141+
function wait_for_vsphere_reachable() {
142+
local n=0
143+
until [ $n -ge 30 ]; do
144+
curl "https://${VSPHERE_SERVER}" --connect-timeout 2 -k && RET=$? || RET=$?
145+
if [[ "$RET" -eq 0 ]]; then
146+
break
147+
fi
148+
n=$((n + 1))
149+
sleep 1
150+
done
151+
return "$RET"
152+
}
153+
# Only run the boskos/check for IPAM when we need them (not for vcsim)
154+
if [[ ! "${GINKGO_FOCUS:-}" =~ $RE_VCSIM ]]; then
155+
wait_for_vsphere_reachable
156+
fi
157+
140158
# Make tests run in-parallel
141159
export GINKGO_NODES=5
142160

0 commit comments

Comments
 (0)