Added ping_check and ssh_check functions and use it in exercise.sh
Change-Id: I69d41c9db527f60f250b6af36b2d8e9d0dd39684
diff --git a/exercises/euca.sh b/exercises/euca.sh
index 58b5d91..b121493 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -130,10 +130,7 @@
die "Failure authorizing rule in $SECGROUP"
# Test we can ping our floating ip within ASSOCIATE_TIMEOUT seconds
-if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! ping -c1 -w1 $FLOATING_IP; do sleep 1; done"; then
- echo "Couldn't ping server with floating ip"
- exit 1
-fi
+ping_check "$PUBLIC_NETWORK_NAME" $FLOATING_IP $ASSOCIATE_TIMEOUT
# Revoke pinging
euca-revoke -P icmp -s 0.0.0.0/0 -t -1:-1 $SECGROUP || \