2014-12-05 14:25:28 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2012-10-04 16:06:44 -04:00
|
|
|
# lib/tempest
|
2012-12-21 11:03:37 -06:00
|
|
|
# Install and configure Tempest
|
2012-10-04 16:06:44 -04:00
|
|
|
|
|
|
|
# Dependencies:
|
2013-10-24 11:27:02 +01:00
|
|
|
#
|
|
|
|
# - ``functions`` file
|
|
|
|
# - ``lib/nova`` service is running
|
|
|
|
# - Global vars that are assumed to be defined:
|
|
|
|
# - ``DEST``, ``FILES``
|
|
|
|
# - ``ADMIN_PASSWORD``
|
|
|
|
# - ``DEFAULT_IMAGE_NAME``
|
|
|
|
# - ``S3_SERVICE_PORT``
|
|
|
|
# - ``SERVICE_HOST``
|
|
|
|
# - ``BASE_SQL_CONN`` ``lib/database`` declares
|
|
|
|
# - ``PUBLIC_NETWORK_NAME``
|
|
|
|
# - ``Q_ROUTER_NAME``
|
2013-11-14 20:02:47 +00:00
|
|
|
# - ``Q_L3_ENABLED``
|
2013-10-24 11:27:02 +01:00
|
|
|
# - ``VIRT_DRIVER``
|
|
|
|
# - ``LIBVIRT_TYPE``
|
|
|
|
# - ``KEYSTONE_SERVICE_PROTOCOL``, ``KEYSTONE_SERVICE_HOST`` from lib/keystone
|
|
|
|
#
|
2012-12-05 20:03:40 +01:00
|
|
|
# Optional Dependencies:
|
2013-10-24 11:27:02 +01:00
|
|
|
#
|
2015-10-30 23:00:57 +08:00
|
|
|
# - ``ALT_*``
|
2013-10-24 11:27:02 +01:00
|
|
|
# - ``LIVE_MIGRATION_AVAILABLE``
|
|
|
|
# - ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION``
|
|
|
|
# - ``DEFAULT_INSTANCE_TYPE``
|
|
|
|
# - ``DEFAULT_INSTANCE_USER``
|
2014-10-16 06:30:28 +00:00
|
|
|
# - ``CINDER_ENABLED_BACKENDS``
|
2015-07-09 13:25:04 -07:00
|
|
|
# - ``NOVA_ALLOW_DUPLICATE_NETWORKS``
|
2013-10-24 11:27:02 +01:00
|
|
|
#
|
2012-10-04 16:06:44 -04:00
|
|
|
# ``stack.sh`` calls the entry points in this order:
|
|
|
|
#
|
2013-10-24 11:27:02 +01:00
|
|
|
# - install_tempest
|
|
|
|
# - configure_tempest
|
|
|
|
# - init_tempest
|
2012-10-04 16:06:44 -04:00
|
|
|
|
|
|
|
# Save trace setting
|
2015-10-13 11:03:03 +11:00
|
|
|
_XTRACE_TEMPEST=$(set +o | grep xtrace)
|
2012-10-04 16:06:44 -04:00
|
|
|
set +o xtrace
|
|
|
|
|
2012-12-21 11:03:37 -06:00
|
|
|
|
2012-10-04 16:06:44 -04:00
|
|
|
# Defaults
|
|
|
|
# --------
|
|
|
|
|
|
|
|
# Set up default directories
|
2014-11-18 07:13:35 -05:00
|
|
|
GITDIR["tempest-lib"]=$DEST/tempest-lib
|
2014-11-01 01:37:45 +01:00
|
|
|
|
2012-10-04 16:06:44 -04:00
|
|
|
TEMPEST_DIR=$DEST/tempest
|
2014-01-22 18:09:32 -07:00
|
|
|
TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
|
|
|
|
TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
|
2013-07-29 16:15:53 -04:00
|
|
|
TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2012-12-21 11:03:37 -06:00
|
|
|
NOVA_SOURCE_DIR=$DEST/nova
|
|
|
|
|
2013-05-09 09:24:49 +02:00
|
|
|
BUILD_INTERVAL=1
|
2014-07-18 11:34:33 -03:00
|
|
|
|
|
|
|
# This is the timeout that tempest will wait for a VM to change state,
|
|
|
|
# spawn, delete, etc.
|
|
|
|
# The default is set to 196 seconds.
|
|
|
|
BUILD_TIMEOUT=${BUILD_TIMEOUT:-196}
|
2012-10-04 16:06:44 -04:00
|
|
|
|
2015-02-10 14:32:39 -08:00
|
|
|
# This must be False on stable branches, as master tempest
|
|
|
|
# deps do not match stable branch deps. Set this to True to
|
2015-03-28 08:20:50 -05:00
|
|
|
# have tempest installed in DevStack by default.
|
2015-03-16 10:37:51 -04:00
|
|
|
INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"}
|
2015-02-10 14:32:39 -08:00
|
|
|
|
2014-03-19 10:42:01 +01:00
|
|
|
BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-${CIRROS_VERSION}"
|
2015-02-04 12:45:50 +01:00
|
|
|
BOTO_CONF=/etc/boto.cfg
|
2013-01-07 15:51:32 +01:00
|
|
|
|
2014-01-22 18:09:32 -07:00
|
|
|
# Cinder/Volume variables
|
|
|
|
TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
|
2014-10-14 18:53:53 -04:00
|
|
|
TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source"
|
|
|
|
TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-$TEMPEST_DEFAULT_VOLUME_VENDOR}
|
|
|
|
TEMPEST_DEFAULT_STORAGE_PROTOCOL="iSCSI"
|
|
|
|
TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-$TEMPEST_DEFAULT_STORAGE_PROTOCOL}
|
2013-04-08 15:38:03 -05:00
|
|
|
|
2014-02-19 22:19:24 -08:00
|
|
|
# Neutron/Network variables
|
2014-12-04 19:38:15 -05:00
|
|
|
IPV6_ENABLED=$(trueorfalse True IPV6_ENABLED)
|
|
|
|
IPV6_SUBNET_ATTRIBUTES_ENABLED=$(trueorfalse True IPV6_SUBNET_ATTRIBUTES_ENABLED)
|
2014-02-19 22:19:24 -08:00
|
|
|
|
2015-08-09 20:30:39 -04:00
|
|
|
# Do we want to make a configuration where Tempest has admin on
|
|
|
|
# the cloud. We don't always want to so that we can ensure Tempest
|
|
|
|
# would work on a public cloud.
|
|
|
|
TEMPEST_HAS_ADMIN=$(trueorfalse True TEMPEST_HAS_ADMIN)
|
|
|
|
|
|
|
|
# Credential provider configuration option variables
|
|
|
|
TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-$TEMPEST_HAS_ADMIN}
|
2015-08-24 21:17:37 -04:00
|
|
|
TEMPEST_USE_TEST_ACCOUNTS=$(trueorfalse False TEMPEST_USE_TEST_ACCOUNTS)
|
2015-08-09 20:30:39 -04:00
|
|
|
|
|
|
|
# The number of workers tempest is expected to be run with. This is used for
|
|
|
|
# generating a accounts.yaml for running with test-accounts. This is also the
|
|
|
|
# same variable that devstack-gate uses to specify the number of workers that
|
|
|
|
# it will run tempest with
|
|
|
|
TEMPEST_CONCURRENCY=${TEMPEST_CONCURRENCY:-$(nproc)}
|
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
|
2013-04-08 15:38:03 -05:00
|
|
|
# Functions
|
|
|
|
# ---------
|
2012-10-04 16:06:44 -04:00
|
|
|
|
2014-10-05 01:36:34 +02:00
|
|
|
# remove_disabled_extension - removes disabled extensions from the list of extensions
|
|
|
|
# to test for a given service
|
|
|
|
function remove_disabled_extensions {
|
|
|
|
local extensions_list=$1
|
|
|
|
shift
|
|
|
|
local disabled_exts=$*
|
2015-04-13 09:55:06 +09:00
|
|
|
remove_disabled_services "$extensions_list" "$disabled_exts"
|
2014-10-05 01:36:34 +02:00
|
|
|
}
|
|
|
|
|
2012-10-04 16:06:44 -04:00
|
|
|
# configure_tempest() - Set config files, create data dirs, etc
|
2014-02-21 15:35:08 +11:00
|
|
|
function configure_tempest {
|
2015-02-10 14:32:39 -08:00
|
|
|
if [[ "$INSTALL_TEMPEST" == "True" ]]; then
|
|
|
|
setup_develop $TEMPEST_DIR
|
|
|
|
else
|
|
|
|
# install testr since its used to process tempest logs
|
2015-04-08 09:06:49 -04:00
|
|
|
pip_install_gr testrepository
|
2015-02-10 14:32:39 -08:00
|
|
|
fi
|
2015-02-06 19:29:23 -08:00
|
|
|
|
2012-12-07 14:20:51 +01:00
|
|
|
local image_lines
|
|
|
|
local images
|
|
|
|
local num_images
|
|
|
|
local image_uuid
|
|
|
|
local image_uuid_alt
|
|
|
|
local password
|
|
|
|
local line
|
|
|
|
local flavors
|
2013-11-20 17:51:50 -08:00
|
|
|
local available_flavors
|
2012-12-07 14:20:51 +01:00
|
|
|
local flavors_ref
|
|
|
|
local flavor_lines
|
2012-12-10 10:40:01 +00:00
|
|
|
local public_network_id
|
2012-12-19 03:59:20 +00:00
|
|
|
local public_router_id
|
2013-01-07 15:51:32 +01:00
|
|
|
local boto_instance_type="m1.tiny"
|
2013-10-21 09:27:18 +02:00
|
|
|
local ssh_connect_method="fixed"
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2012-12-21 11:03:37 -06:00
|
|
|
# Save IFS
|
2012-12-05 20:03:40 +01:00
|
|
|
ifs=$IFS
|
|
|
|
|
|
|
|
# Glance should already contain images to be used in tempest
|
|
|
|
# testing. Here we simply look for images stored in Glance
|
|
|
|
# and set the appropriate variables for use in the tempest config
|
|
|
|
# We ignore ramdisk and kernel images, look for the default image
|
2012-12-07 14:20:51 +01:00
|
|
|
# ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the
|
|
|
|
# first image returned and set ``image_uuid_alt`` to the second,
|
2012-12-05 20:03:40 +01:00
|
|
|
# if there is more than one returned...
|
|
|
|
# ... Also ensure we only take active images, so we don't get snapshots in process
|
2012-12-21 02:10:45 -05:00
|
|
|
declare -a images
|
|
|
|
|
2014-08-19 16:48:14 +02:00
|
|
|
if is_service_enabled glance; then
|
|
|
|
while read -r IMAGE_NAME IMAGE_UUID; do
|
|
|
|
if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
|
|
|
|
image_uuid="$IMAGE_UUID"
|
|
|
|
image_uuid_alt="$IMAGE_UUID"
|
2012-12-21 02:10:45 -05:00
|
|
|
fi
|
2014-08-19 16:48:14 +02:00
|
|
|
images+=($IMAGE_UUID)
|
2015-05-13 09:26:15 +00:00
|
|
|
done < <(openstack image list --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
|
2014-08-19 16:48:14 +02:00
|
|
|
|
|
|
|
case "${#images[*]}" in
|
|
|
|
0)
|
|
|
|
echo "Found no valid images to use!"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
if [ -z "$image_uuid" ]; then
|
|
|
|
image_uuid=${images[0]}
|
|
|
|
image_uuid_alt=${images[0]}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if [ -z "$image_uuid" ]; then
|
|
|
|
image_uuid=${images[0]}
|
|
|
|
image_uuid_alt=${images[1]}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2015-07-31 10:38:50 -04:00
|
|
|
# (Re)create ``tempest.conf``
|
|
|
|
# Create every time because the image UUIDS are going to change
|
2015-03-16 13:52:19 -05:00
|
|
|
sudo install -d -o $STACK_USER $TEMPEST_CONFIG_DIR
|
2015-07-31 10:38:50 -04:00
|
|
|
rm -f $TEMPEST_CONFIG
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2012-12-07 14:20:51 +01:00
|
|
|
password=${ADMIN_PASSWORD:-secrete}
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# See ``lib/keystone`` where these users and tenants are set up
|
2014-03-05 13:38:19 +00:00
|
|
|
ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
|
|
|
|
ADMIN_TENANT_NAME=${ADMIN_TENANT_NAME:-admin}
|
2014-04-08 13:43:56 +01:00
|
|
|
ADMIN_DOMAIN_NAME=${ADMIN_DOMAIN_NAME:-Default}
|
2014-03-05 13:38:19 +00:00
|
|
|
TEMPEST_USERNAME=${TEMPEST_USERNAME:-demo}
|
|
|
|
TEMPEST_TENANT_NAME=${TEMPEST_TENANT_NAME:-demo}
|
2012-12-05 20:03:40 +01:00
|
|
|
ALT_USERNAME=${ALT_USERNAME:-alt_demo}
|
|
|
|
ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo}
|
2014-05-23 09:16:52 +00:00
|
|
|
ADMIN_TENANT_ID=$(openstack project list | awk "/ admin / { print \$2 }")
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2014-08-19 16:48:14 +02:00
|
|
|
if is_service_enabled nova; then
|
2015-03-28 08:20:50 -05:00
|
|
|
# If ``DEFAULT_INSTANCE_TYPE`` is not declared, use the new behavior
|
|
|
|
# Tempest creates its own instance types
|
2015-11-26 10:08:36 -06:00
|
|
|
available_flavors=$(nova flavor-list)
|
2014-08-19 16:48:14 +02:00
|
|
|
if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
|
|
|
|
if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then
|
2015-09-23 12:55:02 -05:00
|
|
|
nova flavor-create m1.nano 42 64 0 1
|
2013-12-06 17:56:24 -02:00
|
|
|
fi
|
2014-08-19 16:48:14 +02:00
|
|
|
flavor_ref=42
|
|
|
|
boto_instance_type=m1.nano
|
|
|
|
if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then
|
2015-09-23 12:55:02 -05:00
|
|
|
nova flavor-create m1.micro 84 128 0 1
|
2013-12-06 17:56:24 -02:00
|
|
|
fi
|
2014-08-19 16:48:14 +02:00
|
|
|
flavor_ref_alt=84
|
|
|
|
else
|
2015-03-28 08:20:50 -05:00
|
|
|
# Check Nova for existing flavors, if ``DEFAULT_INSTANCE_TYPE`` is set use it.
|
2014-08-19 16:48:14 +02:00
|
|
|
boto_instance_type=$DEFAULT_INSTANCE_TYPE
|
|
|
|
IFS=$'\r\n'
|
|
|
|
flavors=""
|
2015-11-26 10:08:36 -06:00
|
|
|
for line in $available_flavors; do
|
2014-08-19 16:48:14 +02:00
|
|
|
f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }")
|
|
|
|
flavors="$flavors $f"
|
|
|
|
done
|
|
|
|
|
2015-11-26 10:08:36 -06:00
|
|
|
for line in $available_flavors; do
|
2014-08-19 16:48:14 +02:00
|
|
|
flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`"
|
|
|
|
done
|
|
|
|
|
|
|
|
IFS=" "
|
|
|
|
flavors=($flavors)
|
|
|
|
num_flavors=${#flavors[*]}
|
|
|
|
echo "Found $num_flavors flavors"
|
|
|
|
if [[ $num_flavors -eq 0 ]]; then
|
|
|
|
echo "Found no valid flavors to use!"
|
|
|
|
exit 1
|
2013-06-06 08:46:04 -04:00
|
|
|
fi
|
2014-08-19 16:48:14 +02:00
|
|
|
flavor_ref=${flavors[0]}
|
|
|
|
flavor_ref_alt=$flavor_ref
|
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# Ensure ``flavor_ref`` and ``flavor_ref_alt`` have different values.
|
|
|
|
# Some resize instance in tempest tests depends on this.
|
2014-08-19 16:48:14 +02:00
|
|
|
for f in ${flavors[@]:1}; do
|
|
|
|
if [[ $f -ne $flavor_ref ]]; then
|
|
|
|
flavor_ref_alt=$f
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2012-12-05 20:03:40 +01:00
|
|
|
fi
|
|
|
|
|
2015-10-22 22:25:45 +02:00
|
|
|
if ! is_service_enabled n-net; then
|
|
|
|
ssh_connect_method="floating"
|
2012-12-10 10:40:01 +00:00
|
|
|
fi
|
|
|
|
|
2013-10-21 09:27:18 +02:00
|
|
|
ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
|
|
|
|
|
2013-11-14 20:02:47 +00:00
|
|
|
if [ "$Q_L3_ENABLED" = "True" ]; then
|
2013-07-06 23:29:39 -04:00
|
|
|
public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \
|
2012-12-10 10:40:01 +00:00
|
|
|
awk '{print $2}')
|
|
|
|
fi
|
|
|
|
|
2015-05-29 06:04:47 +00:00
|
|
|
EC2_URL=$(get_endpoint_url ec2 public || true)
|
2015-04-02 22:39:59 +03:00
|
|
|
if [[ -z $EC2_URL ]]; then
|
|
|
|
EC2_URL="$EC2_SERVICE_PROTOCOL://$SERVICE_HOST:8773/"
|
|
|
|
fi
|
2015-05-29 06:04:47 +00:00
|
|
|
S3_URL=$(get_endpoint_url s3 public || true)
|
2015-04-02 22:39:59 +03:00
|
|
|
if [[ -z $S3_URL ]]; then
|
|
|
|
S3_URL="http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
|
|
|
|
fi
|
|
|
|
|
2014-11-21 21:55:09 +09:00
|
|
|
iniset $TEMPEST_CONFIG DEFAULT use_syslog $SYSLOG
|
2015-03-28 08:20:50 -05:00
|
|
|
|
2013-07-26 15:22:44 -04:00
|
|
|
# Oslo
|
2015-03-06 15:24:22 -08:00
|
|
|
iniset $TEMPEST_CONFIG oslo_concurrency lock_path $TEMPEST_STATE_PATH
|
2013-07-29 16:15:53 -04:00
|
|
|
mkdir -p $TEMPEST_STATE_PATH
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG DEFAULT use_stderr False
|
|
|
|
iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log
|
|
|
|
iniset $TEMPEST_CONFIG DEFAULT debug True
|
2013-07-26 15:22:44 -04:00
|
|
|
|
2012-12-05 20:03:40 +01:00
|
|
|
# Timeouts
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT
|
|
|
|
iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT
|
|
|
|
iniset $TEMPEST_CONFIG boto build_timeout $BUILD_TIMEOUT
|
|
|
|
iniset $TEMPEST_CONFIG boto http_socket_timeout 5
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2013-01-19 19:20:49 +01:00
|
|
|
# Identity
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
|
2014-12-18 01:35:35 -05:00
|
|
|
iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_URI_V3"
|
2014-03-05 13:38:19 +00:00
|
|
|
iniset $TEMPEST_CONFIG identity username $TEMPEST_USERNAME
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG identity password "$password"
|
2014-03-05 13:38:19 +00:00
|
|
|
iniset $TEMPEST_CONFIG identity tenant_name $TEMPEST_TENANT_NAME
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME
|
|
|
|
iniset $TEMPEST_CONFIG identity alt_password "$password"
|
|
|
|
iniset $TEMPEST_CONFIG identity alt_tenant_name $ALT_TENANT_NAME
|
2015-03-23 15:51:54 -04:00
|
|
|
if [[ "$TEMPEST_HAS_ADMIN" == "True" ]]; then
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_password "$password"
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME
|
|
|
|
fi
|
2015-05-03 14:54:45 -03:00
|
|
|
if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
|
|
|
|
# Only Identity v3 is available; then skip Identity API v2 tests
|
2015-08-13 10:40:57 +10:00
|
|
|
iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 False
|
2015-05-03 14:54:45 -03:00
|
|
|
# In addition, use v3 auth tokens for running all Tempest tests
|
|
|
|
iniset $TEMPEST_CONFIG identity auth_version v3
|
|
|
|
else
|
|
|
|
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
|
|
|
|
fi
|
|
|
|
|
2015-02-10 14:15:35 -05:00
|
|
|
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
|
|
|
|
iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
|
|
|
|
fi
|
2013-01-19 19:20:49 +01:00
|
|
|
|
2013-06-13 14:23:37 -04:00
|
|
|
# Image
|
2015-03-28 08:20:50 -05:00
|
|
|
# We want to be able to override this variable in the gate to avoid
|
|
|
|
# doing an external HTTP fetch for this test.
|
2013-06-13 14:23:37 -04:00
|
|
|
if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
|
2013-06-13 14:23:37 -04:00
|
|
|
fi
|
|
|
|
|
2015-06-01 10:29:59 -04:00
|
|
|
# Image Features
|
|
|
|
iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image True
|
|
|
|
|
2013-01-19 19:20:49 +01:00
|
|
|
# Compute
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
|
|
|
|
iniset $TEMPEST_CONFIG compute network_for_ssh $PRIVATE_NETWORK_NAME
|
|
|
|
iniset $TEMPEST_CONFIG compute ip_version_for_ssh 4
|
|
|
|
iniset $TEMPEST_CONFIG compute ssh_timeout $BUILD_TIMEOUT
|
|
|
|
iniset $TEMPEST_CONFIG compute image_ref $image_uuid
|
|
|
|
iniset $TEMPEST_CONFIG compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
|
|
|
|
iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt
|
2014-10-03 22:48:58 +04:00
|
|
|
iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${ALT_INSTANCE_USER:-cirros}
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref
|
|
|
|
iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt
|
|
|
|
iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method
|
2015-05-15 12:38:09 -04:00
|
|
|
if [[ ! $(is_service_enabled n-cell) && ! $(is_service_enabled neutron) ]]; then
|
2015-04-10 22:20:07 +00:00
|
|
|
iniset $TEMPEST_CONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME
|
|
|
|
fi
|
2013-01-19 19:20:49 +01:00
|
|
|
|
2015-09-01 12:45:28 -04:00
|
|
|
# Set the service catalog entry for Tempest to run on. Typically
|
|
|
|
# used to try different compute API version targets. The tempest
|
|
|
|
# default if 'compute', which is typically valid, so only set this
|
|
|
|
# if you want to change it.
|
|
|
|
if [[ -n "$TEMPEST_COMPUTE_TYPE" ]]; then
|
|
|
|
iniset $TEMPEST_CONFIG compute catalog_type $TEMPEST_COMPUTE_TYPE
|
|
|
|
fi
|
|
|
|
|
2014-03-20 16:54:58 -04:00
|
|
|
# Compute Features
|
2015-03-28 08:20:50 -05:00
|
|
|
# Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints
|
2014-10-05 01:36:34 +02:00
|
|
|
# NOTE(mtreinish): This must be done after auth settings are added to the tempest config
|
2015-10-07 14:06:26 +11:00
|
|
|
local tmp_cfg_file
|
|
|
|
tmp_cfg_file=$(mktemp)
|
2015-02-04 15:28:18 -08:00
|
|
|
cd $TEMPEST_DIR
|
2015-03-18 10:48:47 +00:00
|
|
|
tox -revenv -- verify-tempest-config -uro $tmp_cfg_file
|
2014-10-05 01:36:34 +02:00
|
|
|
|
|
|
|
local compute_api_extensions=${COMPUTE_API_EXTENSIONS:-"all"}
|
|
|
|
if [[ ! -z "$DISABLE_COMPUTE_API_EXTENSIONS" ]]; then
|
|
|
|
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
|
|
|
compute_api_extensions=${COMPUTE_API_EXTENSIONS:-$(iniget $tmp_cfg_file compute-feature-enabled api_extensions | tr -d " ")}
|
|
|
|
# Remove disabled extensions
|
|
|
|
compute_api_extensions=$(remove_disabled_extensions $compute_api_extensions $DISABLE_COMPUTE_API_EXTENSIONS)
|
|
|
|
fi
|
|
|
|
|
2015-11-19 10:01:14 +09:00
|
|
|
# Set the microversion range for compute tests.
|
|
|
|
# This is used to run the Nova microversions tests.
|
|
|
|
# Setting [None, latest] range of microversion which allow Tempest to run all microversions tests.
|
|
|
|
# NOTE- To avoid microversion tests failure on stable branch, we need to change "tempest_compute_max_microversion"
|
|
|
|
# for stable branch on each release which should be changed from "latest" to max supported version of that release.
|
|
|
|
local tempest_compute_min_microversion=${TEMPEST_COMPUTE_MIN_MICROVERSION:-None}
|
|
|
|
local tempest_compute_max_microversion=${TEMPEST_COMPUTE_MAX_MICROVERSION:-"latest"}
|
|
|
|
# Reset microversions to None where v2.0 is running which does not support microversion.
|
|
|
|
# Both "None" means no microversion testing.
|
|
|
|
if [[ "$TEMPEST_COMPUTE_TYPE" == "compute_legacy" ]]; then
|
|
|
|
tempest_compute_min_microversion=None
|
|
|
|
tempest_compute_max_microversion=None
|
|
|
|
fi
|
|
|
|
if [ "$tempest_compute_min_microversion" == "None" ]; then
|
|
|
|
inicomment $TEMPEST_CONFIG compute-feature-enabled min_microversion
|
|
|
|
else
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled min_microversion $tempest_compute_min_microversion
|
|
|
|
fi
|
|
|
|
if [ "$tempest_compute_max_microversion" == "None" ]; then
|
|
|
|
inicomment $TEMPEST_CONFIG compute-feature-enabled max_microversion
|
|
|
|
else
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled max_microversion $tempest_compute_max_microversion
|
|
|
|
fi
|
|
|
|
|
2014-03-20 16:54:58 -04:00
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled resize True
|
2014-03-20 21:18:42 +00:00
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled live_migration ${LIVE_MIGRATION_AVAILABLE:-False}
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
|
2014-10-05 01:36:34 +02:00
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions $compute_api_extensions
|
2015-03-14 06:13:26 -07:00
|
|
|
# TODO(mriedem): Remove the preserve_ports flag when Juno is end of life.
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled preserve_ports True
|
2015-04-10 08:42:22 +01:00
|
|
|
# TODO(gilliard): Remove the live_migrate_paused_instances flag when Juno is end of life.
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled live_migrate_paused_instances True
|
2015-06-20 14:48:00 -07:00
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled attach_encrypted_volume ${ATTACH_ENCRYPTED_VOLUME_AVAILABLE:-True}
|
2015-07-09 13:25:04 -07:00
|
|
|
# TODO(mriedem): Remove this when kilo-eol happens since the
|
|
|
|
# neutron.allow_duplicate_networks option was removed from nova in Liberty
|
|
|
|
# and is now the default behavior.
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled allow_duplicate_networks ${NOVA_ALLOW_DUPLICATE_NETWORKS:-True}
|
2015-09-02 14:27:58 +00:00
|
|
|
if is_service_enabled n-cell; then
|
|
|
|
# Cells doesn't support shelving/unshelving
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
|
2015-10-15 12:51:13 -07:00
|
|
|
# Cells doesn't support hot-plugging virtual interfaces.
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
|
2015-11-06 10:26:14 -08:00
|
|
|
|
|
|
|
if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
|
|
|
|
# Cells supports resize but does not currently work with devstack
|
|
|
|
# because of the custom flavors created for Tempest runs which are
|
|
|
|
# not in the cells database.
|
|
|
|
# TODO(mriedem): work on adding a nova-manage command to sync
|
|
|
|
# flavors into the cells database.
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled resize False
|
|
|
|
fi
|
2015-09-02 14:27:58 +00:00
|
|
|
fi
|
2014-03-20 16:54:58 -04:00
|
|
|
|
2015-08-18 06:57:18 -04:00
|
|
|
# Network
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG network api_version 2.0
|
2015-10-22 22:25:45 +02:00
|
|
|
iniset $TEMPEST_CONFIG network tenant_networks_reachable false
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG network public_network_id "$public_network_id"
|
|
|
|
iniset $TEMPEST_CONFIG network public_router_id "$public_router_id"
|
|
|
|
iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE"
|
2014-03-03 22:48:31 -05:00
|
|
|
iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED"
|
2014-05-15 10:24:31 -04:00
|
|
|
iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED"
|
2014-10-05 01:36:34 +02:00
|
|
|
|
|
|
|
local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
|
|
|
|
if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
|
|
|
|
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
|
|
|
network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
|
|
|
|
# Remove disabled extensions
|
|
|
|
network_api_extensions=$(remove_disabled_extensions $network_api_extensions $DISABLE_NETWORK_API_EXTENSIONS)
|
|
|
|
fi
|
|
|
|
iniset $TEMPEST_CONFIG network-feature-enabled api_extensions $network_api_extensions
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2013-06-04 05:33:52 +02:00
|
|
|
# boto
|
2015-04-02 22:39:59 +03:00
|
|
|
iniset $TEMPEST_CONFIG boto ec2_url "$EC2_URL"
|
|
|
|
iniset $TEMPEST_CONFIG boto s3_url "$S3_URL"
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH"
|
2014-07-10 16:55:49 -03:00
|
|
|
iniset $TEMPEST_CONFIG boto ari_manifest cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-initrd.manifest.xml
|
|
|
|
iniset $TEMPEST_CONFIG boto ami_manifest cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-blank.img.manifest.xml
|
|
|
|
iniset $TEMPEST_CONFIG boto aki_manifest cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-vmlinuz.manifest.xml
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type"
|
|
|
|
iniset $TEMPEST_CONFIG boto http_socket_timeout 30
|
2012-12-05 20:03:40 +01:00
|
|
|
|
2014-04-03 11:28:01 -04:00
|
|
|
# Orchestration Tests
|
|
|
|
if is_service_enabled heat; then
|
|
|
|
if [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then
|
2014-12-15 20:02:08 +02:00
|
|
|
iniset $TEMPEST_CONFIG orchestration image_ref $(basename "${HEAT_CFN_IMAGE_URL%.*}")
|
2014-04-03 11:28:01 -04:00
|
|
|
fi
|
2014-06-13 16:09:37 +02:00
|
|
|
# build a specialized heat flavor
|
2014-04-03 11:28:01 -04:00
|
|
|
available_flavors=$(nova flavor-list)
|
|
|
|
if [[ ! ( $available_flavors =~ 'm1.heat' ) ]]; then
|
2014-06-13 16:09:37 +02:00
|
|
|
nova flavor-create m1.heat 451 512 0 1
|
2014-04-03 11:28:01 -04:00
|
|
|
fi
|
|
|
|
iniset $TEMPEST_CONFIG orchestration instance_type "m1.heat"
|
|
|
|
iniset $TEMPEST_CONFIG orchestration build_timeout 900
|
2015-03-18 22:03:01 -04:00
|
|
|
iniset $TEMPEST_CONFIG orchestration stack_owner_role "_member_"
|
2013-07-19 10:34:24 +12:00
|
|
|
fi
|
|
|
|
|
2013-07-02 12:26:31 -05:00
|
|
|
# Scenario
|
2015-04-02 11:08:24 -04:00
|
|
|
SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES/images/cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-uec}
|
|
|
|
iniset $TEMPEST_CONFIG scenario img_dir $SCENARIO_IMAGE_DIR
|
2014-07-10 16:55:49 -03:00
|
|
|
iniset $TEMPEST_CONFIG scenario ami_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-blank.img"
|
|
|
|
iniset $TEMPEST_CONFIG scenario ari_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-initrd"
|
|
|
|
iniset $TEMPEST_CONFIG scenario aki_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-vmlinuz"
|
2015-04-02 11:08:24 -04:00
|
|
|
iniset $TEMPEST_CONFIG scenario img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-disk.img"
|
2013-07-02 12:26:31 -05:00
|
|
|
|
2013-08-26 17:00:05 -04:00
|
|
|
# Large Ops Number
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
|
2013-08-26 17:00:05 -04:00
|
|
|
|
2014-05-29 18:48:10 +04:00
|
|
|
# Telemetry
|
2015-03-16 16:33:01 -04:00
|
|
|
iniset $TEMPEST_CONFIG telemetry-feature-enabled events "True"
|
2014-05-29 18:48:10 +04:00
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# Object Store
|
2014-10-05 01:36:34 +02:00
|
|
|
local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
|
|
|
|
if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
|
|
|
|
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
|
|
|
object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
|
|
|
|
# Remove disabled extensions
|
|
|
|
object_storage_api_extensions=$(remove_disabled_extensions $object_storage_api_extensions $DISABLE_STORAGE_API_EXTENSIONS)
|
|
|
|
fi
|
|
|
|
iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis $object_storage_api_extensions
|
2014-08-21 12:11:10 -07:00
|
|
|
|
2015-08-03 13:48:12 +00:00
|
|
|
# Validation
|
|
|
|
iniset $TEMPEST_CONFIG validation run_validation ${TEMPEST_RUN_VALIDATION:-False}
|
|
|
|
|
2013-06-04 05:33:52 +02:00
|
|
|
# Volume
|
2015-06-11 13:09:37 -04:00
|
|
|
# TODO(dkranz): Remove the bootable flag when Juno is end of life.
|
|
|
|
iniset $TEMPEST_CONFIG volume-feature-enabled bootable True
|
2015-08-13 18:10:00 +02:00
|
|
|
# TODO(jordanP): Remove the extend_with_snapshot flag when Juno is end of life.
|
|
|
|
iniset $TEMPEST_CONFIG volume-feature-enabled extend_with_snapshot True
|
2015-10-20 19:07:04 +03:00
|
|
|
# TODO(obutenko): Remove the incremental_backup_force flag when Kilo and Juno is end of life.
|
|
|
|
iniset $TEMPEST_CONFIG volume-feature-enabled incremental_backup_force True
|
2015-06-11 13:09:37 -04:00
|
|
|
|
2014-10-05 01:36:34 +02:00
|
|
|
local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
|
|
|
|
if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
|
|
|
|
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
|
|
|
volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
|
2015-08-18 06:57:18 -04:00
|
|
|
# Remove disabled extensions
|
2014-10-05 01:36:34 +02:00
|
|
|
volume_api_extensions=$(remove_disabled_extensions $volume_api_extensions $DISABLE_VOLUME_API_EXTENSIONS)
|
|
|
|
fi
|
|
|
|
iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions $volume_api_extensions
|
|
|
|
|
2014-02-20 16:43:49 +01:00
|
|
|
if ! is_service_enabled c-bak; then
|
|
|
|
iniset $TEMPEST_CONFIG volume-feature-enabled backup False
|
2013-09-10 02:51:26 +02:00
|
|
|
fi
|
2014-10-16 06:30:28 +00:00
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# Using ``CINDER_ENABLED_BACKENDS``
|
2014-10-16 06:30:28 +00:00
|
|
|
if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
|
2014-02-04 20:58:00 +00:00
|
|
|
iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
|
2014-10-16 06:30:28 +00:00
|
|
|
local i=1
|
|
|
|
local be
|
|
|
|
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
|
|
|
|
local be_name=${be##*:}
|
|
|
|
iniset $TEMPEST_CONFIG volume "backend${i}_name" "$be_name"
|
|
|
|
i=$(( i + 1 ))
|
|
|
|
done
|
2014-01-22 18:09:32 -07:00
|
|
|
fi
|
|
|
|
|
2014-10-14 18:53:53 -04:00
|
|
|
if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
|
2014-10-22 16:22:47 -07:00
|
|
|
"$TEMPEST_VOLUME_VENDOR" != "$TEMPEST_DEFAULT_VOLUME_VENDOR" ]; then
|
2014-07-29 14:42:27 -06:00
|
|
|
iniset $TEMPEST_CONFIG volume vendor_name "$TEMPEST_VOLUME_VENDOR"
|
2014-10-14 18:53:53 -04:00
|
|
|
fi
|
|
|
|
if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
|
2014-12-04 14:09:16 +01:00
|
|
|
"$TEMPEST_STORAGE_PROTOCOL" != "$TEMPEST_DEFAULT_STORAGE_PROTOCOL" ]; then
|
|
|
|
iniset $TEMPEST_CONFIG volume storage_protocol "$TEMPEST_STORAGE_PROTOCOL"
|
2013-06-04 05:33:52 +02:00
|
|
|
fi
|
|
|
|
|
2013-07-29 11:22:08 +01:00
|
|
|
# Dashboard
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/"
|
|
|
|
iniset $TEMPEST_CONFIG dashboard login_url "http://$SERVICE_HOST/auth/login/"
|
2013-07-29 11:22:08 +01:00
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# CLI
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR
|
2013-06-25 14:11:48 +10:00
|
|
|
|
2014-04-03 11:13:13 -07:00
|
|
|
# Baremetal
|
|
|
|
if [ "$VIRT_DRIVER" = "ironic" ] ; then
|
|
|
|
iniset $TEMPEST_CONFIG baremetal driver_enabled True
|
2015-12-15 18:16:35 +00:00
|
|
|
iniset $TEMPEST_CONFIG baremetal deploy_timeout $BUILD_TIMEOUT
|
2015-04-29 13:36:52 +03:00
|
|
|
iniset $TEMPEST_CONFIG baremetal deploy_img_dir $FILES
|
|
|
|
iniset $TEMPEST_CONFIG baremetal node_uuid $IRONIC_NODE_UUID
|
2014-07-24 10:06:18 -04:00
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled console_output False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled live_migration False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled pause False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled resize False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
|
2014-08-13 07:03:58 -04:00
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
|
2014-04-03 11:13:13 -07:00
|
|
|
fi
|
|
|
|
|
2015-01-05 16:36:42 -06:00
|
|
|
# Libvirt-LXC
|
|
|
|
if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled resize False
|
2015-10-28 09:50:01 -07:00
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
|
2015-01-05 16:36:42 -06:00
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
|
|
|
|
fi
|
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# ``service_available``
|
2015-08-26 09:38:37 -04:00
|
|
|
#
|
|
|
|
# this tempest service list needs to be all the services that
|
|
|
|
# tempest supports, otherwise we can have an erroneous set of
|
|
|
|
# defaults (something defaulting true in Tempest, but not listed here).
|
2015-04-30 08:54:15 +02:00
|
|
|
TEMPEST_SERVICES="key,glance,nova,neutron,cinder,swift,heat,ceilometer,horizon,sahara,ironic,trove"
|
2014-01-29 16:22:11 -06:00
|
|
|
for service in ${TEMPEST_SERVICES//,/ }; do
|
2013-07-23 17:25:39 -04:00
|
|
|
if is_service_enabled $service ; then
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG service_available $service "True"
|
2013-07-23 17:25:39 -04:00
|
|
|
else
|
2014-01-22 18:09:32 -07:00
|
|
|
iniset $TEMPEST_CONFIG service_available $service "False"
|
2013-07-23 17:25:39 -04:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2015-10-28 09:50:01 -07:00
|
|
|
if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
|
|
|
|
# libvirt-lxc does not support boot from volume or attaching volumes
|
|
|
|
# so basically anything with cinder is out of the question.
|
|
|
|
iniset $TEMPEST_CONFIG service_available cinder "False"
|
|
|
|
fi
|
|
|
|
|
2015-02-10 14:15:35 -05:00
|
|
|
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
|
2015-03-28 08:20:50 -05:00
|
|
|
# Use the ``BOTO_CONFIG`` environment variable to point to this file
|
2015-07-22 06:08:09 +10:00
|
|
|
iniset -sudo $BOTO_CONF Boto ca_certificates_file $SSL_BUNDLE_FILE
|
2014-11-17 01:16:22 -05:00
|
|
|
sudo chown $STACK_USER $BOTO_CONF
|
|
|
|
fi
|
|
|
|
|
2015-08-09 20:30:39 -04:00
|
|
|
# Auth
|
|
|
|
iniset $TEMPEST_CONFIG auth tempest_roles "Member"
|
|
|
|
if [[ $TEMPEST_USE_TEST_ACCOUNTS == "True" ]]; then
|
|
|
|
if [[ $TEMPEST_HAS_ADMIN == "True" ]]; then
|
|
|
|
tempest-account-generator -c $TEMPEST_CONFIG --os-username $ADMIN_USERNAME --os-password $ADMIN_PASSWORD --os-tenant-name $ADMIN_TENANT_NAME -r $TEMPEST_CONCURRENCY --with-admin etc/accounts.yaml
|
2015-08-25 10:01:39 -04:00
|
|
|
else
|
2015-08-09 20:30:39 -04:00
|
|
|
tempest-account-generator -c $TEMPEST_CONFIG --os-username $ADMIN_USERNAME --os-password $ADMIN_PASSWORD --os-tenant-name $ADMIN_TENANT_NAME -r $TEMPEST_CONCURRENCY etc/accounts.yaml
|
|
|
|
fi
|
|
|
|
iniset $TEMPEST_CONFIG auth allow_tenant_isolation False
|
|
|
|
iniset $TEMPEST_CONFIG auth test_accounts_file "etc/accounts.yaml"
|
2015-10-22 10:05:00 -04:00
|
|
|
elif [[ $TEMPEST_HAS_ADMIN == "False" ]]; then
|
|
|
|
iniset $TEMPEST_CONFIG auth allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
|
|
|
|
|
2015-08-09 20:30:39 -04:00
|
|
|
else
|
|
|
|
iniset $TEMPEST_CONFIG auth allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
|
|
|
|
fi
|
2015-10-22 10:05:00 -04:00
|
|
|
|
2012-12-05 20:03:40 +01:00
|
|
|
# Restore IFS
|
|
|
|
IFS=$ifs
|
2012-10-04 16:06:44 -04:00
|
|
|
}
|
|
|
|
|
2014-03-03 14:31:29 -06:00
|
|
|
# create_tempest_accounts() - Set up common required tempest accounts
|
|
|
|
|
|
|
|
# Project User Roles
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
# alt_demo alt_demo Member
|
|
|
|
|
|
|
|
function create_tempest_accounts {
|
|
|
|
if is_service_enabled tempest; then
|
|
|
|
# Tempest has some tests that validate various authorization checks
|
|
|
|
# between two regular users in separate tenants
|
2015-05-28 23:36:15 +00:00
|
|
|
get_or_create_project alt_demo default
|
2015-05-29 01:08:53 +00:00
|
|
|
get_or_create_user alt_demo "$ADMIN_PASSWORD" "default" "alt_demo@example.com"
|
2015-02-10 18:19:57 +11:00
|
|
|
get_or_add_user_project_role Member alt_demo alt_demo
|
2014-03-03 14:31:29 -06:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# install_tempest_lib() - Collect source, prepare, and install ``tempest-lib``
|
2014-09-08 14:01:21 -04:00
|
|
|
function install_tempest_lib {
|
2014-11-18 07:13:35 -05:00
|
|
|
if use_library_from_git "tempest-lib"; then
|
|
|
|
git_clone_by_name "tempest-lib"
|
2014-11-20 17:23:04 -05:00
|
|
|
setup_dev_lib "tempest-lib"
|
2015-03-28 08:20:50 -05:00
|
|
|
# NOTE(mtreinish) For testing ``tempest-lib`` from git with Tempest we need to
|
|
|
|
# put the git version of ``tempest-lib`` in the Tempest job's tox venv
|
2015-02-18 19:01:20 -05:00
|
|
|
export PIP_VIRTUAL_ENV=${PROJECT_VENV["tempest"]}
|
|
|
|
setup_dev_lib "tempest-lib"
|
|
|
|
unset PIP_VIRTUAL_ENV
|
2014-11-01 01:37:45 +01:00
|
|
|
fi
|
2014-09-08 14:01:21 -04:00
|
|
|
}
|
|
|
|
|
2012-10-04 16:06:44 -04:00
|
|
|
# install_tempest() - Collect source and prepare
|
2014-02-21 15:35:08 +11:00
|
|
|
function install_tempest {
|
2012-10-04 16:06:44 -04:00
|
|
|
git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
|
2014-08-19 22:37:10 -07:00
|
|
|
pip_install tox
|
2015-02-18 19:01:20 -05:00
|
|
|
pushd $TEMPEST_DIR
|
|
|
|
tox --notest -efull
|
|
|
|
PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/full
|
|
|
|
install_tempest_lib
|
|
|
|
popd
|
2012-10-04 16:06:44 -04:00
|
|
|
}
|
|
|
|
|
2015-03-28 08:20:50 -05:00
|
|
|
# init_tempest() - Initialize EC2 images
|
2014-02-21 15:35:08 +11:00
|
|
|
function init_tempest {
|
2014-07-10 16:55:49 -03:00
|
|
|
local base_image_name=cirros-${CIRROS_VERSION}-${CIRROS_ARCH}
|
|
|
|
# /opt/stack/devstack/files/images/cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-uec
|
2013-01-21 06:50:33 +01:00
|
|
|
local image_dir="$FILES/images/${base_image_name}-uec"
|
2013-01-07 15:51:32 +01:00
|
|
|
local kernel="$image_dir/${base_image_name}-vmlinuz"
|
|
|
|
local ramdisk="$image_dir/${base_image_name}-initrd"
|
|
|
|
local disk_image="$image_dir/${base_image_name}-blank.img"
|
2014-08-19 16:48:14 +02:00
|
|
|
if is_service_enabled nova; then
|
2015-03-28 08:20:50 -05:00
|
|
|
# If the CirrOS uec downloaded and the system is UEC capable
|
2014-08-19 16:48:14 +02:00
|
|
|
if [ -f "$kernel" -a -f "$ramdisk" -a -f "$disk_image" -a "$VIRT_DRIVER" != "openvz" \
|
|
|
|
-a \( "$LIBVIRT_TYPE" != "lxc" -o "$VIRT_DRIVER" != "libvirt" \) ]; then
|
|
|
|
echo "Prepare aki/ari/ami Images"
|
|
|
|
mkdir -p $BOTO_MATERIALS_PATH
|
|
|
|
( #new namespace
|
2015-03-30 20:49:22 +03:00
|
|
|
# euca2ools should be installed to call euca-* commands
|
|
|
|
is_package_installed euca2ools || install_package euca2ools
|
2014-08-19 16:48:14 +02:00
|
|
|
# tenant:demo ; user: demo
|
|
|
|
source $TOP_DIR/accrc/demo/demo
|
|
|
|
euca-bundle-image -r ${CIRROS_ARCH} -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH"
|
|
|
|
euca-bundle-image -r ${CIRROS_ARCH} -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH"
|
|
|
|
euca-bundle-image -r ${CIRROS_ARCH} -i "$disk_image" -d "$BOTO_MATERIALS_PATH"
|
|
|
|
) 2>&1 </dev/null | cat
|
|
|
|
else
|
|
|
|
echo "Boto materials are not prepared"
|
|
|
|
fi
|
2013-01-07 15:51:32 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2012-10-04 16:06:44 -04:00
|
|
|
# Restore xtrace
|
2015-10-13 11:03:03 +11:00
|
|
|
$_XTRACE_TEMPEST
|
2013-03-29 14:34:53 -04:00
|
|
|
|
2013-10-24 11:27:02 +01:00
|
|
|
# Tell emacs to use shell-script-mode
|
|
|
|
## Local variables:
|
|
|
|
## mode: shell-script
|
|
|
|
## End:
|