devstack/extras.d/80-tempest.sh
Sam Betts 5c39154c39 Ensure testing configuration can run as late as possible
Before the code in the extra.d plugins was removed from the devstack
tree they could define the order they ran. When this code is decomposed
into a plugin, there is still a need to do some form of ordering. This
caused problems with the Ironic devstack plugin and Tempest because the
code is run in this order:

 1. The tempest configuration is run from extra.d, processing
    DEFAULT_INSTANCE_TYPE, and writing the flavor_ref to tempest.conf

 2. The Ironic devstack plugin is run, creating the flavor needed for
    DEFAULT_INSTANCE_TYPE

This leads to build failures as tempest can not find the required
flavor, so it writes which ever flavor it can find at the time into
flavor_ref. Ironic now has code it its devstack plugin duplicated from
the tempest plugin to work around this problem until this is merged.

This patch fixes this by using the test-config phase to move the tempest
plugin as late as possible in the devstack process.

Change-Id: I3d98692e69d94756e0034c83a247e05d85177f02
2016-08-10 15:58:27 +01:00

36 lines
1.0 KiB
Bash

# tempest.sh - DevStack extras script
if is_service_enabled tempest; then
if [[ "$1" == "source" ]]; then
# Initial source
source $TOP_DIR/lib/tempest
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing Tempest"
install_tempest
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
# Tempest config must come after layer 2 services are running
:
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# Tempest config must come after all other plugins are run
:
elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
# local.conf Tempest option overrides
:
elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then
echo_summary "Initializing Tempest"
configure_tempest
echo_summary "Installing Tempest Plugins"
install_tempest_plugins
fi
if [[ "$1" == "unstack" ]]; then
# no-op
:
fi
if [[ "$1" == "clean" ]]; then
# no-op
:
fi
fi