Browse code

RUNNING_TIMEOUT = BOOT_TIMEOUT + ACTIVE_TIMEOUT

Todd Willey authored on 2011/11/06 00:02:34
Showing 2 changed files
... ...
@@ -28,8 +28,8 @@ IMAGE=`euca-describe-images | grep machine | cut -f2`
28 28
 INSTANCE=`euca-run-instances $IMAGE | grep INSTANCE | cut -f2`
29 29
 
30 30
 # assure it has booted within a reasonable time
31
-if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
32
-    echo "server didn't become active within $BOOT_TIMEOUT seconds"
31
+if ! timeout $RUNNING_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
32
+    echo "server didn't become active within $RUNNING_TIMEOUT seconds"
33 33
     exit 1
34 34
 fi
35 35
 
... ...
@@ -55,5 +55,8 @@ export BOOT_TIMEOUT=${BOOT_TIMEOUT:-15}
55 55
 # Max time to wait while vm goes from build to active state
56 56
 export ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-10}
57 57
 
58
+# Max time from run instance command until it is running
59
+export RUNNING_TIMEOUT=${RUNNING_TIMEOUT:-$(($BOOT_TIMEOUT + $ACTIVE_TIMEOUT))}
60
+
58 61
 # Max time to wait for proper IP association and dis-association.
59 62
 export ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-10}