File: exercise.sh

package info (click to toggle)
sahara 1%3A16.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,452 kB
  • sloc: python: 39,677; xml: 3,418; sh: 874; makefile: 80
file content (50 lines) | stat: -rw-r--r-- 1,473 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash

# Sanity check that Sahara started if enabled

echo "*********************************************************************"
echo "Begin DevStack Exercise: $0"
echo "*********************************************************************"

# This script exits on an error so that errors don't compound and you see
# only the first error that occurred.
set -o errexit

# Print the commands being run so that we can see the command that triggers
# an error.  It is also useful for following allowing as the install occurs.
set -o xtrace


# Settings
# ========

# Keep track of the current directory
EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)

# Import common functions
. $TOP_DIR/functions

# Import configuration
. $TOP_DIR/openrc

# Import exercise configuration
. $TOP_DIR/exerciserc

is_service_enabled sahara || exit 55

if is_ssl_enabled_service "sahara" ||\
    is_ssl_enabled_service "sahara-api" ||\
    is_service_enabled tls-proxy; then
    SAHARA_SERVICE_PROTOCOL="https"
fi

SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}

$CURL_GET $SAHARA_SERVICE_PROTOCOL://$SERVICE_HOST:8386/ 2>/dev/null \
                | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!"

set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
echo "*********************************************************************"