blob: 7a1d25f19539cff8b8ef966be6eb36269debef1f [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``
19# - ``VIRT_DRIVER``
20# - ``LIBVIRT_TYPE``
21# - ``KEYSTONE_SERVICE_PROTOCOL``, ``KEYSTONE_SERVICE_HOST`` from lib/keystone
22#
Attila Fazekas2aa35172012-12-05 20:03:40 +010023# Optional Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010024#
Einst Crazyf54f60a2015-10-30 23:00:57 +080025# - ``ALT_*``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010026# - ``LIVE_MIGRATION_AVAILABLE``
27# - ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION``
28# - ``DEFAULT_INSTANCE_TYPE``
29# - ``DEFAULT_INSTANCE_USER``
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +000030# - ``CINDER_ENABLED_BACKENDS``
Matt Riedemann89ee5852015-07-09 13:25:04 -070031# - ``NOVA_ALLOW_DUPLICATE_NETWORKS``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010032#
Sean Dagued0931212012-10-04 16:06:44 -040033# ``stack.sh`` calls the entry points in this order:
34#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010035# - install_tempest
36# - configure_tempest
Sean Dagued0931212012-10-04 16:06:44 -040037
38# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +110039_XTRACE_TEMPEST=$(set +o | grep xtrace)
Sean Dagued0931212012-10-04 16:06:44 -040040set +o xtrace
41
Dean Troyer6d04fd72012-12-21 11:03:37 -060042
Sean Dagued0931212012-10-04 16:06:44 -040043# Defaults
44# --------
45
Sean Dagued0931212012-10-04 16:06:44 -040046# Set up default directories
47TEMPEST_DIR=$DEST/tempest
john-griffithdc4dc7f2014-01-22 18:09:32 -070048TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
49TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
Matthew Treinish14ccba02013-07-29 16:15:53 -040050TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
Attila Fazekas2aa35172012-12-05 20:03:40 +010051
Dean Troyer6d04fd72012-12-21 11:03:37 -060052NOVA_SOURCE_DIR=$DEST/nova
53
Attila Fazekasbae02332013-05-09 09:24:49 +020054BUILD_INTERVAL=1
Arx Cruz1bde9b42014-07-18 11:34:33 -030055
56# This is the timeout that tempest will wait for a VM to change state,
57# spawn, delete, etc.
58# The default is set to 196 seconds.
59BUILD_TIMEOUT=${BUILD_TIMEOUT:-196}
Sean Dagued0931212012-10-04 16:06:44 -040060
Joe Gordonc9b245b2015-02-10 14:32:39 -080061# This must be False on stable branches, as master tempest
62# deps do not match stable branch deps. Set this to True to
Dean Troyerdc97cb72015-03-28 08:20:50 -050063# have tempest installed in DevStack by default.
Matthew Treinishcb3cece2015-03-16 10:37:51 -040064INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"}
Joe Gordonc9b245b2015-02-10 14:32:39 -080065
Matthew Treinish440464c2016-05-04 11:55:12 -040066# This variable is passed directly to pip install inside the common tox venv
67# that is created
68TEMPEST_PLUGINS=${TEMPEST_PLUGINS:-0}
69
john-griffithdc4dc7f2014-01-22 18:09:32 -070070# Cinder/Volume variables
71TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
Eric Harney01456482014-10-14 18:53:53 -040072TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source"
73TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-$TEMPEST_DEFAULT_VOLUME_VENDOR}
74TEMPEST_DEFAULT_STORAGE_PROTOCOL="iSCSI"
75TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-$TEMPEST_DEFAULT_STORAGE_PROTOCOL}
Dean Troyercc6b4432013-04-08 15:38:03 -050076
armando-migliaccio71ef61a2014-02-19 22:19:24 -080077# Neutron/Network variables
Sean Dague53753292014-12-04 19:38:15 -050078IPV6_ENABLED=$(trueorfalse True IPV6_ENABLED)
79IPV6_SUBNET_ATTRIBUTES_ENABLED=$(trueorfalse True IPV6_SUBNET_ATTRIBUTES_ENABLED)
armando-migliaccio71ef61a2014-02-19 22:19:24 -080080
Matthew Treinishdf8f43b2015-08-09 20:30:39 -040081# Do we want to make a configuration where Tempest has admin on
82# the cloud. We don't always want to so that we can ensure Tempest
83# would work on a public cloud.
84TEMPEST_HAS_ADMIN=$(trueorfalse True TEMPEST_HAS_ADMIN)
85
86# Credential provider configuration option variables
87TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-$TEMPEST_HAS_ADMIN}
Matthew Treinish403fbb12015-08-24 21:17:37 -040088TEMPEST_USE_TEST_ACCOUNTS=$(trueorfalse False TEMPEST_USE_TEST_ACCOUNTS)
Matthew Treinishdf8f43b2015-08-09 20:30:39 -040089
90# The number of workers tempest is expected to be run with. This is used for
91# generating a accounts.yaml for running with test-accounts. This is also the
92# same variable that devstack-gate uses to specify the number of workers that
93# it will run tempest with
94TEMPEST_CONCURRENCY=${TEMPEST_CONCURRENCY:-$(nproc)}
95
Dean Troyerdc97cb72015-03-28 08:20:50 -050096
Dean Troyercc6b4432013-04-08 15:38:03 -050097# Functions
98# ---------
Sean Dagued0931212012-10-04 16:06:44 -040099
Salvatore33e8ee22014-10-05 01:36:34 +0200100# remove_disabled_extension - removes disabled extensions from the list of extensions
101# to test for a given service
102function remove_disabled_extensions {
103 local extensions_list=$1
104 shift
105 local disabled_exts=$*
fumihiko kakuma8606c982015-04-13 09:55:06 +0900106 remove_disabled_services "$extensions_list" "$disabled_exts"
Salvatore33e8ee22014-10-05 01:36:34 +0200107}
108
Sean Dagued0931212012-10-04 16:06:44 -0400109# configure_tempest() - Set config files, create data dirs, etc
Ian Wienandaee18c72014-02-21 15:35:08 +1100110function configure_tempest {
Joe Gordonc9b245b2015-02-10 14:32:39 -0800111 if [[ "$INSTALL_TEMPEST" == "True" ]]; then
112 setup_develop $TEMPEST_DIR
113 else
114 # install testr since its used to process tempest logs
Sean Dague60996b12015-04-08 09:06:49 -0400115 pip_install_gr testrepository
Joe Gordonc9b245b2015-02-10 14:32:39 -0800116 fi
Joe Gordond5ac7852015-02-06 19:29:23 -0800117
Attila Fazekas65c08462012-12-07 14:20:51 +0100118 local image_lines
119 local images
120 local num_images
121 local image_uuid
122 local image_uuid_alt
Attila Fazekas65c08462012-12-07 14:20:51 +0100123 local password
124 local line
125 local flavors
Clark Boylan3b80bde2013-11-20 17:51:50 -0800126 local available_flavors
Attila Fazekas65c08462012-12-07 14:20:51 +0100127 local flavors_ref
128 local flavor_lines
Maru Newbya5c774e2012-12-10 10:40:01 +0000129 local public_network_id
Maru Newby31c94ab2012-12-19 03:59:20 +0000130 local public_router_id
Sean Dague5544c4a2016-01-25 08:27:06 -0500131 local ssh_connect_method="floating"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100132
Dean Troyer6d04fd72012-12-21 11:03:37 -0600133 # Save IFS
Attila Fazekas2aa35172012-12-05 20:03:40 +0100134 ifs=$IFS
135
136 # Glance should already contain images to be used in tempest
137 # testing. Here we simply look for images stored in Glance
138 # and set the appropriate variables for use in the tempest config
139 # We ignore ramdisk and kernel images, look for the default image
Attila Fazekas65c08462012-12-07 14:20:51 +0100140 # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the
141 # first image returned and set ``image_uuid_alt`` to the second,
Attila Fazekas2aa35172012-12-05 20:03:40 +0100142 # if there is more than one returned...
143 # ... Also ensure we only take active images, so we don't get snapshots in process
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500144 declare -a images
145
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200146 if is_service_enabled glance; then
147 while read -r IMAGE_NAME IMAGE_UUID; do
148 if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
149 image_uuid="$IMAGE_UUID"
150 image_uuid_alt="$IMAGE_UUID"
151 fi
152 images+=($IMAGE_UUID)
Swapnil Kulkarnia747cd22015-05-13 09:26:15 +0000153 done < <(openstack image list --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500154
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200155 case "${#images[*]}" in
156 0)
157 echo "Found no valid images to use!"
158 exit 1
159 ;;
160 1)
161 if [ -z "$image_uuid" ]; then
162 image_uuid=${images[0]}
163 image_uuid_alt=${images[0]}
164 fi
165 ;;
166 *)
167 if [ -z "$image_uuid" ]; then
168 image_uuid=${images[0]}
169 image_uuid_alt=${images[1]}
170 fi
171 ;;
172 esac
173 fi
Attila Fazekas2aa35172012-12-05 20:03:40 +0100174
Matthew Treinish93c10572015-07-31 10:38:50 -0400175 # (Re)create ``tempest.conf``
176 # Create every time because the image UUIDS are going to change
Dean Troyer8421c2b2015-03-16 13:52:19 -0500177 sudo install -d -o $STACK_USER $TEMPEST_CONFIG_DIR
Matthew Treinish93c10572015-07-31 10:38:50 -0400178 rm -f $TEMPEST_CONFIG
Attila Fazekas2aa35172012-12-05 20:03:40 +0100179
Balagopal7ed812c2016-03-01 04:43:31 +0000180 local password=${ADMIN_PASSWORD:-secret}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100181
Dean Troyerdc97cb72015-03-28 08:20:50 -0500182 # See ``lib/keystone`` where these users and tenants are set up
Sean Dague0f765352016-02-18 06:53:08 -0500183 local admin_username=${ADMIN_USERNAME:-admin}
Sean Dague76392b52016-04-04 09:07:08 -0400184 local admin_project_name=${ADMIN_TENANT_NAME:-admin}
Sean Dague0f765352016-02-18 06:53:08 -0500185 local admin_domain_name=${ADMIN_DOMAIN_NAME:-Default}
Sean Dague0f765352016-02-18 06:53:08 -0500186 local alt_username=${ALT_USERNAME:-alt_demo}
Sean Dague76392b52016-04-04 09:07:08 -0400187 local alt_project_name=${ALT_TENANT_NAME:-alt_demo}
188 local admin_project_id
189 admin_project_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
Dan Smitha2ec7fd2016-08-10 11:14:00 -0700239 iniset $TEMPEST_CONFIG network project_network_cidr $FIXED_RANGE
240
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200241 ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
242
Armando Migliaccio53f59d82016-05-17 15:12:24 -0700243 # the public network (for floating ip access) is only available
244 # if the extension is enabled.
Sean M. Collinsc35110e2016-05-18 10:38:51 -0400245 if is_networking_extension_supported 'external-net'; then
Mark McClainb05c8762013-07-06 23:29:39 -0400246 public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \
Maru Newbya5c774e2012-12-10 10:40:01 +0000247 awk '{print $2}')
248 fi
249
Masayuki Igawa5a252d92014-11-21 21:55:09 +0900250 iniset $TEMPEST_CONFIG DEFAULT use_syslog $SYSLOG
Dean Troyerdc97cb72015-03-28 08:20:50 -0500251
Matthew Treinish859cc682013-07-26 15:22:44 -0400252 # Oslo
Joe Gordon23d6d502015-03-06 15:24:22 -0800253 iniset $TEMPEST_CONFIG oslo_concurrency lock_path $TEMPEST_STATE_PATH
Matthew Treinish14ccba02013-07-29 16:15:53 -0400254 mkdir -p $TEMPEST_STATE_PATH
john-griffithdc4dc7f2014-01-22 18:09:32 -0700255 iniset $TEMPEST_CONFIG DEFAULT use_stderr False
256 iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log
257 iniset $TEMPEST_CONFIG DEFAULT debug True
Matthew Treinish859cc682013-07-26 15:22:44 -0400258
Attila Fazekas2aa35172012-12-05 20:03:40 +0100259 # Timeouts
john-griffithdc4dc7f2014-01-22 18:09:32 -0700260 iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT
261 iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT
Attila Fazekas2aa35172012-12-05 20:03:40 +0100262
Attila Fazekas97d3d202013-01-19 19:20:49 +0100263 # Identity
john-griffithdc4dc7f2014-01-22 18:09:32 -0700264 iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
Steve Martinellib74e01c2014-12-18 01:35:35 -0500265 iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_URI_V3"
Andrea Frittoli (andreaf)5cda4912016-06-09 00:33:30 +0100266 # Use domain scoped tokens for admin v3 tests, v3 dynamic credentials of v3 account generation
267 iniset $TEMPEST_CONFIG identity admin_domain_scope True
Matthew Treinish7ced1502015-03-23 15:51:54 -0400268 if [[ "$TEMPEST_HAS_ADMIN" == "True" ]]; then
Sean Dague0f765352016-02-18 06:53:08 -0500269 iniset $TEMPEST_CONFIG auth admin_username $admin_username
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500270 iniset $TEMPEST_CONFIG auth admin_password "$password"
Sean Dague76392b52016-04-04 09:07:08 -0400271 iniset $TEMPEST_CONFIG auth admin_tenant_name $admin_project_name
272 iniset $TEMPEST_CONFIG auth admin_tenant_id $admin_project_id
Sean Dague0f765352016-02-18 06:53:08 -0500273 iniset $TEMPEST_CONFIG auth admin_domain_name $admin_domain_name
Matthew Treinish7ced1502015-03-23 15:51:54 -0400274 fi
Samuel de Medeiros Queiroz3fd71d62015-05-03 14:54:45 -0300275 if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
276 # Only Identity v3 is available; then skip Identity API v2 tests
Jamie Lennox75c1dfe2015-08-13 10:40:57 +1000277 iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 False
Samuel de Medeiros Queiroz3fd71d62015-05-03 14:54:45 -0300278 # In addition, use v3 auth tokens for running all Tempest tests
279 iniset $TEMPEST_CONFIG identity auth_version v3
280 else
281 iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
282 fi
283
Rob Crittendene1d013f2015-02-10 14:15:35 -0500284 if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
285 iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
286 fi
Attila Fazekas2aa35172012-12-05 20:03:40 +0100287
Rodrigo Duarte0578e422016-03-16 12:15:07 -0300288 # Identity Features
289 # TODO(rodrigods): Remove the reseller flag when Kilo and Liberty are end of life.
290 iniset $TEMPEST_CONFIG identity-feature-enabled reseller True
291
Sean Daguec3771452013-06-13 14:23:37 -0400292 # Image
Dean Troyerdc97cb72015-03-28 08:20:50 -0500293 # We want to be able to override this variable in the gate to avoid
294 # doing an external HTTP fetch for this test.
Sean Daguec3771452013-06-13 14:23:37 -0400295 if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700296 iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
Sean Daguec3771452013-06-13 14:23:37 -0400297 fi
Bob Ball2dd761b2016-01-15 13:56:37 +0000298 if [ "$VIRT_DRIVER" = "xenserver" ]; then
299 iniset $TEMPEST_CONFIG image disk_formats "ami,ari,aki,vhd,raw,iso"
Huan Xie36afed42016-06-06 20:17:48 -0700300 iniset $TEMPEST_CONFIG scenario img_disk_format vhd
Bob Ball2dd761b2016-01-15 13:56:37 +0000301 fi
Sean Daguec3771452013-06-13 14:23:37 -0400302
David Kranzf100e1c2015-06-01 10:29:59 -0400303 # Image Features
304 iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image True
Flavio Percoco22c695f2016-05-11 12:49:07 -0500305 if [ "$GLANCE_V1_ENABLED" != "True" ]; then
306 iniset $TEMPEST_CONFIG image-feature-enabled api_v1 False
307 fi
David Kranzf100e1c2015-06-01 10:29:59 -0400308
Attila Fazekas97d3d202013-01-19 19:20:49 +0100309 # Compute
john-griffithdc4dc7f2014-01-22 18:09:32 -0700310 iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
john-griffithdc4dc7f2014-01-22 18:09:32 -0700311 iniset $TEMPEST_CONFIG compute image_ref $image_uuid
john-griffithdc4dc7f2014-01-22 18:09:32 -0700312 iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt
Kirill Shileev608f8842014-10-03 22:48:58 +0400313 iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${ALT_INSTANCE_USER:-cirros}
john-griffithdc4dc7f2014-01-22 18:09:32 -0700314 iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref
315 iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt
john-griffithdc4dc7f2014-01-22 18:09:32 -0700316 iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method
Sean Dague563a7e72015-12-15 17:16:19 -0500317 # set the equiv validation option here as well to ensure they are
318 # in sync. They shouldn't be separate options.
319 iniset $TEMPEST_CONFIG validation connect_method $ssh_connect_method
Matthew Treinish4b684ae2015-05-15 12:38:09 -0400320 if [[ ! $(is_service_enabled n-cell) && ! $(is_service_enabled neutron) ]]; then
melanie wittf5b550e2015-04-10 22:20:07 +0000321 iniset $TEMPEST_CONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME
322 fi
Attila Fazekas97d3d202013-01-19 19:20:49 +0100323
Sean Dague8349aff2015-09-01 12:45:28 -0400324 # Set the service catalog entry for Tempest to run on. Typically
325 # used to try different compute API version targets. The tempest
326 # default if 'compute', which is typically valid, so only set this
327 # if you want to change it.
328 if [[ -n "$TEMPEST_COMPUTE_TYPE" ]]; then
329 iniset $TEMPEST_CONFIG compute catalog_type $TEMPEST_COMPUTE_TYPE
330 fi
331
Sean Daguede19bf92014-03-20 16:54:58 -0400332 # Compute Features
ghanshyam642b07b2015-11-19 10:01:14 +0900333 # Set the microversion range for compute tests.
334 # This is used to run the Nova microversions tests.
335 # Setting [None, latest] range of microversion which allow Tempest to run all microversions tests.
336 # NOTE- To avoid microversion tests failure on stable branch, we need to change "tempest_compute_max_microversion"
337 # for stable branch on each release which should be changed from "latest" to max supported version of that release.
338 local tempest_compute_min_microversion=${TEMPEST_COMPUTE_MIN_MICROVERSION:-None}
339 local tempest_compute_max_microversion=${TEMPEST_COMPUTE_MAX_MICROVERSION:-"latest"}
340 # Reset microversions to None where v2.0 is running which does not support microversion.
341 # Both "None" means no microversion testing.
342 if [[ "$TEMPEST_COMPUTE_TYPE" == "compute_legacy" ]]; then
343 tempest_compute_min_microversion=None
344 tempest_compute_max_microversion=None
345 fi
346 if [ "$tempest_compute_min_microversion" == "None" ]; then
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200347 inicomment $TEMPEST_CONFIG compute min_microversion
ghanshyam642b07b2015-11-19 10:01:14 +0900348 else
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200349 iniset $TEMPEST_CONFIG compute min_microversion $tempest_compute_min_microversion
ghanshyam642b07b2015-11-19 10:01:14 +0900350 fi
351 if [ "$tempest_compute_max_microversion" == "None" ]; then
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200352 inicomment $TEMPEST_CONFIG compute max_microversion
ghanshyam642b07b2015-11-19 10:01:14 +0900353 else
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200354 iniset $TEMPEST_CONFIG compute max_microversion $tempest_compute_max_microversion
ghanshyam642b07b2015-11-19 10:01:14 +0900355 fi
356
Matt Riedemann6d3670a2016-07-03 19:40:25 -0400357 iniset $TEMPEST_CONFIG compute-feature-enabled personality ${ENABLE_FILE_INJECTION:-False}
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}
Matt Riedemanne57a3322015-06-20 14:48:00 -0700362 iniset $TEMPEST_CONFIG compute-feature-enabled attach_encrypted_volume ${ATTACH_ENCRYPTED_VOLUME_AVAILABLE:-True}
Chuck Carmack09b431d2015-09-02 14:27:58 +0000363 if is_service_enabled n-cell; then
364 # Cells doesn't support shelving/unshelving
365 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
Matt Riedemannc94403d2015-10-15 12:51:13 -0700366 # Cells doesn't support hot-plugging virtual interfaces.
367 iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
Matt Riedemann2bebf2d2016-04-05 10:34:42 -0400368 # Cells v1 doesn't support the rescue/unrescue tests in Tempest
369 iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
Matt Riedemann6cd616a2015-11-06 10:26:14 -0800370
371 if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
372 # Cells supports resize but does not currently work with devstack
373 # because of the custom flavors created for Tempest runs which are
374 # not in the cells database.
375 # TODO(mriedem): work on adding a nova-manage command to sync
376 # flavors into the cells database.
377 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
378 fi
Chuck Carmack09b431d2015-09-02 14:27:58 +0000379 fi
Sean Daguede19bf92014-03-20 16:54:58 -0400380
Marian Horbanea21eb42015-08-18 06:57:18 -0400381 # Network
john-griffithdc4dc7f2014-01-22 18:09:32 -0700382 iniset $TEMPEST_CONFIG network api_version 2.0
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200383 iniset $TEMPEST_CONFIG network project_networks_reachable false
john-griffithdc4dc7f2014-01-22 18:09:32 -0700384 iniset $TEMPEST_CONFIG network public_network_id "$public_network_id"
385 iniset $TEMPEST_CONFIG network public_router_id "$public_router_id"
386 iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE"
Matthew Treinishccf60f72014-03-03 22:48:31 -0500387 iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED"
Sean M. Collinsbb2908b2014-05-15 10:24:31 -0400388 iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED"
Salvatore33e8ee22014-10-05 01:36:34 +0200389
Sean Dague669c4fc2014-04-03 11:28:01 -0400390 # Orchestration Tests
391 if is_service_enabled heat; then
Rabi Mishra95560932016-02-01 13:20:18 +0530392 # Though this is not needed by heat, some tempest tests explicitly
393 # try to set this role. Removing them from the tempest tests breaks
394 # some non-devstack CIs.
395 get_or_create_role "heat_stack_owner"
396
Sean Dague669c4fc2014-04-03 11:28:01 -0400397 if [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then
Alessandro Pilottif3e75bf2014-12-15 20:02:08 +0200398 iniset $TEMPEST_CONFIG orchestration image_ref $(basename "${HEAT_CFN_IMAGE_URL%.*}")
Sean Dague669c4fc2014-04-03 11:28:01 -0400399 fi
Mathieu Rohon0c985c82016-02-25 10:00:36 +0000400 # Nova might not be enabled, especially when we want to test tempest scenario/API that only create Neutron resources
401 if is_service_enabled nova; then
402 # build a specialized heat flavor
403 available_flavors=$(nova flavor-list)
404 if [[ ! ( $available_flavors =~ 'm1.heat' ) ]]; then
405 nova flavor-create m1.heat 451 512 0 1
406 fi
407 iniset $TEMPEST_CONFIG orchestration instance_type "m1.heat"
Sean Dague669c4fc2014-04-03 11:28:01 -0400408 fi
Sean Dague669c4fc2014-04-03 11:28:01 -0400409 iniset $TEMPEST_CONFIG orchestration build_timeout 900
Rabi Mishra95560932016-02-01 13:20:18 +0530410 iniset $TEMPEST_CONFIG orchestration stack_owner_role "heat_stack_owner"
Steve Bakerd5cccad2013-07-19 10:34:24 +1200411 fi
412
William Marshall24d866e2013-07-02 12:26:31 -0500413 # Scenario
Matthew Treinishd2cb2342015-04-02 11:08:24 -0400414 SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES/images/cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-uec}
415 iniset $TEMPEST_CONFIG scenario img_dir $SCENARIO_IMAGE_DIR
Adalberto Medeiros53971532014-07-10 16:55:49 -0300416 iniset $TEMPEST_CONFIG scenario ami_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-blank.img"
417 iniset $TEMPEST_CONFIG scenario ari_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-initrd"
418 iniset $TEMPEST_CONFIG scenario aki_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-vmlinuz"
Matthew Treinishd2cb2342015-04-02 11:08:24 -0400419 iniset $TEMPEST_CONFIG scenario img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-disk.img"
William Marshall24d866e2013-07-02 12:26:31 -0500420
Vadim Rovachev2541d612014-05-29 18:48:10 +0400421 # Telemetry
gordon chung71e4e6f2015-03-16 16:33:01 -0400422 iniset $TEMPEST_CONFIG telemetry-feature-enabled events "True"
Vadim Rovachev2541d612014-05-29 18:48:10 +0400423
lanoux994db612015-08-03 13:48:12 +0000424 # Validation
425 iniset $TEMPEST_CONFIG validation run_validation ${TEMPEST_RUN_VALIDATION:-False}
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500426 iniset $TEMPEST_CONFIG validation ip_version_for_ssh 4
427 iniset $TEMPEST_CONFIG validation ssh_timeout $BUILD_TIMEOUT
428 iniset $TEMPEST_CONFIG validation image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
429 iniset $TEMPEST_CONFIG validation network_for_ssh $PRIVATE_NETWORK_NAME
lanoux994db612015-08-03 13:48:12 +0000430
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200431 # Volume
Oleksii Butenko881373c2016-06-21 17:29:54 +0300432 # TODO(obutenko): Remove snapshot_backup when liberty-eol happens.
433 iniset $TEMPEST_CONFIG volume-feature-enabled snapshot_backup True
Yuriy Nesenenkoaf8b6e12016-01-06 17:14:45 +0200434 # TODO(ynesenenko): Remove the volume_services flag when Liberty and Kilo will correct work with host info.
435 iniset $TEMPEST_CONFIG volume-feature-enabled volume_services True
Alex Meade06c7a442016-04-01 13:18:32 -0400436 # TODO(ameade): Remove the api_v3 flag when Mitaka and Liberty are end of life.
437 iniset $TEMPEST_CONFIG volume-feature-enabled api_v3 True
Alex Meade0c0c09a2016-05-13 10:57:29 -0400438 local tempest_volume_min_microversion=${TEMPEST_VOLUME_MIN_MICROVERSION:-None}
439 local tempest_volume_max_microversion=${TEMPEST_VOLUME_MAX_MICROVERSION:-"latest"}
440 if [ "$tempest_volume_min_microversion" == "None" ]; then
441 inicomment $TEMPEST_CONFIG volume min_microversion
442 else
443 iniset $TEMPEST_CONFIG volume min_microversion $tempest_volume_min_microversion
444 fi
445
446 if [ "$tempest_volume_max_microversion" == "None" ]; then
447 inicomment $TEMPEST_CONFIG volume max_microversion
448 else
449 iniset $TEMPEST_CONFIG volume max_microversion $tempest_volume_max_microversion
450 fi
David Kranzd1d66672015-06-11 13:09:37 -0400451
Giulio Fidente3d60f4d2014-02-20 16:43:49 +0100452 if ! is_service_enabled c-bak; then
453 iniset $TEMPEST_CONFIG volume-feature-enabled backup False
Giulio Fidente3632ab12013-09-10 02:51:26 +0200454 fi
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000455
Dean Troyerdc97cb72015-03-28 08:20:50 -0500456 # Using ``CINDER_ENABLED_BACKENDS``
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000457 if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
Matthew Treinishdb1c3842014-02-04 20:58:00 +0000458 iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000459 local i=1
460 local be
461 for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
462 local be_name=${be##*:}
463 iniset $TEMPEST_CONFIG volume "backend${i}_name" "$be_name"
464 i=$(( i + 1 ))
465 done
john-griffithdc4dc7f2014-01-22 18:09:32 -0700466 fi
467
Eric Harney01456482014-10-14 18:53:53 -0400468 if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
Patrick East1c0628f2014-10-22 16:22:47 -0700469 "$TEMPEST_VOLUME_VENDOR" != "$TEMPEST_DEFAULT_VOLUME_VENDOR" ]; then
Ed Balduf2f23d752014-07-29 14:42:27 -0600470 iniset $TEMPEST_CONFIG volume vendor_name "$TEMPEST_VOLUME_VENDOR"
Eric Harney01456482014-10-14 18:53:53 -0400471 fi
472 if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
JordanP82a7d932014-12-04 14:09:16 +0100473 "$TEMPEST_STORAGE_PROTOCOL" != "$TEMPEST_DEFAULT_STORAGE_PROTOCOL" ]; then
474 iniset $TEMPEST_CONFIG volume storage_protocol "$TEMPEST_STORAGE_PROTOCOL"
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200475 fi
476
Julie Pichonfea70f82013-07-29 11:22:08 +0100477 # Dashboard
john-griffithdc4dc7f2014-01-22 18:09:32 -0700478 iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/"
Julie Pichonfea70f82013-07-29 11:22:08 +0100479
Dean Troyerdc97cb72015-03-28 08:20:50 -0500480 # CLI
john-griffithdc4dc7f2014-01-22 18:09:32 -0700481 iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR
Ian Wienand7fa19022013-06-25 14:11:48 +1000482
Adam Gandelman43bd6672014-04-03 11:13:13 -0700483 # Baremetal
484 if [ "$VIRT_DRIVER" = "ironic" ] ; then
485 iniset $TEMPEST_CONFIG baremetal driver_enabled True
Michael Turekd091a2d2016-01-11 18:17:50 +0000486 iniset $TEMPEST_CONFIG baremetal unprovision_timeout $BUILD_TIMEOUT
487 iniset $TEMPEST_CONFIG baremetal active_timeout $BUILD_TIMEOUT
Mike Turekf90c8e12016-01-19 19:28:51 +0000488 iniset $TEMPEST_CONFIG baremetal deploywait_timeout $BUILD_TIMEOUT
Vladyslav Drok41309002015-04-29 13:36:52 +0300489 iniset $TEMPEST_CONFIG baremetal deploy_img_dir $FILES
490 iniset $TEMPEST_CONFIG baremetal node_uuid $IRONIC_NODE_UUID
Adam Gandelmanfdfe7a02014-07-24 10:06:18 -0400491 iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
492 iniset $TEMPEST_CONFIG compute-feature-enabled console_output False
493 iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
494 iniset $TEMPEST_CONFIG compute-feature-enabled live_migration False
495 iniset $TEMPEST_CONFIG compute-feature-enabled pause False
496 iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
497 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
498 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
499 iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
David Shrewsburycf21b712014-08-13 07:03:58 -0400500 iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
Adam Gandelman43bd6672014-04-03 11:13:13 -0700501 fi
502
Nels Nelson7b47c472015-01-05 16:36:42 -0600503 # Libvirt-LXC
504 if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
505 iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
506 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
Matt Riedemanncf94edc2015-10-28 09:50:01 -0700507 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
508 iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
Nels Nelson7b47c472015-01-05 16:36:42 -0600509 iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
510 fi
511
Dean Troyerdc97cb72015-03-28 08:20:50 -0500512 # ``service_available``
Sean Dague346edcc2015-08-26 09:38:37 -0400513 #
514 # this tempest service list needs to be all the services that
515 # tempest supports, otherwise we can have an erroneous set of
516 # defaults (something defaulting true in Tempest, but not listed here).
Sean Dague0f765352016-02-18 06:53:08 -0500517 local service
518 local tempest_services="key,glance,nova,neutron,cinder,swift,heat,ceilometer,horizon,sahara,ironic,trove"
519 for service in ${tempest_services//,/ }; do
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400520 if is_service_enabled $service ; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700521 iniset $TEMPEST_CONFIG service_available $service "True"
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400522 else
john-griffithdc4dc7f2014-01-22 18:09:32 -0700523 iniset $TEMPEST_CONFIG service_available $service "False"
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400524 fi
525 done
526
Matt Riedemanncf94edc2015-10-28 09:50:01 -0700527 if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
528 # libvirt-lxc does not support boot from volume or attaching volumes
529 # so basically anything with cinder is out of the question.
530 iniset $TEMPEST_CONFIG service_available cinder "False"
531 fi
532
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400533 # Run tempest configuration utilities. This must be done last during configuration to
534 # ensure as complete a config as possible already exists
535
536 # NOTE(mtreinish): Respect constraints on tempest verify-config venv
537 local tmp_cfg_file
538 tmp_cfg_file=$(mktemp)
539 cd $TEMPEST_DIR
540 if [[ "$OFFLINE" != "True" ]]; then
Matthew Treinish440464c2016-05-04 11:55:12 -0400541 tox -revenv-tempest --notest
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400542 fi
Matthew Treinish440464c2016-05-04 11:55:12 -0400543 tox -evenv-tempest -- pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400544
545 # Auth:
546 iniset $TEMPEST_CONFIG auth tempest_roles "Member"
547 if [[ $TEMPEST_USE_TEST_ACCOUNTS == "True" ]]; then
548 if [[ $TEMPEST_HAS_ADMIN == "True" ]]; then
Matthew Treinish440464c2016-05-04 11:55:12 -0400549 tox -evenv-tempest -- tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY --with-admin etc/accounts.yaml
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400550 else
Matthew Treinish440464c2016-05-04 11:55:12 -0400551 tox -evenv-tempest -- tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY etc/accounts.yaml
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400552 fi
553 iniset $TEMPEST_CONFIG auth use_dynamic_credentials False
554 iniset $TEMPEST_CONFIG auth test_accounts_file "etc/accounts.yaml"
555 elif [[ $TEMPEST_HAS_ADMIN == "False" ]]; then
556 iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
557
558 else
559 iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
560 fi
561
562 # API Extensions
563 # Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints
564 # NOTE(mtreinish): This must be done after auth settings are added to the tempest config
565 tox -evenv -- tempest verify-config -uro $tmp_cfg_file
566 # Nova API extensions
567 local compute_api_extensions=${COMPUTE_API_EXTENSIONS:-"all"}
568 if [[ ! -z "$DISABLE_COMPUTE_API_EXTENSIONS" ]]; then
569 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
570 compute_api_extensions=${COMPUTE_API_EXTENSIONS:-$(iniget $tmp_cfg_file compute-feature-enabled api_extensions | tr -d " ")}
571 # Remove disabled extensions
572 compute_api_extensions=$(remove_disabled_extensions $compute_api_extensions $DISABLE_COMPUTE_API_EXTENSIONS)
573 fi
574 iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions $compute_api_extensions
575 # Neutron API Extensions
576 local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
577 if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
578 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
579 network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
580 # Remove disabled extensions
581 network_api_extensions=$(remove_disabled_extensions $network_api_extensions $DISABLE_NETWORK_API_EXTENSIONS)
582 fi
583 iniset $TEMPEST_CONFIG network-feature-enabled api_extensions $network_api_extensions
584 # Swift API Extensions
585 local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
586 if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
587 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
588 object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
589 # Remove disabled extensions
590 object_storage_api_extensions=$(remove_disabled_extensions $object_storage_api_extensions $DISABLE_STORAGE_API_EXTENSIONS)
591 fi
592 iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis $object_storage_api_extensions
593 # Cinder API Extensions
594 local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
595 if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
596 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
597 volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
598 # Remove disabled extensions
599 volume_api_extensions=$(remove_disabled_extensions $volume_api_extensions $DISABLE_VOLUME_API_EXTENSIONS)
600 fi
601 iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions $volume_api_extensions
602
Attila Fazekas2aa35172012-12-05 20:03:40 +0100603 # Restore IFS
604 IFS=$ifs
Sean Dagued0931212012-10-04 16:06:44 -0400605}
606
Sean Dagued0931212012-10-04 16:06:44 -0400607# install_tempest() - Collect source and prepare
Ian Wienandaee18c72014-02-21 15:35:08 +1100608function install_tempest {
Sean Dagued0931212012-10-04 16:06:44 -0400609 git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
Clark Boylan33dc8692014-08-19 22:37:10 -0700610 pip_install tox
Matthew Treinish83e166b2015-02-18 19:01:20 -0500611 pushd $TEMPEST_DIR
612 tox --notest -efull
Matthew Treinish1e31e682016-02-09 23:50:54 -0500613 # NOTE(mtreinish) Respect constraints in the tempest full venv, things that
614 # are using a tox job other than full will not be respecting constraints but
615 # running pip install -U on tempest requirements
Matthew Treinish440464c2016-05-04 11:55:12 -0400616 $TEMPEST_DIR/.tox/tempest/bin/pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
617 PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/tempest
Matthew Treinish7e603d12016-06-01 18:16:14 -0400618 popd
619}
620
621# install_tempest_plugins() - Install any specified plugins into the tempest venv
622function install_tempest_plugins {
623 pushd $TEMPEST_DIR
Matthew Treinish440464c2016-05-04 11:55:12 -0400624 if [[ $TEMPEST_PLUGINS != 0 ]] ; then
625 tox -evenv-tempest -- pip install $TEMPEST_PLUGINS
Matthew Treinishb6558672016-05-20 17:30:17 -0400626 echo "Checking installed Tempest plugins:"
627 tox -evenv-tempest -- tempest list-plugins
Matthew Treinishb31640a2016-05-02 16:33:29 -0400628 fi
Matthew Treinish83e166b2015-02-18 19:01:20 -0500629 popd
Sean Dagued0931212012-10-04 16:06:44 -0400630}
631
Sean Dagued0931212012-10-04 16:06:44 -0400632# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +1100633$_XTRACE_TEMPEST
Sean Dague584d90e2013-03-29 14:34:53 -0400634
Adam Spiers6a5aa7c2013-10-24 11:27:02 +0100635# Tell emacs to use shell-script-mode
636## Local variables:
637## mode: shell-script
638## End: