devstack/exercises/horizon.sh
Nachi Ueno 07115eb5c0 Refactor error logging
It is hard to grep errors in current log. so in this patch,
I'm updating die function which also writes log for
screen_log_dir/error.log.
In future, we may categolize negative fault by using
this error.log.

Change-Id: I70a8cfe67ed408284f5c88c762c6bb8acb8ecdb2
2013-02-28 11:54:24 -08:00

46 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# **horizon.sh**
# Sanity check that horizon 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 occured.
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
source $TOP_DIR/functions
# Import configuration
source $TOP_DIR/openrc
# Import exercise configuration
source $TOP_DIR/exerciserc
is_service_enabled horizon || exit 55
# can we get the front page
curl http://$SERVICE_HOST 2>/dev/null | grep -q '<h3>Log In</h3>' || die $LINENO "Horizon front page not functioning!"
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
echo "*********************************************************************"