Denis Egorenko | a45a0a0 | 2013-10-01 16:03:39 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
Sergey Lukjanov | 7ff8443 | 2014-03-10 20:04:51 +0400 | [diff] [blame] | 3 | # **sahara.sh** |
Denis Egorenko | a45a0a0 | 2013-10-01 16:03:39 +0000 | [diff] [blame] | 4 | |
Sergey Lukjanov | 7ff8443 | 2014-03-10 20:04:51 +0400 | [diff] [blame] | 5 | # Sanity check that Sahara started if enabled |
Denis Egorenko | a45a0a0 | 2013-10-01 16:03:39 +0000 | [diff] [blame] | 6 | |
| 7 | echo "*********************************************************************" |
| 8 | echo "Begin DevStack Exercise: $0" |
| 9 | echo "*********************************************************************" |
| 10 | |
| 11 | # This script exits on an error so that errors don't compound and you see |
| 12 | # only the first error that occurred. |
| 13 | set -o errexit |
| 14 | |
| 15 | # Print the commands being run so that we can see the command that triggers |
| 16 | # an error. It is also useful for following allowing as the install occurs. |
| 17 | set -o xtrace |
| 18 | |
| 19 | |
| 20 | # Settings |
| 21 | # ======== |
| 22 | |
| 23 | # Keep track of the current directory |
| 24 | EXERCISE_DIR=$(cd $(dirname "$0") && pwd) |
| 25 | TOP_DIR=$(cd $EXERCISE_DIR/..; pwd) |
| 26 | |
| 27 | # Import common functions |
| 28 | source $TOP_DIR/functions |
| 29 | |
| 30 | # Import configuration |
| 31 | source $TOP_DIR/openrc |
| 32 | |
| 33 | # Import exercise configuration |
| 34 | source $TOP_DIR/exerciserc |
| 35 | |
Sergey Lukjanov | 7ff8443 | 2014-03-10 20:04:51 +0400 | [diff] [blame] | 36 | is_service_enabled sahara || exit 55 |
Denis Egorenko | a45a0a0 | 2013-10-01 16:03:39 +0000 | [diff] [blame] | 37 | |
Sergey Lukjanov | 7ff8443 | 2014-03-10 20:04:51 +0400 | [diff] [blame] | 38 | curl http://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!" |
Denis Egorenko | a45a0a0 | 2013-10-01 16:03:39 +0000 | [diff] [blame] | 39 | |
| 40 | set +o xtrace |
| 41 | echo "*********************************************************************" |
| 42 | echo "SUCCESS: End DevStack Exercise: $0" |
| 43 | echo "*********************************************************************" |