Configure tempest service_availability correctly

To be able to correctly identify services are enabled or not to
run respective tempest tests, configure the same in devstack plugin
in proper way, instead of deciding the service availability based on
import of plugins.

Closes-Bug: #1743688
Change-Id: I9cbe3f1307b78d0e703069bc6c011b62c0d3c51f
This commit is contained in:
Anusha Ramineni 2018-02-05 10:03:26 +05:30
parent 85e5c5d618
commit aa779c5bd4
2 changed files with 28 additions and 0 deletions

View File

@ -105,6 +105,25 @@ function configure_congress_datasources {
fi
}
function _configure_tempest {
# NOTE(gmann): Every service which are required by congress
# CI/CD has to be explicitly set here on Tempest. Devstack
# only set the Tempest in-tree configured service only which
# are - [nova, keystone, cinder, glance, swift, glance, neutron].
# service_available from Tempest plugin is not guaranteed to be
# set correctly due to different env setup scenario, so it is
# better to set it explicitly here.
local service
local required_services="heat,ironic,aodh,murano,mistral"
for service in ${required_services//,/ }; do
if is_service_enabled $service ; then
iniset $TEMPEST_CONFIG service_available $service "True"
else
iniset $TEMPEST_CONFIG service_available $service "False"
fi
done
}
function _configure_service {
if is_service_enabled $1; then
if [ "$2" == "config" ] ; then
@ -363,6 +382,11 @@ if is_service_enabled congress || is_service_enabled congress-agent; then
echo_summary "Starting Validator agent"
start_cfg_validator_agent
fi
elif [[ "$2" == "test-config" ]]; then
if is_service_enabled tempest; then
# Configure Tempest for Congress
_configure_tempest
fi
fi
fi

View File

@ -44,6 +44,10 @@ CONGRESS_LIBRARY_DIR=$CONGRESS_CONF_DIR/library
# File path to predefined policy and rules
CONGRESS_PREDEFINED_POLICY_FILE=${CONGRESS_PREDEFINED_POLICY_FILE:-""}
TEMPEST_DIR=$DEST/tempest
TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
# Setup default directories for client
#-------------------------------------