blob: 8cad94562d0df22f85ce360d4d1c9a8828c42bf2 [file] [log] [blame]
Denis Egorenkoa45a0a02013-10-01 16:03:39 +00001#!/usr/bin/env bash
2
Sergey Lukjanov7ff84432014-03-10 20:04:51 +04003# **sahara.sh**
Denis Egorenkoa45a0a02013-10-01 16:03:39 +00004
Sergey Lukjanov7ff84432014-03-10 20:04:51 +04005# Sanity check that Sahara started if enabled
Denis Egorenkoa45a0a02013-10-01 16:03:39 +00006
7echo "*********************************************************************"
8echo "Begin DevStack Exercise: $0"
9echo "*********************************************************************"
10
11# This script exits on an error so that errors don't compound and you see
12# only the first error that occurred.
13set -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.
17set -o xtrace
18
19
20# Settings
21# ========
22
23# Keep track of the current directory
24EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
25TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
26
27# Import common functions
28source $TOP_DIR/functions
29
30# Import configuration
31source $TOP_DIR/openrc
32
33# Import exercise configuration
34source $TOP_DIR/exerciserc
35
Sergey Lukjanov7ff84432014-03-10 20:04:51 +040036is_service_enabled sahara || exit 55
Denis Egorenkoa45a0a02013-10-01 16:03:39 +000037
Rob Crittendence2d75d2015-06-04 18:01:29 -040038if is_ssl_enabled_service "sahara" || is_service_enabled tls-proxy; then
39 SAHARA_SERVICE_PROTOCOL="https"
40fi
41
42SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
43
44$CURL_GET $SAHARA_SERVICE_PROTOCOL://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!"
Denis Egorenkoa45a0a02013-10-01 16:03:39 +000045
46set +o xtrace
47echo "*********************************************************************"
48echo "SUCCESS: End DevStack Exercise: $0"
49echo "*********************************************************************"