blob: 3c34aad53990b03f125a2fb232662ae9acaf4bec [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
Sean Dagued0931212012-10-04 16:06:44 -04003# lib/tempest
Dean Troyer6d04fd72012-12-21 11:03:37 -06004# Install and configure Tempest
Sean Dagued0931212012-10-04 16:06:44 -04005
6# Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +01007#
8# - ``functions`` file
9# - ``lib/nova`` service is running
10# - Global vars that are assumed to be defined:
11# - ``DEST``, ``FILES``
12# - ``ADMIN_PASSWORD``
13# - ``DEFAULT_IMAGE_NAME``
14# - ``S3_SERVICE_PORT``
15# - ``SERVICE_HOST``
16# - ``BASE_SQL_CONN`` ``lib/database`` declares
17# - ``PUBLIC_NETWORK_NAME``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010018# - ``Q_ROUTER_NAME``
Tomoe Sugiharaafbc6312013-11-14 20:02:47 +000019# - ``Q_L3_ENABLED``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010020# - ``VIRT_DRIVER``
21# - ``LIBVIRT_TYPE``
22# - ``KEYSTONE_SERVICE_PROTOCOL``, ``KEYSTONE_SERVICE_HOST`` from lib/keystone
23#
Attila Fazekas2aa35172012-12-05 20:03:40 +010024# Optional Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010025#
Einst Crazyf54f60a2015-10-30 23:00:57 +080026# - ``ALT_*``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010027# - ``LIVE_MIGRATION_AVAILABLE``
28# - ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION``
29# - ``DEFAULT_INSTANCE_TYPE``
30# - ``DEFAULT_INSTANCE_USER``
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +000031# - ``CINDER_ENABLED_BACKENDS``
Matt Riedemann89ee5852015-07-09 13:25:04 -070032# - ``NOVA_ALLOW_DUPLICATE_NETWORKS``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010033#
Sean Dagued0931212012-10-04 16:06:44 -040034# ``stack.sh`` calls the entry points in this order:
35#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010036# - install_tempest
37# - configure_tempest
Sean Dagued0931212012-10-04 16:06:44 -040038
39# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +110040_XTRACE_TEMPEST=$(set +o | grep xtrace)
Sean Dagued0931212012-10-04 16:06:44 -040041set +o xtrace
42
Dean Troyer6d04fd72012-12-21 11:03:37 -060043
Sean Dagued0931212012-10-04 16:06:44 -040044# Defaults
45# --------
46
Sean Dagued0931212012-10-04 16:06:44 -040047# Set up default directories
Sean Dague91b22902014-11-18 07:13:35 -050048GITDIR["tempest-lib"]=$DEST/tempest-lib
Sean Dague5cb19062014-11-01 01:37:45 +010049
Sean Dagued0931212012-10-04 16:06:44 -040050TEMPEST_DIR=$DEST/tempest
john-griffithdc4dc7f2014-01-22 18:09:32 -070051TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
52TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
Matthew Treinish14ccba02013-07-29 16:15:53 -040053TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
Attila Fazekas2aa35172012-12-05 20:03:40 +010054
Dean Troyer6d04fd72012-12-21 11:03:37 -060055NOVA_SOURCE_DIR=$DEST/nova
56
Attila Fazekasbae02332013-05-09 09:24:49 +020057BUILD_INTERVAL=1
Arx Cruz1bde9b42014-07-18 11:34:33 -030058
59# This is the timeout that tempest will wait for a VM to change state,
60# spawn, delete, etc.
61# The default is set to 196 seconds.
62BUILD_TIMEOUT=${BUILD_TIMEOUT:-196}
Sean Dagued0931212012-10-04 16:06:44 -040063
Joe Gordonc9b245b2015-02-10 14:32:39 -080064# This must be False on stable branches, as master tempest
65# deps do not match stable branch deps. Set this to True to
Dean Troyerdc97cb72015-03-28 08:20:50 -050066# have tempest installed in DevStack by default.
Matthew Treinishcb3cece2015-03-16 10:37:51 -040067INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"}
Joe Gordonc9b245b2015-02-10 14:32:39 -080068
john-griffithdc4dc7f2014-01-22 18:09:32 -070069# Cinder/Volume variables
70TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
Eric Harney01456482014-10-14 18:53:53 -040071TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source"
72TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-$TEMPEST_DEFAULT_VOLUME_VENDOR}
73TEMPEST_DEFAULT_STORAGE_PROTOCOL="iSCSI"
74TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-$TEMPEST_DEFAULT_STORAGE_PROTOCOL}
Dean Troyercc6b4432013-04-08 15:38:03 -050075
armando-migliaccio71ef61a2014-02-19 22:19:24 -080076# Neutron/Network variables
Sean Dague53753292014-12-04 19:38:15 -050077IPV6_ENABLED=$(trueorfalse True IPV6_ENABLED)
78IPV6_SUBNET_ATTRIBUTES_ENABLED=$(trueorfalse True IPV6_SUBNET_ATTRIBUTES_ENABLED)
armando-migliaccio71ef61a2014-02-19 22:19:24 -080079
Matthew Treinishdf8f43b2015-08-09 20:30:39 -040080# Do we want to make a configuration where Tempest has admin on
81# the cloud. We don't always want to so that we can ensure Tempest
82# would work on a public cloud.
83TEMPEST_HAS_ADMIN=$(trueorfalse True TEMPEST_HAS_ADMIN)
84
85# Credential provider configuration option variables
86TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-$TEMPEST_HAS_ADMIN}
Matthew Treinish403fbb12015-08-24 21:17:37 -040087TEMPEST_USE_TEST_ACCOUNTS=$(trueorfalse False TEMPEST_USE_TEST_ACCOUNTS)
Matthew Treinishdf8f43b2015-08-09 20:30:39 -040088
89# The number of workers tempest is expected to be run with. This is used for
90# generating a accounts.yaml for running with test-accounts. This is also the
91# same variable that devstack-gate uses to specify the number of workers that
92# it will run tempest with
93TEMPEST_CONCURRENCY=${TEMPEST_CONCURRENCY:-$(nproc)}
94
Dean Troyerdc97cb72015-03-28 08:20:50 -050095
Dean Troyercc6b4432013-04-08 15:38:03 -050096# Functions
97# ---------
Sean Dagued0931212012-10-04 16:06:44 -040098
Salvatore33e8ee22014-10-05 01:36:34 +020099# remove_disabled_extension - removes disabled extensions from the list of extensions
100# to test for a given service
101function remove_disabled_extensions {
102 local extensions_list=$1
103 shift
104 local disabled_exts=$*
fumihiko kakuma8606c982015-04-13 09:55:06 +0900105 remove_disabled_services "$extensions_list" "$disabled_exts"
Salvatore33e8ee22014-10-05 01:36:34 +0200106}
107
Sean Dagued0931212012-10-04 16:06:44 -0400108# configure_tempest() - Set config files, create data dirs, etc
Ian Wienandaee18c72014-02-21 15:35:08 +1100109function configure_tempest {
Joe Gordonc9b245b2015-02-10 14:32:39 -0800110 if [[ "$INSTALL_TEMPEST" == "True" ]]; then
111 setup_develop $TEMPEST_DIR
112 else
113 # install testr since its used to process tempest logs
Sean Dague60996b12015-04-08 09:06:49 -0400114 pip_install_gr testrepository
Joe Gordonc9b245b2015-02-10 14:32:39 -0800115 fi
Joe Gordond5ac7852015-02-06 19:29:23 -0800116
Attila Fazekas65c08462012-12-07 14:20:51 +0100117 local image_lines
118 local images
119 local num_images
120 local image_uuid
121 local image_uuid_alt
Attila Fazekas65c08462012-12-07 14:20:51 +0100122 local password
123 local line
124 local flavors
Clark Boylan3b80bde2013-11-20 17:51:50 -0800125 local available_flavors
Attila Fazekas65c08462012-12-07 14:20:51 +0100126 local flavors_ref
127 local flavor_lines
Maru Newbya5c774e2012-12-10 10:40:01 +0000128 local public_network_id
Maru Newby31c94ab2012-12-19 03:59:20 +0000129 local public_router_id
Sean Dague5544c4a2016-01-25 08:27:06 -0500130 local ssh_connect_method="floating"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100131
Dean Troyer6d04fd72012-12-21 11:03:37 -0600132 # Save IFS
Attila Fazekas2aa35172012-12-05 20:03:40 +0100133 ifs=$IFS
134
135 # Glance should already contain images to be used in tempest
136 # testing. Here we simply look for images stored in Glance
137 # and set the appropriate variables for use in the tempest config
138 # We ignore ramdisk and kernel images, look for the default image
Attila Fazekas65c08462012-12-07 14:20:51 +0100139 # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the
140 # first image returned and set ``image_uuid_alt`` to the second,
Attila Fazekas2aa35172012-12-05 20:03:40 +0100141 # if there is more than one returned...
142 # ... Also ensure we only take active images, so we don't get snapshots in process
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500143 declare -a images
144
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200145 if is_service_enabled glance; then
146 while read -r IMAGE_NAME IMAGE_UUID; do
147 if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
148 image_uuid="$IMAGE_UUID"
149 image_uuid_alt="$IMAGE_UUID"
150 fi
151 images+=($IMAGE_UUID)
Swapnil Kulkarnia747cd22015-05-13 09:26:15 +0000152 done < <(openstack image list --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500153
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200154 case "${#images[*]}" in
155 0)
156 echo "Found no valid images to use!"
157 exit 1
158 ;;
159 1)
160 if [ -z "$image_uuid" ]; then
161 image_uuid=${images[0]}
162 image_uuid_alt=${images[0]}
163 fi
164 ;;
165 *)
166 if [ -z "$image_uuid" ]; then
167 image_uuid=${images[0]}
168 image_uuid_alt=${images[1]}
169 fi
170 ;;
171 esac
172 fi
Attila Fazekas2aa35172012-12-05 20:03:40 +0100173
Matthew Treinish93c10572015-07-31 10:38:50 -0400174 # (Re)create ``tempest.conf``
175 # Create every time because the image UUIDS are going to change
Dean Troyer8421c2b2015-03-16 13:52:19 -0500176 sudo install -d -o $STACK_USER $TEMPEST_CONFIG_DIR
Matthew Treinish93c10572015-07-31 10:38:50 -0400177 rm -f $TEMPEST_CONFIG
Attila Fazekas2aa35172012-12-05 20:03:40 +0100178
Attila Fazekas65c08462012-12-07 14:20:51 +0100179 password=${ADMIN_PASSWORD:-secrete}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100180
Dean Troyerdc97cb72015-03-28 08:20:50 -0500181 # See ``lib/keystone`` where these users and tenants are set up
Andrea Frittolid46d9dd2014-03-05 13:38:19 +0000182 ADMIN_USERNAME=${ADMIN_USERNAME:-admin}
183 ADMIN_TENANT_NAME=${ADMIN_TENANT_NAME:-admin}
Andrea Frittoli03523252014-04-08 13:43:56 +0100184 ADMIN_DOMAIN_NAME=${ADMIN_DOMAIN_NAME:-Default}
Andrea Frittolid46d9dd2014-03-05 13:38:19 +0000185 TEMPEST_USERNAME=${TEMPEST_USERNAME:-demo}
186 TEMPEST_TENANT_NAME=${TEMPEST_TENANT_NAME:-demo}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100187 ALT_USERNAME=${ALT_USERNAME:-alt_demo}
188 ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo}
Harshada Mangesh Kakad49126232014-05-23 09:16:52 +0000189 ADMIN_TENANT_ID=$(openstack project list | awk "/ admin / { print \$2 }")
Attila Fazekas2aa35172012-12-05 20:03:40 +0100190
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200191 if is_service_enabled nova; then
Dean Troyerdc97cb72015-03-28 08:20:50 -0500192 # If ``DEFAULT_INSTANCE_TYPE`` is not declared, use the new behavior
193 # Tempest creates its own instance types
Rafael Folco0b4c83a2015-11-26 10:08:36 -0600194 available_flavors=$(nova flavor-list)
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200195 if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200196 if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then
Rafael Folcof0131e12015-09-23 12:55:02 -0500197 nova flavor-create m1.nano 42 64 0 1
Rafael Folcoba0f1d32013-12-06 17:56:24 -0200198 fi
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200199 flavor_ref=42
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200200 if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then
Rafael Folcof0131e12015-09-23 12:55:02 -0500201 nova flavor-create m1.micro 84 128 0 1
Rafael Folcoba0f1d32013-12-06 17:56:24 -0200202 fi
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200203 flavor_ref_alt=84
204 else
Dean Troyerdc97cb72015-03-28 08:20:50 -0500205 # Check Nova for existing flavors, if ``DEFAULT_INSTANCE_TYPE`` is set use it.
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200206 IFS=$'\r\n'
207 flavors=""
Rafael Folco0b4c83a2015-11-26 10:08:36 -0600208 for line in $available_flavors; do
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200209 f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }")
210 flavors="$flavors $f"
211 done
Attila Fazekas2aa35172012-12-05 20:03:40 +0100212
Rafael Folco0b4c83a2015-11-26 10:08:36 -0600213 for line in $available_flavors; do
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200214 flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`"
215 done
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100216
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200217 IFS=" "
218 flavors=($flavors)
219 num_flavors=${#flavors[*]}
220 echo "Found $num_flavors flavors"
221 if [[ $num_flavors -eq 0 ]]; then
222 echo "Found no valid flavors to use!"
223 exit 1
Adalberto Medeiros63a71a22013-06-06 08:46:04 -0400224 fi
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200225 flavor_ref=${flavors[0]}
226 flavor_ref_alt=$flavor_ref
227
Dean Troyerdc97cb72015-03-28 08:20:50 -0500228 # Ensure ``flavor_ref`` and ``flavor_ref_alt`` have different values.
229 # Some resize instance in tempest tests depends on this.
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200230 for f in ${flavors[@]:1}; do
231 if [[ $f -ne $flavor_ref ]]; then
232 flavor_ref_alt=$f
233 break
234 fi
235 done
236 fi
Attila Fazekas2aa35172012-12-05 20:03:40 +0100237 fi
238
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200239 ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
240
Tomoe Sugiharaafbc6312013-11-14 20:02:47 +0000241 if [ "$Q_L3_ENABLED" = "True" ]; then
Mark McClainb05c8762013-07-06 23:29:39 -0400242 public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \
Maru Newbya5c774e2012-12-10 10:40:01 +0000243 awk '{print $2}')
244 fi
245
Masayuki Igawa5a252d92014-11-21 21:55:09 +0900246 iniset $TEMPEST_CONFIG DEFAULT use_syslog $SYSLOG
Dean Troyerdc97cb72015-03-28 08:20:50 -0500247
Matthew Treinish859cc682013-07-26 15:22:44 -0400248 # Oslo
Joe Gordon23d6d502015-03-06 15:24:22 -0800249 iniset $TEMPEST_CONFIG oslo_concurrency lock_path $TEMPEST_STATE_PATH
Matthew Treinish14ccba02013-07-29 16:15:53 -0400250 mkdir -p $TEMPEST_STATE_PATH
john-griffithdc4dc7f2014-01-22 18:09:32 -0700251 iniset $TEMPEST_CONFIG DEFAULT use_stderr False
252 iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log
253 iniset $TEMPEST_CONFIG DEFAULT debug True
Matthew Treinish859cc682013-07-26 15:22:44 -0400254
Attila Fazekas2aa35172012-12-05 20:03:40 +0100255 # Timeouts
john-griffithdc4dc7f2014-01-22 18:09:32 -0700256 iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT
257 iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT
Attila Fazekas2aa35172012-12-05 20:03:40 +0100258
Attila Fazekas97d3d202013-01-19 19:20:49 +0100259 # Identity
john-griffithdc4dc7f2014-01-22 18:09:32 -0700260 iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
Steve Martinellib74e01c2014-12-18 01:35:35 -0500261 iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_URI_V3"
Matthew Treinish7ced1502015-03-23 15:51:54 -0400262 if [[ "$TEMPEST_HAS_ADMIN" == "True" ]]; then
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500263 iniset $TEMPEST_CONFIG auth admin_username $ADMIN_USERNAME
264 iniset $TEMPEST_CONFIG auth admin_password "$password"
265 iniset $TEMPEST_CONFIG auth admin_tenant_name $ADMIN_TENANT_NAME
266 iniset $TEMPEST_CONFIG auth admin_tenant_id $ADMIN_TENANT_ID
267 iniset $TEMPEST_CONFIG auth admin_domain_name $ADMIN_DOMAIN_NAME
Matthew Treinish7ced1502015-03-23 15:51:54 -0400268 fi
Samuel de Medeiros Queiroz3fd71d62015-05-03 14:54:45 -0300269 if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
270 # Only Identity v3 is available; then skip Identity API v2 tests
Jamie Lennox75c1dfe2015-08-13 10:40:57 +1000271 iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 False
Samuel de Medeiros Queiroz3fd71d62015-05-03 14:54:45 -0300272 # In addition, use v3 auth tokens for running all Tempest tests
273 iniset $TEMPEST_CONFIG identity auth_version v3
274 else
275 iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
276 fi
277
Rob Crittendene1d013f2015-02-10 14:15:35 -0500278 if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
279 iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
280 fi
Attila Fazekas2aa35172012-12-05 20:03:40 +0100281
Sean Daguec3771452013-06-13 14:23:37 -0400282 # Image
Dean Troyerdc97cb72015-03-28 08:20:50 -0500283 # We want to be able to override this variable in the gate to avoid
284 # doing an external HTTP fetch for this test.
Sean Daguec3771452013-06-13 14:23:37 -0400285 if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700286 iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
Sean Daguec3771452013-06-13 14:23:37 -0400287 fi
Bob Ball2dd761b2016-01-15 13:56:37 +0000288 if [ "$VIRT_DRIVER" = "xenserver" ]; then
289 iniset $TEMPEST_CONFIG image disk_formats "ami,ari,aki,vhd,raw,iso"
290 fi
Sean Daguec3771452013-06-13 14:23:37 -0400291
David Kranzf100e1c2015-06-01 10:29:59 -0400292 # Image Features
293 iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image True
294
Attila Fazekas97d3d202013-01-19 19:20:49 +0100295 # Compute
john-griffithdc4dc7f2014-01-22 18:09:32 -0700296 iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
john-griffithdc4dc7f2014-01-22 18:09:32 -0700297 iniset $TEMPEST_CONFIG compute image_ref $image_uuid
john-griffithdc4dc7f2014-01-22 18:09:32 -0700298 iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt
Kirill Shileev608f8842014-10-03 22:48:58 +0400299 iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${ALT_INSTANCE_USER:-cirros}
john-griffithdc4dc7f2014-01-22 18:09:32 -0700300 iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref
301 iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt
john-griffithdc4dc7f2014-01-22 18:09:32 -0700302 iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method
Sean Dague563a7e72015-12-15 17:16:19 -0500303 # set the equiv validation option here as well to ensure they are
304 # in sync. They shouldn't be separate options.
305 iniset $TEMPEST_CONFIG validation connect_method $ssh_connect_method
Matthew Treinish4b684ae2015-05-15 12:38:09 -0400306 if [[ ! $(is_service_enabled n-cell) && ! $(is_service_enabled neutron) ]]; then
melanie wittf5b550e2015-04-10 22:20:07 +0000307 iniset $TEMPEST_CONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME
308 fi
Attila Fazekas97d3d202013-01-19 19:20:49 +0100309
Sean Dague8349aff2015-09-01 12:45:28 -0400310 # Set the service catalog entry for Tempest to run on. Typically
311 # used to try different compute API version targets. The tempest
312 # default if 'compute', which is typically valid, so only set this
313 # if you want to change it.
314 if [[ -n "$TEMPEST_COMPUTE_TYPE" ]]; then
315 iniset $TEMPEST_CONFIG compute catalog_type $TEMPEST_COMPUTE_TYPE
316 fi
317
Sean Daguede19bf92014-03-20 16:54:58 -0400318 # Compute Features
Dean Troyerdc97cb72015-03-28 08:20:50 -0500319 # Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints
Salvatore33e8ee22014-10-05 01:36:34 +0200320 # NOTE(mtreinish): This must be done after auth settings are added to the tempest config
Ian Wienandada886d2015-10-07 14:06:26 +1100321 local tmp_cfg_file
322 tmp_cfg_file=$(mktemp)
Joe Gordon1368b982015-02-04 15:28:18 -0800323 cd $TEMPEST_DIR
Pavlo Shchelokovskyy199c6042015-03-18 10:48:47 +0000324 tox -revenv -- verify-tempest-config -uro $tmp_cfg_file
Salvatore33e8ee22014-10-05 01:36:34 +0200325
326 local compute_api_extensions=${COMPUTE_API_EXTENSIONS:-"all"}
327 if [[ ! -z "$DISABLE_COMPUTE_API_EXTENSIONS" ]]; then
328 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
329 compute_api_extensions=${COMPUTE_API_EXTENSIONS:-$(iniget $tmp_cfg_file compute-feature-enabled api_extensions | tr -d " ")}
330 # Remove disabled extensions
331 compute_api_extensions=$(remove_disabled_extensions $compute_api_extensions $DISABLE_COMPUTE_API_EXTENSIONS)
332 fi
333
ghanshyam642b07b2015-11-19 10:01:14 +0900334 # Set the microversion range for compute tests.
335 # This is used to run the Nova microversions tests.
336 # Setting [None, latest] range of microversion which allow Tempest to run all microversions tests.
337 # NOTE- To avoid microversion tests failure on stable branch, we need to change "tempest_compute_max_microversion"
338 # for stable branch on each release which should be changed from "latest" to max supported version of that release.
339 local tempest_compute_min_microversion=${TEMPEST_COMPUTE_MIN_MICROVERSION:-None}
340 local tempest_compute_max_microversion=${TEMPEST_COMPUTE_MAX_MICROVERSION:-"latest"}
341 # Reset microversions to None where v2.0 is running which does not support microversion.
342 # Both "None" means no microversion testing.
343 if [[ "$TEMPEST_COMPUTE_TYPE" == "compute_legacy" ]]; then
344 tempest_compute_min_microversion=None
345 tempest_compute_max_microversion=None
346 fi
347 if [ "$tempest_compute_min_microversion" == "None" ]; then
348 inicomment $TEMPEST_CONFIG compute-feature-enabled min_microversion
349 else
350 iniset $TEMPEST_CONFIG compute-feature-enabled min_microversion $tempest_compute_min_microversion
351 fi
352 if [ "$tempest_compute_max_microversion" == "None" ]; then
353 inicomment $TEMPEST_CONFIG compute-feature-enabled max_microversion
354 else
355 iniset $TEMPEST_CONFIG compute-feature-enabled max_microversion $tempest_compute_max_microversion
356 fi
357
Sean Daguede19bf92014-03-20 16:54:58 -0400358 iniset $TEMPEST_CONFIG compute-feature-enabled resize True
Matthew Treinish270f93e2014-03-20 21:18:42 +0000359 iniset $TEMPEST_CONFIG compute-feature-enabled live_migration ${LIVE_MIGRATION_AVAILABLE:-False}
360 iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
361 iniset $TEMPEST_CONFIG compute-feature-enabled block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
Salvatore33e8ee22014-10-05 01:36:34 +0200362 iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions $compute_api_extensions
Matt Riedemann58065f22015-03-14 06:13:26 -0700363 # TODO(mriedem): Remove the preserve_ports flag when Juno is end of life.
364 iniset $TEMPEST_CONFIG compute-feature-enabled preserve_ports True
Matthew Gilliard1b5a4982015-04-10 08:42:22 +0100365 # TODO(gilliard): Remove the live_migrate_paused_instances flag when Juno is end of life.
366 iniset $TEMPEST_CONFIG compute-feature-enabled live_migrate_paused_instances True
Matt Riedemanne57a3322015-06-20 14:48:00 -0700367 iniset $TEMPEST_CONFIG compute-feature-enabled attach_encrypted_volume ${ATTACH_ENCRYPTED_VOLUME_AVAILABLE:-True}
Matt Riedemann89ee5852015-07-09 13:25:04 -0700368 # TODO(mriedem): Remove this when kilo-eol happens since the
369 # neutron.allow_duplicate_networks option was removed from nova in Liberty
370 # and is now the default behavior.
371 iniset $TEMPEST_CONFIG compute-feature-enabled allow_duplicate_networks ${NOVA_ALLOW_DUPLICATE_NETWORKS:-True}
Chuck Carmack09b431d2015-09-02 14:27:58 +0000372 if is_service_enabled n-cell; then
373 # Cells doesn't support shelving/unshelving
374 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
Matt Riedemannc94403d2015-10-15 12:51:13 -0700375 # Cells doesn't support hot-plugging virtual interfaces.
376 iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
Matt Riedemann6cd616a2015-11-06 10:26:14 -0800377
378 if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
379 # Cells supports resize but does not currently work with devstack
380 # because of the custom flavors created for Tempest runs which are
381 # not in the cells database.
382 # TODO(mriedem): work on adding a nova-manage command to sync
383 # flavors into the cells database.
384 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
385 fi
Chuck Carmack09b431d2015-09-02 14:27:58 +0000386 fi
Sean Daguede19bf92014-03-20 16:54:58 -0400387
Marian Horbanea21eb42015-08-18 06:57:18 -0400388 # Network
john-griffithdc4dc7f2014-01-22 18:09:32 -0700389 iniset $TEMPEST_CONFIG network api_version 2.0
Cedric Brandilyb814b532015-10-22 22:25:45 +0200390 iniset $TEMPEST_CONFIG network tenant_networks_reachable false
john-griffithdc4dc7f2014-01-22 18:09:32 -0700391 iniset $TEMPEST_CONFIG network public_network_id "$public_network_id"
392 iniset $TEMPEST_CONFIG network public_router_id "$public_router_id"
393 iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE"
Matthew Treinishccf60f72014-03-03 22:48:31 -0500394 iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED"
Sean M. Collinsbb2908b2014-05-15 10:24:31 -0400395 iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED"
Salvatore33e8ee22014-10-05 01:36:34 +0200396
397 local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
398 if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
399 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
400 network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
401 # Remove disabled extensions
402 network_api_extensions=$(remove_disabled_extensions $network_api_extensions $DISABLE_NETWORK_API_EXTENSIONS)
403 fi
404 iniset $TEMPEST_CONFIG network-feature-enabled api_extensions $network_api_extensions
Attila Fazekas2aa35172012-12-05 20:03:40 +0100405
Sean Dague669c4fc2014-04-03 11:28:01 -0400406 # Orchestration Tests
407 if is_service_enabled heat; then
408 if [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then
Alessandro Pilottif3e75bf2014-12-15 20:02:08 +0200409 iniset $TEMPEST_CONFIG orchestration image_ref $(basename "${HEAT_CFN_IMAGE_URL%.*}")
Sean Dague669c4fc2014-04-03 11:28:01 -0400410 fi
Attila Fazekas51557a52014-06-13 16:09:37 +0200411 # build a specialized heat flavor
Sean Dague669c4fc2014-04-03 11:28:01 -0400412 available_flavors=$(nova flavor-list)
413 if [[ ! ( $available_flavors =~ 'm1.heat' ) ]]; then
Attila Fazekas51557a52014-06-13 16:09:37 +0200414 nova flavor-create m1.heat 451 512 0 1
Sean Dague669c4fc2014-04-03 11:28:01 -0400415 fi
416 iniset $TEMPEST_CONFIG orchestration instance_type "m1.heat"
417 iniset $TEMPEST_CONFIG orchestration build_timeout 900
Matthew Treinish886cbb22015-03-18 22:03:01 -0400418 iniset $TEMPEST_CONFIG orchestration stack_owner_role "_member_"
Steve Bakerd5cccad2013-07-19 10:34:24 +1200419 fi
420
William Marshall24d866e2013-07-02 12:26:31 -0500421 # Scenario
Matthew Treinishd2cb2342015-04-02 11:08:24 -0400422 SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES/images/cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-uec}
423 iniset $TEMPEST_CONFIG scenario img_dir $SCENARIO_IMAGE_DIR
Adalberto Medeiros53971532014-07-10 16:55:49 -0300424 iniset $TEMPEST_CONFIG scenario ami_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-blank.img"
425 iniset $TEMPEST_CONFIG scenario ari_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-initrd"
426 iniset $TEMPEST_CONFIG scenario aki_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-vmlinuz"
Matthew Treinishd2cb2342015-04-02 11:08:24 -0400427 iniset $TEMPEST_CONFIG scenario img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-disk.img"
William Marshall24d866e2013-07-02 12:26:31 -0500428
Joe Gordonbb8c6d42013-08-26 17:00:05 -0400429 # Large Ops Number
john-griffithdc4dc7f2014-01-22 18:09:32 -0700430 iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
Joe Gordonbb8c6d42013-08-26 17:00:05 -0400431
Vadim Rovachev2541d612014-05-29 18:48:10 +0400432 # Telemetry
gordon chung71e4e6f2015-03-16 16:33:01 -0400433 iniset $TEMPEST_CONFIG telemetry-feature-enabled events "True"
Vadim Rovachev2541d612014-05-29 18:48:10 +0400434
Dean Troyerdc97cb72015-03-28 08:20:50 -0500435 # Object Store
Salvatore33e8ee22014-10-05 01:36:34 +0200436 local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
437 if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
438 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
439 object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
440 # Remove disabled extensions
441 object_storage_api_extensions=$(remove_disabled_extensions $object_storage_api_extensions $DISABLE_STORAGE_API_EXTENSIONS)
442 fi
443 iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis $object_storage_api_extensions
Salvatore Orlando3046bc62014-08-21 12:11:10 -0700444
lanoux994db612015-08-03 13:48:12 +0000445 # Validation
446 iniset $TEMPEST_CONFIG validation run_validation ${TEMPEST_RUN_VALIDATION:-False}
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500447 iniset $TEMPEST_CONFIG validation ip_version_for_ssh 4
448 iniset $TEMPEST_CONFIG validation ssh_timeout $BUILD_TIMEOUT
449 iniset $TEMPEST_CONFIG validation image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
450 iniset $TEMPEST_CONFIG validation network_for_ssh $PRIVATE_NETWORK_NAME
lanoux994db612015-08-03 13:48:12 +0000451
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200452 # Volume
David Kranzd1d66672015-06-11 13:09:37 -0400453 # TODO(dkranz): Remove the bootable flag when Juno is end of life.
454 iniset $TEMPEST_CONFIG volume-feature-enabled bootable True
Jordan Pittiere8c70e22015-08-13 18:10:00 +0200455 # TODO(jordanP): Remove the extend_with_snapshot flag when Juno is end of life.
456 iniset $TEMPEST_CONFIG volume-feature-enabled extend_with_snapshot True
obutenkoa366b972015-10-20 19:07:04 +0300457 # TODO(obutenko): Remove the incremental_backup_force flag when Kilo and Juno is end of life.
458 iniset $TEMPEST_CONFIG volume-feature-enabled incremental_backup_force True
Yuriy Nesenenkoaf8b6e12016-01-06 17:14:45 +0200459 # TODO(ynesenenko): Remove the volume_services flag when Liberty and Kilo will correct work with host info.
460 iniset $TEMPEST_CONFIG volume-feature-enabled volume_services True
David Kranzd1d66672015-06-11 13:09:37 -0400461
Salvatore33e8ee22014-10-05 01:36:34 +0200462 local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
463 if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
464 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
465 volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
Marian Horbanea21eb42015-08-18 06:57:18 -0400466 # Remove disabled extensions
Salvatore33e8ee22014-10-05 01:36:34 +0200467 volume_api_extensions=$(remove_disabled_extensions $volume_api_extensions $DISABLE_VOLUME_API_EXTENSIONS)
468 fi
469 iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions $volume_api_extensions
470
Giulio Fidente3d60f4d2014-02-20 16:43:49 +0100471 if ! is_service_enabled c-bak; then
472 iniset $TEMPEST_CONFIG volume-feature-enabled backup False
Giulio Fidente3632ab12013-09-10 02:51:26 +0200473 fi
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000474
Dean Troyerdc97cb72015-03-28 08:20:50 -0500475 # Using ``CINDER_ENABLED_BACKENDS``
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000476 if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
Matthew Treinishdb1c3842014-02-04 20:58:00 +0000477 iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000478 local i=1
479 local be
480 for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
481 local be_name=${be##*:}
482 iniset $TEMPEST_CONFIG volume "backend${i}_name" "$be_name"
483 i=$(( i + 1 ))
484 done
john-griffithdc4dc7f2014-01-22 18:09:32 -0700485 fi
486
Eric Harney01456482014-10-14 18:53:53 -0400487 if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
Patrick East1c0628f2014-10-22 16:22:47 -0700488 "$TEMPEST_VOLUME_VENDOR" != "$TEMPEST_DEFAULT_VOLUME_VENDOR" ]; then
Ed Balduf2f23d752014-07-29 14:42:27 -0600489 iniset $TEMPEST_CONFIG volume vendor_name "$TEMPEST_VOLUME_VENDOR"
Eric Harney01456482014-10-14 18:53:53 -0400490 fi
491 if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
JordanP82a7d932014-12-04 14:09:16 +0100492 "$TEMPEST_STORAGE_PROTOCOL" != "$TEMPEST_DEFAULT_STORAGE_PROTOCOL" ]; then
493 iniset $TEMPEST_CONFIG volume storage_protocol "$TEMPEST_STORAGE_PROTOCOL"
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200494 fi
495
Julie Pichonfea70f82013-07-29 11:22:08 +0100496 # Dashboard
john-griffithdc4dc7f2014-01-22 18:09:32 -0700497 iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/"
Julie Pichonfea70f82013-07-29 11:22:08 +0100498
Dean Troyerdc97cb72015-03-28 08:20:50 -0500499 # CLI
john-griffithdc4dc7f2014-01-22 18:09:32 -0700500 iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR
Ian Wienand7fa19022013-06-25 14:11:48 +1000501
Adam Gandelman43bd6672014-04-03 11:13:13 -0700502 # Baremetal
503 if [ "$VIRT_DRIVER" = "ironic" ] ; then
504 iniset $TEMPEST_CONFIG baremetal driver_enabled True
Michael Turekd091a2d2016-01-11 18:17:50 +0000505 iniset $TEMPEST_CONFIG baremetal unprovision_timeout $BUILD_TIMEOUT
506 iniset $TEMPEST_CONFIG baremetal active_timeout $BUILD_TIMEOUT
Vladyslav Drok41309002015-04-29 13:36:52 +0300507 iniset $TEMPEST_CONFIG baremetal deploy_img_dir $FILES
508 iniset $TEMPEST_CONFIG baremetal node_uuid $IRONIC_NODE_UUID
Adam Gandelmanfdfe7a02014-07-24 10:06:18 -0400509 iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
510 iniset $TEMPEST_CONFIG compute-feature-enabled console_output False
511 iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
512 iniset $TEMPEST_CONFIG compute-feature-enabled live_migration False
513 iniset $TEMPEST_CONFIG compute-feature-enabled pause False
514 iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
515 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
516 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
517 iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
David Shrewsburycf21b712014-08-13 07:03:58 -0400518 iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
Adam Gandelman43bd6672014-04-03 11:13:13 -0700519 fi
520
Nels Nelson7b47c472015-01-05 16:36:42 -0600521 # Libvirt-LXC
522 if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
523 iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
524 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
Matt Riedemanncf94edc2015-10-28 09:50:01 -0700525 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
526 iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
Nels Nelson7b47c472015-01-05 16:36:42 -0600527 iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
528 fi
529
Dean Troyerdc97cb72015-03-28 08:20:50 -0500530 # ``service_available``
Sean Dague346edcc2015-08-26 09:38:37 -0400531 #
532 # this tempest service list needs to be all the services that
533 # tempest supports, otherwise we can have an erroneous set of
534 # defaults (something defaulting true in Tempest, but not listed here).
Flavio Percoco624ab1e2015-04-30 08:54:15 +0200535 TEMPEST_SERVICES="key,glance,nova,neutron,cinder,swift,heat,ceilometer,horizon,sahara,ironic,trove"
Dean Troyer4237f592014-01-29 16:22:11 -0600536 for service in ${TEMPEST_SERVICES//,/ }; do
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400537 if is_service_enabled $service ; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700538 iniset $TEMPEST_CONFIG service_available $service "True"
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400539 else
john-griffithdc4dc7f2014-01-22 18:09:32 -0700540 iniset $TEMPEST_CONFIG service_available $service "False"
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400541 fi
542 done
543
Matt Riedemanncf94edc2015-10-28 09:50:01 -0700544 if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
545 # libvirt-lxc does not support boot from volume or attaching volumes
546 # so basically anything with cinder is out of the question.
547 iniset $TEMPEST_CONFIG service_available cinder "False"
548 fi
549
Matthew Treinishdf8f43b2015-08-09 20:30:39 -0400550 # Auth
551 iniset $TEMPEST_CONFIG auth tempest_roles "Member"
552 if [[ $TEMPEST_USE_TEST_ACCOUNTS == "True" ]]; then
553 if [[ $TEMPEST_HAS_ADMIN == "True" ]]; then
554 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
Matthew Treinishb274dbd2015-08-25 10:01:39 -0400555 else
Matthew Treinishdf8f43b2015-08-09 20:30:39 -0400556 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
557 fi
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500558 iniset $TEMPEST_CONFIG auth use_dynamic_credentials False
Matthew Treinishdf8f43b2015-08-09 20:30:39 -0400559 iniset $TEMPEST_CONFIG auth test_accounts_file "etc/accounts.yaml"
Matthew Treinishc148b132015-10-22 10:05:00 -0400560 elif [[ $TEMPEST_HAS_ADMIN == "False" ]]; then
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500561 iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
Matthew Treinishc148b132015-10-22 10:05:00 -0400562
Matthew Treinishdf8f43b2015-08-09 20:30:39 -0400563 else
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500564 iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
Matthew Treinishdf8f43b2015-08-09 20:30:39 -0400565 fi
Matthew Treinishc148b132015-10-22 10:05:00 -0400566
Attila Fazekas2aa35172012-12-05 20:03:40 +0100567 # Restore IFS
568 IFS=$ifs
Sean Dagued0931212012-10-04 16:06:44 -0400569}
570
Dean Troyer42a59c22014-03-03 14:31:29 -0600571# create_tempest_accounts() - Set up common required tempest accounts
572
573# Project User Roles
574# ------------------------------------------------------------------
575# alt_demo alt_demo Member
576
Dean Troyer42a59c22014-03-03 14:31:29 -0600577function create_tempest_accounts {
578 if is_service_enabled tempest; then
579 # Tempest has some tests that validate various authorization checks
580 # between two regular users in separate tenants
Jamie Lennoxb632c9e2015-05-28 23:36:15 +0000581 get_or_create_project alt_demo default
Jamie Lennox9d7e7762015-05-29 01:08:53 +0000582 get_or_create_user alt_demo "$ADMIN_PASSWORD" "default" "alt_demo@example.com"
Jamie Lennox9b215db2015-02-10 18:19:57 +1100583 get_or_add_user_project_role Member alt_demo alt_demo
Dean Troyer42a59c22014-03-03 14:31:29 -0600584 fi
585}
586
Dean Troyerdc97cb72015-03-28 08:20:50 -0500587# install_tempest_lib() - Collect source, prepare, and install ``tempest-lib``
Matthew Treinish34723862014-09-08 14:01:21 -0400588function install_tempest_lib {
Sean Dague91b22902014-11-18 07:13:35 -0500589 if use_library_from_git "tempest-lib"; then
590 git_clone_by_name "tempest-lib"
Sean Dague86b65dd2014-11-20 17:23:04 -0500591 setup_dev_lib "tempest-lib"
Dean Troyerdc97cb72015-03-28 08:20:50 -0500592 # NOTE(mtreinish) For testing ``tempest-lib`` from git with Tempest we need to
593 # put the git version of ``tempest-lib`` in the Tempest job's tox venv
Matthew Treinish83e166b2015-02-18 19:01:20 -0500594 export PIP_VIRTUAL_ENV=${PROJECT_VENV["tempest"]}
595 setup_dev_lib "tempest-lib"
596 unset PIP_VIRTUAL_ENV
Sean Dague5cb19062014-11-01 01:37:45 +0100597 fi
Matthew Treinish34723862014-09-08 14:01:21 -0400598}
599
Sean Dagued0931212012-10-04 16:06:44 -0400600# install_tempest() - Collect source and prepare
Ian Wienandaee18c72014-02-21 15:35:08 +1100601function install_tempest {
Sean Dagued0931212012-10-04 16:06:44 -0400602 git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
Clark Boylan33dc8692014-08-19 22:37:10 -0700603 pip_install tox
Matthew Treinish83e166b2015-02-18 19:01:20 -0500604 pushd $TEMPEST_DIR
605 tox --notest -efull
606 PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/full
607 install_tempest_lib
608 popd
Sean Dagued0931212012-10-04 16:06:44 -0400609}
610
Sean Dagued0931212012-10-04 16:06:44 -0400611# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +1100612$_XTRACE_TEMPEST
Sean Dague584d90e2013-03-29 14:34:53 -0400613
Adam Spiers6a5aa7c2013-10-24 11:27:02 +0100614# Tell emacs to use shell-script-mode
615## Local variables:
616## mode: shell-script
617## End: