| 1 | 1 |
new file mode 100755 |
| ... | ... |
@@ -0,0 +1,45 @@ |
| 0 |
+#!/usr/bin/env bash |
|
| 1 |
+ |
|
| 2 |
+# **horizon.sh** |
|
| 3 |
+ |
|
| 4 |
+# Sanity check that horizon started if enabled |
|
| 5 |
+ |
|
| 6 |
+echo "*********************************************************************" |
|
| 7 |
+echo "Begin DevStack Exercise: $0" |
|
| 8 |
+echo "*********************************************************************" |
|
| 9 |
+ |
|
| 10 |
+# This script exits on an error so that errors don't compound and you see |
|
| 11 |
+# only the first error that occured. |
|
| 12 |
+set -o errexit |
|
| 13 |
+ |
|
| 14 |
+# Print the commands being run so that we can see the command that triggers |
|
| 15 |
+# an error. It is also useful for following allowing as the install occurs. |
|
| 16 |
+set -o xtrace |
|
| 17 |
+ |
|
| 18 |
+ |
|
| 19 |
+# Settings |
|
| 20 |
+# ======== |
|
| 21 |
+ |
|
| 22 |
+# Keep track of the current directory |
|
| 23 |
+EXERCISE_DIR=$(cd $(dirname "$0") && pwd) |
|
| 24 |
+TOP_DIR=$(cd $EXERCISE_DIR/..; pwd) |
|
| 25 |
+ |
|
| 26 |
+# Import common functions |
|
| 27 |
+source $TOP_DIR/functions |
|
| 28 |
+ |
|
| 29 |
+# Import configuration |
|
| 30 |
+source $TOP_DIR/openrc |
|
| 31 |
+ |
|
| 32 |
+# Import exercise configuration |
|
| 33 |
+source $TOP_DIR/exerciserc |
|
| 34 |
+ |
|
| 35 |
+is_service_enabled horizon || exit 55 |
|
| 36 |
+ |
|
| 37 |
+# can we get the front page |
|
| 38 |
+curl http://$SERVICE_HOST 2>/dev/null | grep -q '<h3>Log In</h3>' || die "Horizon front page not functioning!" |
|
| 39 |
+ |
|
| 40 |
+set +o xtrace |
|
| 41 |
+echo "*********************************************************************" |
|
| 42 |
+echo "SUCCESS: End DevStack Exercise: $0" |
|
| 43 |
+echo "*********************************************************************" |
|
| 44 |
+ |