Merge "Move tempest config to lib/tempest"
This commit is contained in:
commit
b9520212f5
208
lib/tempest
208
lib/tempest
@ -2,31 +2,49 @@
|
|||||||
|
|
||||||
# Dependencies:
|
# Dependencies:
|
||||||
# ``functions`` file
|
# ``functions`` file
|
||||||
# ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined
|
# ``lib/nova`` service is runing
|
||||||
# <list other global vars that are assumed to be defined>
|
# <list other global vars that are assumed to be defined>
|
||||||
|
# - DEST
|
||||||
|
# - ADMIN_PASSWORD
|
||||||
|
# - OS_USERNAME
|
||||||
|
# - DEFAULT_IMAGE_NAME
|
||||||
|
# - S3_SERVICE_PORT
|
||||||
|
# - SERVICE_HOST
|
||||||
|
# - BASE_SQL_CONN ``lib/database`` declares
|
||||||
|
# Optional Dependencies:
|
||||||
|
# IDENTITY_*
|
||||||
|
# ALT_* (similar vars exists in keystone_data.sh)
|
||||||
|
# IMAGE_*
|
||||||
|
# LIVE_MIGRATION_AVAILABLE
|
||||||
|
# DEFAULT_INSTANCE_TYPE
|
||||||
|
# DEFAULT_INSTANCE_USER
|
||||||
|
# USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION
|
||||||
# ``stack.sh`` calls the entry points in this order:
|
# ``stack.sh`` calls the entry points in this order:
|
||||||
#
|
#
|
||||||
# install_XXXX
|
# install_tempest
|
||||||
# configure_XXXX
|
# configure_tempest
|
||||||
# init_XXXX
|
# init_tempest
|
||||||
# start_XXXX
|
## start_tempest
|
||||||
# stop_XXXX
|
## stop_tempest
|
||||||
# cleanup_XXXX
|
## cleanup_tempest
|
||||||
|
|
||||||
# Save trace setting
|
# Save trace setting
|
||||||
XTRACE=$(set +o | grep xtrace)
|
XTRACE=$(set +o | grep xtrace)
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
|
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
# --------
|
# --------
|
||||||
|
|
||||||
# <define global variables here that belong to this project>
|
# <define global variables here that belong to this project>
|
||||||
|
|
||||||
# Set up default directories
|
# Set up default directories
|
||||||
|
NOVA_SOURCE_DIR=$DEST/nova
|
||||||
TEMPEST_DIR=$DEST/tempest
|
TEMPEST_DIR=$DEST/tempest
|
||||||
TEMPEST_CONF_DIR=$DEST/tempest/etc
|
TEMPEST_CONF_DIR=$TEMPEST_DIR/etc
|
||||||
|
TEMPEST_CONF=$TEMPEST_CONF_DIR/tempest.conf
|
||||||
|
|
||||||
|
BUILD_INTERVAL=3
|
||||||
|
BUILD_TIMEOUT=400
|
||||||
|
|
||||||
# Entry Points
|
# Entry Points
|
||||||
# ------------
|
# ------------
|
||||||
@ -34,15 +52,168 @@ TEMPEST_CONF_DIR=$DEST/tempest/etc
|
|||||||
|
|
||||||
# configure_tempest() - Set config files, create data dirs, etc
|
# configure_tempest() - Set config files, create data dirs, etc
|
||||||
function configure_tempest() {
|
function configure_tempest() {
|
||||||
|
local IMAGE_LINES
|
||||||
|
local IMAGES
|
||||||
|
local NUM_IMAGES
|
||||||
|
local IMAGE_UUID
|
||||||
|
local IMAGE_UUID_ALT
|
||||||
|
local errexit
|
||||||
|
|
||||||
|
#TODO(afazekas):
|
||||||
# sudo python setup.py deploy
|
# sudo python setup.py deploy
|
||||||
# iniset $tempest_CONF ...
|
|
||||||
# This function intentionally left blank
|
# This function exits on an error so that errors don't compound and you see
|
||||||
#
|
# only the first error that occured.
|
||||||
# TODO(sdague) actually move the guts of configure tempest
|
errexit=$(set +o | grep errexit)
|
||||||
# into this function
|
set -o errexit
|
||||||
cd tools
|
|
||||||
./configure_tempest.sh
|
#Save IFS
|
||||||
cd ..
|
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
|
||||||
|
# DEFAULT_IMAGE_NAME. If not found, we set the IMAGE_UUID to the
|
||||||
|
# first image returned and set IMAGE_UUID_ALT to the second,
|
||||||
|
# if there is more than one returned...
|
||||||
|
# ... Also ensure we only take active images, so we don't get snapshots in process
|
||||||
|
IMAGE_LINES=`glance image-list`
|
||||||
|
IFS=$'\n\r'
|
||||||
|
IMAGES=""
|
||||||
|
for line in $IMAGE_LINES; do
|
||||||
|
if [ -z $DEFAULT_IMAGE_NAME ]; then
|
||||||
|
IMAGES="$IMAGES `echo $line | grep -v "^\(ID\|+--\)" | grep -v "\(aki\|ari\)" | grep 'active' | cut -d' ' -f2`"
|
||||||
|
else
|
||||||
|
IMAGES="$IMAGES `echo $line | grep -v "^\(ID\|+--\)" | grep -v "\(aki\|ari\)" | grep 'active' | grep "$DEFAULT_IMAGE_NAME" | cut -d' ' -f2`"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Create array of image UUIDs...
|
||||||
|
IFS=" "
|
||||||
|
IMAGES=($IMAGES)
|
||||||
|
NUM_IMAGES=${#IMAGES[*]}
|
||||||
|
echo "Found $NUM_IMAGES images"
|
||||||
|
if [[ $NUM_IMAGES -eq 0 ]]; then
|
||||||
|
echo "Found no valid images to use!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
IMAGE_UUID=${IMAGES[0]}
|
||||||
|
IMAGE_UUID_ALT=$IMAGE_UUID
|
||||||
|
if [[ $NUM_IMAGES -gt 1 ]]; then
|
||||||
|
IMAGE_UUID_ALT=${IMAGES[1]}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create tempest.conf from tempest.conf.sample
|
||||||
|
# copy every time, because the image UUIDS are going to change
|
||||||
|
cp $TEMPEST_CONF.sample $TEMPEST_CONF
|
||||||
|
|
||||||
|
IDENTITY_USE_SSL=${IDENTITY_USE_SSL:-False}
|
||||||
|
IDENTITY_HOST=${IDENTITY_HOST:-127.0.0.1}
|
||||||
|
IDENTITY_PORT=${IDENTITY_PORT:-5000}
|
||||||
|
# TODO(jaypipes): This is dumb and needs to be removed
|
||||||
|
# from the Tempest configuration file entirely...
|
||||||
|
IDENTITY_PATH=${IDENTITY_PATH:-tokens}
|
||||||
|
|
||||||
|
PASSWORD=${ADMIN_PASSWORD:-secrete}
|
||||||
|
|
||||||
|
# See files/keystone_data.sh where alt_demo user
|
||||||
|
# and tenant are set up...
|
||||||
|
ALT_USERNAME=${ALT_USERNAME:-alt_demo}
|
||||||
|
ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo}
|
||||||
|
|
||||||
|
# Check Nova for existing flavors and, if set, look for the
|
||||||
|
# DEFAULT_INSTANCE_TYPE and use that. Otherwise, just use the first flavor.
|
||||||
|
FLAVOR_LINES=`nova flavor-list`
|
||||||
|
IFS="$(echo -e "\n\r")"
|
||||||
|
FLAVORS=""
|
||||||
|
for line in $FLAVOR_LINES; do
|
||||||
|
if [ -z $DEFAULT_INSTANCE_TYPE ]; then
|
||||||
|
FLAVORS="$FLAVORS `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`"
|
||||||
|
else
|
||||||
|
FLAVORS="$FLAVORS `echo $line | grep -v "^\(|\s*ID\|+--\)" | grep "$DEFAULT_INSTANCE_TYPE" | cut -d' ' -f2`"
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
if [[ $NUM_FLAVORS -gt 1 ]]; then
|
||||||
|
FLAVOR_REF_ALT=${FLAVORS[1]}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Timeouts
|
||||||
|
iniset $TEMPEST_CONF compute build_timeout $BUILD_TIMEOUT
|
||||||
|
iniset $TEMPEST_CONF volume build_timeout $BUILD_TIMEOUT
|
||||||
|
iniset $TEMPEST_CONF boto build_timeout $BUILD_TIMEOUT
|
||||||
|
iniset $TEMPEST_CONF compute build_interval $BUILD_INTERVAL
|
||||||
|
iniset $TEMPEST_CONF volume build_interval $BUILD_INTERVAL
|
||||||
|
iniset $TEMPEST_CONF boto build_interval $BUILD_INTERVAL
|
||||||
|
iniset $TEMPEST_CONF boto http_socket_timeout 5
|
||||||
|
|
||||||
|
iniset $TEMPEST_CONF identity use_ssl $IDENTITY_USE_SSL
|
||||||
|
iniset $TEMPEST_CONF identity host $IDENTITY_HOST
|
||||||
|
iniset $TEMPEST_CONF identity port $IDENTITY_PORT
|
||||||
|
iniset $TEMPEST_CONF identity path $IDENTITY_PATH
|
||||||
|
|
||||||
|
iniset $TEMPEST_CONF compute password "$PASSWORD"
|
||||||
|
iniset $TEMPEST_CONF compute alt_username $ALT_USERNAME
|
||||||
|
iniset $TEMPEST_CONF compute alt_password "$PASSWORD"
|
||||||
|
iniset $TEMPEST_CONF compute alt_tenant_name $ALT_TENANT_NAME
|
||||||
|
iniset $TEMPEST_CONF compute resize_available False
|
||||||
|
iniset $TEMPEST_CONF compute change_password_available False
|
||||||
|
iniset $TEMPEST_CONF compute compute_log_level ERROR
|
||||||
|
#Skip until #1074039 is fixed
|
||||||
|
iniset $TEMPEST_CONF compute run_ssh False
|
||||||
|
iniset $TEMPEST_CONF compute ssh_user ${DEFAULT_INSTANCE_USER:-$OS_USERNAME}
|
||||||
|
iniset $TEMPEST_CONF compute network_for_ssh private
|
||||||
|
iniset $TEMPEST_CONF compute ip_version_for_ssh 4
|
||||||
|
iniset $TEMPEST_CONF compute ssh_timeout 4
|
||||||
|
iniset $TEMPEST_CONF compute image_ref $IMAGE_UUID
|
||||||
|
iniset $TEMPEST_CONF compute image_ref_alt $IMAGE_UUID_ALT
|
||||||
|
iniset $TEMPEST_CONF compute flavor_ref $FLAVOR_REF
|
||||||
|
iniset $TEMPEST_CONF compute flavor_ref_alt $FLAVOR_REF_ALT
|
||||||
|
iniset $TEMPEST_CONF compute source_dir $NOVA_SOURCE_DIR
|
||||||
|
iniset $TEMPEST_CONF compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False}
|
||||||
|
iniset $TEMPEST_CONF compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
|
||||||
|
# Inherited behavior, might be wrong
|
||||||
|
iniset $TEMPEST_CONF compute bin_dir $NOVA_BIN_DIR
|
||||||
|
# TODO(jaypipes): Create the key file here... right now, no whitebox
|
||||||
|
# tests actually use a key.
|
||||||
|
iniset $TEMPEST_CONF compute path_to_private_key $TEMPEST_DIR/id_rsa
|
||||||
|
iniset $TEMPEST_CONF compute db_uri $BASE_SQL_CONN/nova
|
||||||
|
|
||||||
|
# image
|
||||||
|
iniset $TEMPEST_CONF image host ${IMAGE_HOST:-127.0.0.1}
|
||||||
|
iniset $TEMPEST_CONF image port ${IMAGE_PORT:-9292}
|
||||||
|
iniset $TEMPEST_CONF image password "$PASSWORD"
|
||||||
|
|
||||||
|
# identity-admin
|
||||||
|
iniset $TEMPEST_CONF "identity-admin" password "$PASSWORD"
|
||||||
|
|
||||||
|
# compute admin
|
||||||
|
iniset $TEMPEST_CONF "compute-admin" password "$PASSWORD"
|
||||||
|
|
||||||
|
# network
|
||||||
|
iniset $TEMPEST_CONF network api_version 2.0
|
||||||
|
|
||||||
|
#boto
|
||||||
|
iniset $TEMPEST_CONF boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
|
||||||
|
iniset $TEMPEST_CONF boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
|
||||||
|
|
||||||
|
echo "Created tempest configuration file:"
|
||||||
|
cat $TEMPEST_CONF
|
||||||
|
|
||||||
|
# Restore IFS
|
||||||
|
IFS=$ifs
|
||||||
|
#Restore errexit
|
||||||
|
$errexit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -55,6 +226,5 @@ function install_tempest() {
|
|||||||
pip_install -r $TEMPEST_DIR/tools/pip-requires
|
pip_install -r $TEMPEST_DIR/tools/pip-requires
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Restore xtrace
|
# Restore xtrace
|
||||||
$XTRACE
|
$XTRACE
|
||||||
|
4
stack.sh
4
stack.sh
@ -1712,7 +1712,11 @@ fi
|
|||||||
# Configure Tempest last to ensure that the runtime configuration of
|
# Configure Tempest last to ensure that the runtime configuration of
|
||||||
# the various OpenStack services can be queried.
|
# the various OpenStack services can be queried.
|
||||||
if is_service_enabled tempest; then
|
if is_service_enabled tempest; then
|
||||||
|
echo_summary "Configuring Tempest"
|
||||||
configure_tempest
|
configure_tempest
|
||||||
|
echo '**************************************************'
|
||||||
|
echo_summary "Finished Configuring Tempest"
|
||||||
|
echo '**************************************************'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,309 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
|
||||||
# **configure_tempest.sh**
|
|
||||||
|
|
||||||
# Build a tempest configuration file from devstack
|
echo "$0 is scheduled for delete!!" >&2
|
||||||
|
|
||||||
echo "**************************************************"
|
|
||||||
echo "Configuring Tempest"
|
|
||||||
echo "**************************************************"
|
|
||||||
|
|
||||||
# This script exits on an error so that errors don't compound and you see
|
|
||||||
# only the first error that occured.
|
|
||||||
set -o errexit
|
|
||||||
|
|
||||||
# Print the commands being run so that we can see the command that triggers
|
|
||||||
# an error. It is also useful for following allowing as the install occurs.
|
|
||||||
set -o xtrace
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "$0 - Build tempest.conf"
|
|
||||||
echo ""
|
|
||||||
echo "Usage: $0"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$1" = "-h" ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Keep track of the current directory
|
|
||||||
TOOLS_DIR=$(cd $(dirname "$0") && pwd)
|
|
||||||
TOP_DIR=$(cd $TOOLS_DIR/..; pwd)
|
|
||||||
|
|
||||||
# Import common functions
|
|
||||||
. $TOP_DIR/functions
|
|
||||||
|
|
||||||
# Abort if localrc is not set
|
|
||||||
if [ ! -e $TOP_DIR/localrc ]; then
|
|
||||||
echo "You must have a localrc with necessary basic configuration defined before proceeding."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Abort if openrc is not set
|
|
||||||
if [ ! -e $TOP_DIR/openrc ]; then
|
|
||||||
echo "You must have an openrc with ALL necessary passwords and credentials defined before proceeding."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Source params
|
|
||||||
source $TOP_DIR/lib/database
|
|
||||||
source $TOP_DIR/openrc
|
|
||||||
|
|
||||||
# Where Openstack code lives
|
|
||||||
DEST=${DEST:-/opt/stack}
|
|
||||||
|
|
||||||
NOVA_SOURCE_DIR=$DEST/nova
|
|
||||||
TEMPEST_DIR=$DEST/tempest
|
|
||||||
CONFIG_DIR=$TEMPEST_DIR/etc
|
|
||||||
TEMPEST_CONF=$CONFIG_DIR/tempest.conf
|
|
||||||
|
|
||||||
DATABASE_TYPE=${DATABASE_TYPE:-mysql}
|
|
||||||
initialize_database_backends
|
|
||||||
|
|
||||||
# Use the GUEST_IP unless an explicit IP is set by ``HOST_IP``
|
|
||||||
HOST_IP=${HOST_IP:-$GUEST_IP}
|
|
||||||
# Use the first IP if HOST_IP still is not set
|
|
||||||
if [ ! -n "$HOST_IP" ]; then
|
|
||||||
HOST_IP=`LC_ALL=C /sbin/ifconfig | grep -m 1 'inet addr:'| cut -d: -f2 | awk '{print $1}'`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 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
|
|
||||||
# DEFAULT_IMAGE_NAME. If not found, we set the IMAGE_UUID to the
|
|
||||||
# first image returned and set IMAGE_UUID_ALT to the second,
|
|
||||||
# if there is more than one returned...
|
|
||||||
# ... Also ensure we only take active images, so we don't get snapshots in process
|
|
||||||
IMAGE_LINES=`glance image-list`
|
|
||||||
IFS="$(echo -e "\n\r")"
|
|
||||||
IMAGES=""
|
|
||||||
for line in $IMAGE_LINES; do
|
|
||||||
if [ -z $DEFAULT_IMAGE_NAME ]; then
|
|
||||||
IMAGES="$IMAGES `echo $line | grep -v "^\(ID\|+--\)" | grep -v "\(aki\|ari\)" | grep 'active' | cut -d' ' -f2`"
|
|
||||||
else
|
|
||||||
IMAGES="$IMAGES `echo $line | grep -v "^\(ID\|+--\)" | grep -v "\(aki\|ari\)" | grep 'active' | grep "$DEFAULT_IMAGE_NAME" | cut -d' ' -f2`"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# Create array of image UUIDs...
|
|
||||||
IFS=" "
|
|
||||||
IMAGES=($IMAGES)
|
|
||||||
NUM_IMAGES=${#IMAGES[*]}
|
|
||||||
echo "Found $NUM_IMAGES images"
|
|
||||||
if [[ $NUM_IMAGES -eq 0 ]]; then
|
|
||||||
echo "Found no valid images to use!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
IMAGE_UUID=${IMAGES[0]}
|
|
||||||
IMAGE_UUID_ALT=$IMAGE_UUID
|
|
||||||
if [[ $NUM_IMAGES -gt 1 ]]; then
|
|
||||||
IMAGE_UUID_ALT=${IMAGES[1]}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create tempest.conf from tempest.conf.tpl
|
|
||||||
# copy every time, because the image UUIDS are going to change
|
|
||||||
cp $TEMPEST_CONF.tpl $TEMPEST_CONF
|
|
||||||
|
|
||||||
COMPUTE_ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
|
|
||||||
COMPUTE_ADMIN_PASSWORD=${ADMIN_PASSWORD:-secrete}
|
|
||||||
COMPUTE_ADMIN_TENANT_NAME=${ADMIN_TENANT:-admin}
|
|
||||||
|
|
||||||
IDENTITY_ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
|
|
||||||
IDENTITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-secrete}
|
|
||||||
IDENTITY_ADMIN_TENANT_NAME=${ADMIN_TENANT:-admin}
|
|
||||||
|
|
||||||
IDENTITY_USE_SSL=${IDENTITY_USE_SSL:-False}
|
|
||||||
IDENTITY_HOST=${IDENTITY_HOST:-127.0.0.1}
|
|
||||||
IDENTITY_PORT=${IDENTITY_PORT:-5000}
|
|
||||||
IDENTITY_API_VERSION="v2.0" # Note: need v for now...
|
|
||||||
# TODO(jaypipes): This is dumb and needs to be removed
|
|
||||||
# from the Tempest configuration file entirely...
|
|
||||||
IDENTITY_PATH=${IDENTITY_PATH:-tokens}
|
|
||||||
IDENTITY_STRATEGY=${IDENTITY_STRATEGY:-keystone}
|
|
||||||
IDENTITY_CATALOG_TYPE=identity
|
|
||||||
|
|
||||||
# We use regular, non-admin users in Tempest for the USERNAME
|
|
||||||
# substitutions and use ADMIN_USERNAME et al for the admin stuff.
|
|
||||||
# OS_USERNAME et all should be defined in openrc.
|
|
||||||
OS_USERNAME=${OS_USERNAME:-demo}
|
|
||||||
OS_TENANT_NAME=${OS_TENANT_NAME:-demo}
|
|
||||||
OS_PASSWORD=${OS_PASSWORD:-$ADMIN_PASSWORD}
|
|
||||||
|
|
||||||
# See files/keystone_data.sh where alt_demo user
|
|
||||||
# and tenant are set up...
|
|
||||||
ALT_USERNAME=${ALT_USERNAME:-alt_demo}
|
|
||||||
ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo}
|
|
||||||
ALT_PASSWORD=$OS_PASSWORD
|
|
||||||
|
|
||||||
# Check Nova for existing flavors and, if set, look for the
|
|
||||||
# DEFAULT_INSTANCE_TYPE and use that. Otherwise, just use the first flavor.
|
|
||||||
FLAVOR_LINES=`nova flavor-list`
|
|
||||||
IFS="$(echo -e "\n\r")"
|
|
||||||
FLAVORS=""
|
|
||||||
for line in $FLAVOR_LINES; do
|
|
||||||
if [ -z $DEFAULT_INSTANCE_TYPE ]; then
|
|
||||||
FLAVORS="$FLAVORS `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`"
|
|
||||||
else
|
|
||||||
FLAVORS="$FLAVORS `echo $line | grep -v "^\(|\s*ID\|+--\)" | grep "$DEFAULT_INSTANCE_TYPE" | cut -d' ' -f2`"
|
|
||||||
fi
|
|
||||||
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
|
|
||||||
if [[ $NUM_FLAVORS -gt 1 ]]; then
|
|
||||||
FLAVOR_REF_ALT=${FLAVORS[1]}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Do any of the following need to be configurable?
|
|
||||||
COMPUTE_CATALOG_TYPE=compute
|
|
||||||
COMPUTE_CREATE_IMAGE_ENABLED=True
|
|
||||||
COMPUTE_ALLOW_TENANT_ISOLATION=True
|
|
||||||
COMPUTE_ALLOW_TENANT_REUSE=True
|
|
||||||
COMPUTE_RESIZE_AVAILABLE=False
|
|
||||||
COMPUTE_CHANGE_PASSWORD_AVAILABLE=False # not supported with QEMU...
|
|
||||||
COMPUTE_LOG_LEVEL=ERROR
|
|
||||||
BUILD_INTERVAL=3
|
|
||||||
BUILD_TIMEOUT=400
|
|
||||||
COMPUTE_BUILD_INTERVAL=3
|
|
||||||
COMPUTE_BUILD_TIMEOUT=400
|
|
||||||
VOLUME_BUILD_INTERVAL=3
|
|
||||||
VOLUME_BUILD_TIMEOUT=300
|
|
||||||
RUN_SSH=True
|
|
||||||
# Check for DEFAULT_INSTANCE_USER and try to connect with that account
|
|
||||||
SSH_USER=${DEFAULT_INSTANCE_USER:-$OS_USERNAME}
|
|
||||||
NETWORK_FOR_SSH=private
|
|
||||||
IP_VERSION_FOR_SSH=4
|
|
||||||
SSH_TIMEOUT=4
|
|
||||||
# Whitebox testing configuration for Compute...
|
|
||||||
COMPUTE_WHITEBOX_ENABLED=True
|
|
||||||
COMPUTE_SOURCE_DIR=$NOVA_SOURCE_DIR
|
|
||||||
COMPUTE_BIN_DIR=$NOVA_BIN_DIR
|
|
||||||
COMPUTE_CONFIG_PATH=/etc/nova/nova.conf
|
|
||||||
# TODO(jaypipes): Create the key file here... right now, no whitebox
|
|
||||||
# tests actually use a key.
|
|
||||||
COMPUTE_PATH_TO_PRIVATE_KEY=$TEMPEST_DIR/id_rsa
|
|
||||||
COMPUTE_DB_URI=$BASE_SQL_CONN/nova
|
|
||||||
|
|
||||||
# Image test configuration options...
|
|
||||||
IMAGE_HOST=${IMAGE_HOST:-127.0.0.1}
|
|
||||||
IMAGE_PORT=${IMAGE_PORT:-9292}
|
|
||||||
IMAGE_API_VERSION=1
|
|
||||||
IMAGE_CATALOG_TYPE=image
|
|
||||||
|
|
||||||
# Network API test configuration
|
|
||||||
NETWORK_CATALOG_TYPE=network
|
|
||||||
NETWORK_API_VERSION=2.0
|
|
||||||
|
|
||||||
# Volume API test configuration
|
|
||||||
VOLUME_CATALOG_TYPE=volume
|
|
||||||
|
|
||||||
# Live migration
|
|
||||||
LIVE_MIGRATION_AVAILABLE=${LIVE_MIGRATION_AVAILABLE:-False}
|
|
||||||
USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION=${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
|
|
||||||
|
|
||||||
# Object Storage
|
|
||||||
OBJECT_CATALOG_TYPE="object-store"
|
|
||||||
|
|
||||||
# EC2 and S3 test configuration
|
|
||||||
BOTO_EC2_URL="http://$IDENTITY_HOST:8773/services/Cloud"
|
|
||||||
BOTO_S3_URL="http://$IDENTITY_HOST:3333"
|
|
||||||
BOTO_AWS_ACCESS="" # Created in tempest...
|
|
||||||
BOTO_AWS_SECRET="" # Created in tempest...
|
|
||||||
BOTO_AWS_REGION="RegionOne"
|
|
||||||
BOTO_S3_MATERIALS_PATH=$DEST/devstack/files/images/s3-materials/cirros-0.3.0
|
|
||||||
BOTO_ARI_MANIFEST=cirros-0.3.0-x86_64-initrd.manifest.xml
|
|
||||||
BOTO_AMI_MANIFEST=cirros-0.3.0-x86_64-blank.img.manifest.xml
|
|
||||||
BOTO_AKI_MANIFEST=cirros-0.3.0-x86_64-vmlinuz.manifest.xml
|
|
||||||
BOTO_FLAVOR_NAME=m1.tiny
|
|
||||||
BOTO_SOCKET_TIMEOUT=5
|
|
||||||
BOTO_BUILD_TIMEOUT=${COMPUTE_BUILD_TIMEOUT:-400}
|
|
||||||
BOTO_BUILD_INTERVAL=${COMPUTE_BUILD_INTERVAL:-3}
|
|
||||||
|
|
||||||
sed -e "
|
|
||||||
s,%IDENTITY_USE_SSL%,$IDENTITY_USE_SSL,g;
|
|
||||||
s,%IDENTITY_HOST%,$IDENTITY_HOST,g;
|
|
||||||
s,%IDENTITY_PORT%,$IDENTITY_PORT,g;
|
|
||||||
s,%IDENTITY_API_VERSION%,$IDENTITY_API_VERSION,g;
|
|
||||||
s,%IDENTITY_PATH%,$IDENTITY_PATH,g;
|
|
||||||
s,%IDENTITY_STRATEGY%,$IDENTITY_STRATEGY,g;
|
|
||||||
s,%IDENTITY_CATALOG_TYPE%,$IDENTITY_CATALOG_TYPE,g;
|
|
||||||
s,%USERNAME%,$OS_USERNAME,g;
|
|
||||||
s,%PASSWORD%,$OS_PASSWORD,g;
|
|
||||||
s,%TENANT_NAME%,$OS_TENANT_NAME,g;
|
|
||||||
s,%ALT_USERNAME%,$ALT_USERNAME,g;
|
|
||||||
s,%ALT_PASSWORD%,$ALT_PASSWORD,g;
|
|
||||||
s,%ALT_TENANT_NAME%,$ALT_TENANT_NAME,g;
|
|
||||||
s,%COMPUTE_CATALOG_TYPE%,$COMPUTE_CATALOG_TYPE,g;
|
|
||||||
s,%COMPUTE_ALLOW_TENANT_ISOLATION%,$COMPUTE_ALLOW_TENANT_ISOLATION,g;
|
|
||||||
s,%COMPUTE_ALLOW_TENANT_REUSE%,$COMPUTE_ALLOW_TENANT_REUSE,g;
|
|
||||||
s,%COMPUTE_CREATE_IMAGE_ENABLED%,$COMPUTE_CREATE_IMAGE_ENABLED,g;
|
|
||||||
s,%COMPUTE_RESIZE_AVAILABLE%,$COMPUTE_RESIZE_AVAILABLE,g;
|
|
||||||
s,%COMPUTE_CHANGE_PASSWORD_AVAILABLE%,$COMPUTE_CHANGE_PASSWORD_AVAILABLE,g;
|
|
||||||
s,%COMPUTE_WHITEBOX_ENABLED%,$COMPUTE_WHITEBOX_ENABLED,g;
|
|
||||||
s,%COMPUTE_LOG_LEVEL%,$COMPUTE_LOG_LEVEL,g;
|
|
||||||
s,%BUILD_INTERVAL%,$BUILD_INTERVAL,g;
|
|
||||||
s,%BUILD_TIMEOUT%,$BUILD_TIMEOUT,g;
|
|
||||||
s,%COMPUTE_BUILD_INTERVAL%,$COMPUTE_BUILD_INTERVAL,g;
|
|
||||||
s,%COMPUTE_BUILD_TIMEOUT%,$COMPUTE_BUILD_TIMEOUT,g;
|
|
||||||
s,%RUN_SSH%,$RUN_SSH,g;
|
|
||||||
s,%SSH_USER%,$SSH_USER,g;
|
|
||||||
s,%NETWORK_FOR_SSH%,$NETWORK_FOR_SSH,g;
|
|
||||||
s,%IP_VERSION_FOR_SSH%,$IP_VERSION_FOR_SSH,g;
|
|
||||||
s,%SSH_TIMEOUT%,$SSH_TIMEOUT,g;
|
|
||||||
s,%IMAGE_ID%,$IMAGE_UUID,g;
|
|
||||||
s,%IMAGE_ID_ALT%,$IMAGE_UUID_ALT,g;
|
|
||||||
s,%FLAVOR_REF%,$FLAVOR_REF,g;
|
|
||||||
s,%FLAVOR_REF_ALT%,$FLAVOR_REF_ALT,g;
|
|
||||||
s,%COMPUTE_CONFIG_PATH%,$COMPUTE_CONFIG_PATH,g;
|
|
||||||
s,%COMPUTE_SOURCE_DIR%,$COMPUTE_SOURCE_DIR,g;
|
|
||||||
s,%COMPUTE_BIN_DIR%,$COMPUTE_BIN_DIR,g;
|
|
||||||
s,%COMPUTE_PATH_TO_PRIVATE_KEY%,$COMPUTE_PATH_TO_PRIVATE_KEY,g;
|
|
||||||
s,%COMPUTE_DB_URI%,$COMPUTE_DB_URI,g;
|
|
||||||
s,%IMAGE_HOST%,$IMAGE_HOST,g;
|
|
||||||
s,%IMAGE_PORT%,$IMAGE_PORT,g;
|
|
||||||
s,%IMAGE_API_VERSION%,$IMAGE_API_VERSION,g;
|
|
||||||
s,%IMAGE_CATALOG_TYPE%,$IMAGE_CATALOG_TYPE,g;
|
|
||||||
s,%COMPUTE_ADMIN_USERNAME%,$COMPUTE_ADMIN_USERNAME,g;
|
|
||||||
s,%COMPUTE_ADMIN_PASSWORD%,$COMPUTE_ADMIN_PASSWORD,g;
|
|
||||||
s,%COMPUTE_ADMIN_TENANT_NAME%,$COMPUTE_ADMIN_TENANT_NAME,g;
|
|
||||||
s,%IDENTITY_ADMIN_USERNAME%,$IDENTITY_ADMIN_USERNAME,g;
|
|
||||||
s,%IDENTITY_ADMIN_PASSWORD%,$IDENTITY_ADMIN_PASSWORD,g;
|
|
||||||
s,%IDENTITY_ADMIN_TENANT_NAME%,$IDENTITY_ADMIN_TENANT_NAME,g;
|
|
||||||
s,%NETWORK_CATALOG_TYPE%,$NETWORK_CATALOG_TYPE,g;
|
|
||||||
s,%NETWORK_API_VERSION%,$NETWORK_API_VERSION,g;
|
|
||||||
s,%VOLUME_CATALOG_TYPE%,$VOLUME_CATALOG_TYPE,g;
|
|
||||||
s,%VOLUME_BUILD_INTERVAL%,$VOLUME_BUILD_INTERVAL,g;
|
|
||||||
s,%VOLUME_BUILD_TIMEOUT%,$VOLUME_BUILD_TIMEOUT,g;
|
|
||||||
s,%LIVE_MIGRATION_AVAILABLE%,$LIVE_MIGRATION_AVAILABLE,g;
|
|
||||||
s,%USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION%,$USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION,g;
|
|
||||||
s,%OBJECT_CATALOG_TYPE%,$OBJECT_CATALOG_TYPE,g;
|
|
||||||
s,%BOTO_EC2_URL%,$BOTO_EC2_URL,g;
|
|
||||||
s,%BOTO_S3_URL%,$BOTO_S3_URL,g;
|
|
||||||
s,%BOTO_AWS_ACCESS%,$BOTO_AWS_ACCESS,g;
|
|
||||||
s,%BOTO_AWS_SECRET%,$BOTO_AWS_SECRET,g;
|
|
||||||
s,%BOTO_AWS_REGION%,$BOTO_AWS_REGION,g;
|
|
||||||
s,%BOTO_S3_MATERIALS_PATH%,$BOTO_S3_MATERIALS_PATH,g;
|
|
||||||
s,%BOTO_ARI_MANIFEST%,$BOTO_ARI_MANIFEST,g;
|
|
||||||
s,%BOTO_AMI_MANIFEST%,$BOTO_AMI_MANIFEST,g;
|
|
||||||
s,%BOTO_AKI_MANIFEST%,$BOTO_AKI_MANIFEST,g;
|
|
||||||
s,%BOTO_FLAVOR_NAME%,$BOTO_FLAVOR_NAME,g;
|
|
||||||
s,%BOTO_SOCKET_TIMEOUT%,$BOTO_SOCKET_TIMEOUT,g;
|
|
||||||
s,%BOTO_BUILD_TIMEOUT%,$BOTO_BUILD_TIMEOUT,g;
|
|
||||||
s,%BOTO_BUILD_INTERVAL%,$BOTO_BUILD_INTERVAL,g;
|
|
||||||
" -i $TEMPEST_CONF
|
|
||||||
|
|
||||||
echo "Created tempest configuration file:"
|
|
||||||
cat $TEMPEST_CONF
|
|
||||||
|
|
||||||
echo "\n"
|
|
||||||
echo "**************************************************"
|
|
||||||
echo "Finished Configuring Tempest"
|
|
||||||
echo "**************************************************"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user