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_USE_NAMESPACE``
|
|
|
|
|
# - ``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
|
|
|
|
#
|
|
|
|
|
# - ``ALT_*`` (similar vars exists in keystone_data.sh)
|
|
|
|
|
# - ``LIVE_MIGRATION_AVAILABLE``
|
|
|
|
|
# - ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION``
|
|
|
|
|
# - ``DEFAULT_INSTANCE_TYPE``
|
|
|
|
|
# - ``DEFAULT_INSTANCE_USER``
|
|
|
|
|
# - ``CINDER_MULTI_LVM_BACKEND``
|
|
|
|
|
#
|
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
|
|
|
|
|
XTRACE=$(set +o | grep xtrace)
|
|
|
|
|
set +o xtrace
|
|
|
|
|
|
2012-12-21 11:03:37 -06:00
|
|
|
|
|
2012-10-04 16:06:44 -04:00
|
|
|
|
# Defaults
|
|
|
|
|
# --------
|
|
|
|
|
|
|
|
|
|
# Set up default directories
|
|
|
|
|
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}
|
2014-09-08 14:01:21 -04:00
|
|
|
|
TEMPEST_LIB_DIR=$DEST/tempest-lib
|
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
|
|
|
|
|
2012-12-21 11:03:37 -06:00
|
|
|
|
|
2014-03-19 10:42:01 +01:00
|
|
|
|
BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-${CIRROS_VERSION}"
|
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}
|
|
|
|
|
TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-"Open Source"}
|
|
|
|
|
TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-iSCSI}
|
2013-04-08 15:38:03 -05:00
|
|
|
|
|
2014-02-19 22:19:24 -08:00
|
|
|
|
# Neutron/Network variables
|
|
|
|
|
IPV6_ENABLED=$(trueorfalse True $IPV6_ENABLED)
|
2014-06-03 09:03:45 +05:30
|
|
|
|
IPV6_SUBNET_ATTRIBUTES_ENABLED=$(trueorfalse True $IPV6_SUBNET_ATTRIBUTES_ENABLED)
|
2014-02-19 22:19:24 -08:00
|
|
|
|
|
2013-04-08 15:38:03 -05:00
|
|
|
|
# Functions
|
|
|
|
|
# ---------
|
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 {
|
2013-01-28 16:24:14 -05:00
|
|
|
|
setup_develop $TEMPEST_DIR
|
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
|
2012-12-10 10:40:01 +00:00
|
|
|
|
local tenant_networks_reachable
|
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
|
|
|
|
|
|
|
|
|
|
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-05 20:03:40 +01:00
|
|
|
|
fi
|
2012-12-21 02:10:45 -05:00
|
|
|
|
images+=($IMAGE_UUID)
|
2014-08-02 20:32:31 -04:00
|
|
|
|
# TODO(stevemar): update this command to use openstackclient's `openstack image list`
|
|
|
|
|
# when it supports listing by status.
|
2012-12-21 02:10:45 -05:00
|
|
|
|
done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
|
|
|
|
|
|
|
|
|
|
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
|
2012-12-05 20:03:40 +01:00
|
|
|
|
|
|
|
|
|
# Create tempest.conf from tempest.conf.sample
|
|
|
|
|
# copy every time, because the image UUIDS are going to change
|
2014-02-24 15:40:42 +11:00
|
|
|
|
if [[ ! -d $TEMPEST_CONFIG_DIR ]]; then
|
|
|
|
|
sudo mkdir -p $TEMPEST_CONFIG_DIR
|
|
|
|
|
fi
|
|
|
|
|
sudo chown $STACK_USER $TEMPEST_CONFIG_DIR
|
|
|
|
|
cp $TEMPEST_DIR/etc/tempest.conf.sample $TEMPEST_CONFIG
|
|
|
|
|
chmod 644 $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
|
|
|
|
|
2014-03-05 13:38:19 +00:00
|
|
|
|
# See files/keystone_data.sh and stack.sh where admin, demo and alt_demo
|
|
|
|
|
# user and tenant are set up...
|
|
|
|
|
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
|
|
|
|
|
2013-01-12 17:31:26 +01:00
|
|
|
|
# If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior
|
|
|
|
|
# Tempest creates instane types for himself
|
|
|
|
|
if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
|
2013-11-20 17:51:50 -08:00
|
|
|
|
available_flavors=$(nova flavor-list)
|
|
|
|
|
if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then
|
2013-12-06 17:56:24 -02:00
|
|
|
|
if is_arch "ppc64"; then
|
|
|
|
|
# qemu needs at least 128MB of memory to boot on ppc64
|
|
|
|
|
nova flavor-create m1.nano 42 128 0 1
|
|
|
|
|
else
|
|
|
|
|
nova flavor-create m1.nano 42 64 0 1
|
|
|
|
|
fi
|
2013-11-20 17:51:50 -08:00
|
|
|
|
fi
|
2013-01-12 17:31:26 +01:00
|
|
|
|
flavor_ref=42
|
2013-01-07 15:51:32 +01:00
|
|
|
|
boto_instance_type=m1.nano
|
2013-11-20 17:51:50 -08:00
|
|
|
|
if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then
|
2013-12-06 17:56:24 -02:00
|
|
|
|
if is_arch "ppc64"; then
|
|
|
|
|
nova flavor-create m1.micro 84 256 0 1
|
|
|
|
|
else
|
|
|
|
|
nova flavor-create m1.micro 84 128 0 1
|
|
|
|
|
fi
|
2013-11-20 17:51:50 -08:00
|
|
|
|
fi
|
2013-01-12 17:31:26 +01:00
|
|
|
|
flavor_ref_alt=84
|
|
|
|
|
else
|
|
|
|
|
# Check Nova for existing flavors and, if set, look for the
|
|
|
|
|
# ``DEFAULT_INSTANCE_TYPE`` and use that.
|
2013-01-07 15:51:32 +01:00
|
|
|
|
boto_instance_type=$DEFAULT_INSTANCE_TYPE
|
2013-01-12 17:31:26 +01:00
|
|
|
|
flavor_lines=`nova flavor-list`
|
|
|
|
|
IFS=$'\r\n'
|
|
|
|
|
flavors=""
|
2012-12-12 17:09:57 -06:00
|
|
|
|
for line in $flavor_lines; do
|
|
|
|
|
f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }")
|
|
|
|
|
flavors="$flavors $f"
|
|
|
|
|
done
|
2013-01-12 17:31:26 +01:00
|
|
|
|
|
|
|
|
|
for line in $flavor_lines; do
|
|
|
|
|
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
|
|
|
|
|
fi
|
|
|
|
|
flavor_ref=${flavors[0]}
|
|
|
|
|
flavor_ref_alt=$flavor_ref
|
2013-06-06 08:46:04 -04:00
|
|
|
|
|
|
|
|
|
# ensure flavor_ref and flavor_ref_alt have different values
|
|
|
|
|
# some resize instance in tempest tests depends on this.
|
|
|
|
|
for f in ${flavors[@]:1}; do
|
|
|
|
|
if [[ $f -ne $flavor_ref ]]; then
|
|
|
|
|
flavor_ref_alt=$f
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
done
|
2012-12-05 20:03:40 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2012-12-10 10:40:01 +00:00
|
|
|
|
if [ "$Q_USE_NAMESPACE" != "False" ]; then
|
|
|
|
|
tenant_networks_reachable=false
|
2013-12-03 06:17:16 +01:00
|
|
|
|
if ! is_service_enabled n-net; then
|
|
|
|
|
ssh_connect_method="floating"
|
|
|
|
|
fi
|
2012-12-10 10:40:01 +00:00
|
|
|
|
else
|
|
|
|
|
tenant_networks_reachable=true
|
|
|
|
|
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}')
|
2012-12-19 03:59:20 +00:00
|
|
|
|
if [ "$Q_USE_NAMESPACE" == "False" ]; then
|
|
|
|
|
# If namespaces are disabled, devstack will create a single
|
|
|
|
|
# public router that tempest should be configured to use.
|
2013-07-06 23:29:39 -04:00
|
|
|
|
public_router_id=$(neutron router-list | awk "/ $Q_ROUTER_NAME / \
|
2013-10-22 08:47:11 -04:00
|
|
|
|
{ print \$2 }")
|
2012-12-19 03:59:20 +00:00
|
|
|
|
fi
|
2012-12-10 10:40:01 +00:00
|
|
|
|
fi
|
|
|
|
|
|
2013-07-26 15:22:44 -04:00
|
|
|
|
# Oslo
|
2014-01-22 18:09:32 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG DEFAULT 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-02-06 17:06:00 +00:00
|
|
|
|
iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/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
|
2014-03-05 13:38:19 +00:00
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME
|
2014-01-22 18:09:32 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_password "$password"
|
2014-03-05 13:38:19 +00:00
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME
|
2014-05-23 09:16:52 +00:00
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID
|
2014-04-08 13:43:56 +01:00
|
|
|
|
iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME
|
2014-03-06 23:23:01 +00:00
|
|
|
|
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
|
2013-01-19 19:20:49 +01:00
|
|
|
|
|
2013-06-13 14:23:37 -04:00
|
|
|
|
# Image
|
|
|
|
|
# for the gate we want to be able to override this variable so we aren't
|
|
|
|
|
# doing an HTTP fetch over the wide internet for this test
|
|
|
|
|
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
|
|
|
|
|
|
2013-01-19 19:20:49 +01:00
|
|
|
|
# Compute
|
2014-01-22 18:09:32 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
|
|
|
|
|
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
|
|
|
|
|
iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
|
|
|
|
|
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
|
2013-01-19 19:20:49 +01:00
|
|
|
|
|
2014-03-20 16:54:58 -04:00
|
|
|
|
# Compute Features
|
2014-06-06 17:22:04 -04:00
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled api_v3 ${TEMPEST_NOVA_API_V3:-False}
|
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-08-21 12:11:10 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions ${COMPUTE_API_EXTENSIONS:-"all"}
|
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-disabled api_extensions ${DISABLE_COMPUTE_API_EXTENSIONS}
|
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-enabled api_v3_extensions ${COMPUTE_API_V3_EXTENSIONS:-"all"}
|
|
|
|
|
iniset $TEMPEST_CONFIG compute-feature-disabled api_v3_extensions ${DISABLE_COMPUTE_API_V3_EXTENSIONS}
|
2014-03-20 16:54:58 -04:00
|
|
|
|
|
2013-06-04 05:33:52 +02:00
|
|
|
|
# Compute admin
|
2014-03-07 05:58:18 -05:00
|
|
|
|
iniset $TEMPEST_CONFIG "compute-admin" username $ADMIN_USERNAME
|
|
|
|
|
iniset $TEMPEST_CONFIG "compute-admin" password "$password"
|
|
|
|
|
iniset $TEMPEST_CONFIG "compute-admin" tenant_name $ADMIN_TENANT_NAME
|
2012-12-05 20:03:40 +01:00
|
|
|
|
|
2014-02-19 22:19:24 -08:00
|
|
|
|
# Network
|
2014-01-22 18:09:32 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG network api_version 2.0
|
|
|
|
|
iniset $TEMPEST_CONFIG network tenant_networks_reachable "$tenant_networks_reachable"
|
|
|
|
|
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-08-21 12:11:10 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG network-feature-enabled api_extensions ${NETWORK_API_EXTENSIONS:-"all"}
|
|
|
|
|
iniset $TEMPEST_CONFIG network-feature-disabled api_extensions ${DISABLE_NETWORK_API_EXTENSIONS}
|
2012-12-05 20:03:40 +01:00
|
|
|
|
|
2013-06-04 05:33:52 +02:00
|
|
|
|
# boto
|
2014-01-22 18:09:32 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
|
|
|
|
|
iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
|
|
|
|
|
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
|
|
|
|
|
iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
|
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
|
|
|
|
|
iniset $TEMPEST_CONFIG orchestration image_ref $(basename "$HEAT_CFN_IMAGE_URL" ".qcow2")
|
|
|
|
|
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
|
2013-07-19 10:34:24 +12:00
|
|
|
|
fi
|
|
|
|
|
|
2013-07-02 12:26:31 -05:00
|
|
|
|
# Scenario
|
2014-07-10 16:55:49 -03:00
|
|
|
|
iniset $TEMPEST_CONFIG scenario img_dir "$FILES/images/cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-uec"
|
|
|
|
|
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"
|
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
|
|
|
|
|
# Ceilometer API optimization happened in juno that allows to run more tests in tempest.
|
|
|
|
|
# Once Tempest retires support for icehouse this flag can be removed.
|
|
|
|
|
iniset $TEMPEST_CONFIG telemetry too_slow_to_test "False"
|
|
|
|
|
|
2014-08-21 12:11:10 -07:00
|
|
|
|
# Object storage
|
|
|
|
|
iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis ${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
|
|
|
|
|
iniset $TEMPEST_CONFIG object-storage-feature-disabled discoverable_apis ${OBJECT_STORAGE_DISABLE_API_EXTENSIONS}
|
|
|
|
|
|
2013-06-04 05:33:52 +02:00
|
|
|
|
# Volume
|
2014-08-21 12:11:10 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions ${VOLUME_API_EXTENSIONS:-"all"}
|
|
|
|
|
iniset $TEMPEST_CONFIG volume-feature-disabled api_extensions ${DISABLE_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
|
2013-06-04 05:33:52 +02:00
|
|
|
|
CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
|
2013-06-17 13:23:44 +10:00
|
|
|
|
if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
|
2014-02-04 20:58:00 +00:00
|
|
|
|
iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
|
2014-01-22 18:09:32 -07:00
|
|
|
|
iniset $TEMPEST_CONFIG volume backend1_name "LVM_iSCSI"
|
|
|
|
|
iniset $TEMPEST_CONFIG volume backend2_name "LVM_iSCSI_2"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ $TEMPEST_VOLUME_DRIVER != "default" ]; then
|
2014-07-29 14:42:27 -06:00
|
|
|
|
iniset $TEMPEST_CONFIG volume vendor_name "$TEMPEST_VOLUME_VENDOR"
|
2014-01-22 18:09:32 -07:00
|
|
|
|
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
|
|
|
|
|
2013-06-25 14:11:48 +10: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
|
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
|
|
|
|
|
|
2013-07-23 17:25:39 -04:00
|
|
|
|
# service_available
|
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
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
# Migrated from keystone_data.sh
|
|
|
|
|
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
|
2014-02-28 14:15:19 +01:00
|
|
|
|
get_or_create_project alt_demo
|
|
|
|
|
get_or_create_user alt_demo "$ADMIN_PASSWORD" alt_demo "alt_demo@example.com"
|
|
|
|
|
get_or_add_user_role Member alt_demo alt_demo
|
2014-03-03 14:31:29 -06:00
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-08 14:01:21 -04:00
|
|
|
|
# install_tempest_lib() - Collect source, prepare, and install tempest-lib
|
|
|
|
|
function install_tempest_lib {
|
|
|
|
|
git_clone $TEMPEST_LIB_REPO $TEMPEST_LIB_DIR $TEMPEST_LIB_BRANCH
|
|
|
|
|
setup_develop $TEMPEST_LIB_DIR
|
|
|
|
|
}
|
|
|
|
|
|
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 {
|
2014-09-08 14:01:21 -04:00
|
|
|
|
install_tempest_lib
|
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
|
2012-10-04 16:06:44 -04:00
|
|
|
|
}
|
|
|
|
|
|
2013-01-07 15:51:32 +01: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"
|
|
|
|
|
# if the cirros uec downloaded and the system is uec capable
|
|
|
|
|
if [ -f "$kernel" -a -f "$ramdisk" -a -f "$disk_image" -a "$VIRT_DRIVER" != "openvz" \
|
2013-10-22 08:47:11 -04:00
|
|
|
|
-a \( "$LIBVIRT_TYPE" != "lxc" -o "$VIRT_DRIVER" != "libvirt" \) ]; then
|
|
|
|
|
echo "Prepare aki/ari/ami Images"
|
2014-08-13 14:30:28 +10:00
|
|
|
|
mkdir -p $BOTO_MATERIALS_PATH
|
2013-10-22 08:47:11 -04:00
|
|
|
|
( #new namespace
|
|
|
|
|
# tenant:demo ; user: demo
|
|
|
|
|
source $TOP_DIR/accrc/demo/demo
|
2014-07-10 16:55:49 -03:00
|
|
|
|
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"
|
2013-10-22 08:47:11 -04:00
|
|
|
|
) 2>&1 </dev/null | cat
|
2013-01-07 15:51:32 +01:00
|
|
|
|
else
|
|
|
|
|
echo "Boto materials are not prepared"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-04 16:06:44 -04:00
|
|
|
|
# Restore xtrace
|
|
|
|
|
$XTRACE
|
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:
|