devstack/exercise.sh
Ian Wienand 3bf69e835a Remove EC2 API from devstack
This all started with an investigation into Fedora's use of ecua2ools
package.  This package is a bit of a nightmare because it pulls in a
lot of other system-python packages.

For Ubuntu, this package was removed in
I47b7e787771683c2fc4404e586f11c1a19aac15c.  However, it is not
actually a "pure python" package as described in that change, in that
it is not installable from pypi.  I can't see how you could actually
run exercises/euca.sh on Ubuntu unless you installed euca2ools by hand
-- ergo I suggest it is totally unused, because nobody seems to have
reported problems.

In the mean time, ec2 api has moved to a plugin [1] anyway where the
recommendation in their README is to use the aws cli from amazon.

Thus remove all the parts related to EC2 and ecua2ools from base
devstack.

[1] https://git.openstack.org/cgit/openstack/ec2-api

Change-Id: I8a07320b59ea6cd7d1fe8bce61af84b5a28fb39e
2016-03-15 13:32:23 +11:00

75 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# **exercise.sh**
# Keep track of the current DevStack directory.
TOP_DIR=$(cd $(dirname "$0") && pwd)
# Import common functions
source $TOP_DIR/functions
# Load local configuration
source $TOP_DIR/stackrc
# Run everything in the exercises/ directory that isn't explicitly disabled
# comma separated list of script basenames to skip
# to refrain from exercising foo.sh use ``SKIP_EXERCISES=foo``
SKIP_EXERCISES=${SKIP_EXERCISES:-""}
# comma separated list of script basenames to run
# to run only foo.sh use ``RUN_EXERCISES=foo``
basenames=${RUN_EXERCISES:-""}
EXERCISE_DIR=$TOP_DIR/exercises
if [[ -z "${basenames}" ]]; then
# Locate the scripts we should run
basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done)
else
# If ``RUN_EXERCISES`` was specified, ignore ``SKIP_EXERCISES``.
SKIP_EXERCISES=
fi
# Track the state of each script
passes=""
failures=""
skips=""
# Loop over each possible script (by basename)
for script in $basenames; do
if [[ ,$SKIP_EXERCISES, =~ ,$script, ]]; then
skips="$skips $script"
else
echo "====================================================================="
echo Running $script
echo "====================================================================="
$EXERCISE_DIR/$script.sh
exitcode=$?
if [[ $exitcode == 55 ]]; then
skips="$skips $script"
elif [[ $exitcode -ne 0 ]]; then
failures="$failures $script"
else
passes="$passes $script"
fi
fi
done
# Output status of exercise run
echo "====================================================================="
for script in $skips; do
echo SKIP $script
done
for script in $passes; do
echo PASS $script
done
for script in $failures; do
echo FAILED $script
done
echo "====================================================================="
if [[ -n "$failures" ]]; then
exit 1
fi