From 0da8dbd0a369d90e7eafd88e54a1cff91f09448d Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 29 Nov 2012 14:37:14 -0500 Subject: [PATCH] create a horizon exercise for sanity check from time to time horizon gets broken in devstack and it takes a while to figure out why. Put a sanity check into devstack exercises that checks for horizon front page being up and not just a stack trace to use as a simple gate. Change-Id: I13a6c59881f618d5194b1625b67115013c9cb6c2 --- exercises/horizon.sh | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 exercises/horizon.sh diff --git a/exercises/horizon.sh b/exercises/horizon.sh new file mode 100755 index 0000000000..c5dae3ab64 --- /dev/null +++ b/exercises/horizon.sh @@ -0,0 +1,45 @@ +#!/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 '

Log In

' || die "Horizon front page not functioning!" + +set +o xtrace +echo "*********************************************************************" +echo "SUCCESS: End DevStack Exercise: $0" +echo "*********************************************************************" +