Merge "Add execrise script to devstack"
This commit is contained in:
commit
29be044af9
46
contrib/devstack/exercises/rally.sh
Normal file
46
contrib/devstack/exercises/rally.sh
Normal file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# **rally.sh**
|
||||
|
||||
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
|
||||
source $TOP_DIR/functions
|
||||
|
||||
# Import configuration
|
||||
source $TOP_DIR/openrc
|
||||
|
||||
# Import exercise configuration
|
||||
source $TOP_DIR/exerciserc
|
||||
|
||||
is_service_enabled rally || exit 55
|
||||
|
||||
# Import rally functions
|
||||
source $TOP_DIR/lib/rally
|
||||
|
||||
# Run tests
|
||||
run_all_benchmarks
|
||||
|
||||
set +o xtrace
|
||||
echo "*********************************************************************"
|
||||
echo "SUCCESS: End DevStack Exercise: $0"
|
||||
echo "*********************************************************************"
|
||||
|
@ -123,6 +123,13 @@ function init_rally() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Run all benchmarks from samples dir to ensure it all works.
|
||||
function run_all_benchmarks() {
|
||||
for CONF in $DEST/rally/doc/samples/tasks/*/*.yaml; do
|
||||
rally task start --task $CONF
|
||||
done
|
||||
}
|
||||
|
||||
# Restore xtrace
|
||||
$XTRACE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user