Factor out 'wait_for_x' loop to reduce duplication

This commit is contained in:
Bryan Boreham committed 2017-05-19 11:47:57 +00:00
1 parent 1e60cff2ef
commit 66293e8caa
2 files changed
+23 -27

No files matched your search

+3 -11
View File
@@ -44,19 +44,11 @@ sed -e "s%imagePullPolicy: Always%imagePullPolicy: Never$COVERAGE_ARGS%" "$(dirn
sleep 5
wait_for_connections() {
for i in $(seq 1 45); do
if run_on $HOST1 "curl -sS http://127.0.0.1:6784/status | grep \"$SUCCESS\"" ; then
return
fi
echo "Waiting for connections"
sleep 1
done
echo "Timed out waiting for connections to establish" >&2
exit 1
check_connections() {
run_on $HOST1 "curl -sS http://127.0.0.1:6784/status | grep \"$SUCCESS\""
}
assert_raises wait_for_connections
assert_raises 'wait_for_x check_connections "connections to establish"'
# Check we can ping between the Weave bridg IPs on each host
HOST1EXPIP=$($SSH $HOST1 "weave expose" || true)