blob: 128e9728fe8e726196b82266345d826b5fb95861 [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# - ``VIRT_DRIVER``
19# - ``LIBVIRT_TYPE``
20# - ``KEYSTONE_SERVICE_PROTOCOL``, ``KEYSTONE_SERVICE_HOST`` from lib/keystone
21#
Attila Fazekas2aa35172012-12-05 20:03:40 +010022# Optional Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010023#
Einst Crazyf54f60a2015-10-30 23:00:57 +080024# - ``ALT_*``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010025# - ``LIVE_MIGRATION_AVAILABLE``
26# - ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION``
27# - ``DEFAULT_INSTANCE_TYPE``
28# - ``DEFAULT_INSTANCE_USER``
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +000029# - ``CINDER_ENABLED_BACKENDS``
Matt Riedemann89ee5852015-07-09 13:25:04 -070030# - ``NOVA_ALLOW_DUPLICATE_NETWORKS``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010031#
Sean Dagued0931212012-10-04 16:06:44 -040032# ``stack.sh`` calls the entry points in this order:
33#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010034# - install_tempest
35# - configure_tempest
Sean Dagued0931212012-10-04 16:06:44 -040036
37# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +110038_XTRACE_TEMPEST=$(set +o | grep xtrace)
Sean Dagued0931212012-10-04 16:06:44 -040039set +o xtrace
40
Dean Troyer6d04fd72012-12-21 11:03:37 -060041
Sean Dagued0931212012-10-04 16:06:44 -040042# Defaults
43# --------
44
Sean Dagued0931212012-10-04 16:06:44 -040045# Set up default directories
46TEMPEST_DIR=$DEST/tempest
john-griffithdc4dc7f2014-01-22 18:09:32 -070047TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
48TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
Matthew Treinish14ccba02013-07-29 16:15:53 -040049TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
Attila Fazekas2aa35172012-12-05 20:03:40 +010050
Arx Cruz1bde9b42014-07-18 11:34:33 -030051# This is the timeout that tempest will wait for a VM to change state,
52# spawn, delete, etc.
53# The default is set to 196 seconds.
54BUILD_TIMEOUT=${BUILD_TIMEOUT:-196}
Sean Dagued0931212012-10-04 16:06:44 -040055
Joe Gordonc9b245b2015-02-10 14:32:39 -080056# This must be False on stable branches, as master tempest
57# deps do not match stable branch deps. Set this to True to
Dean Troyerdc97cb72015-03-28 08:20:50 -050058# have tempest installed in DevStack by default.
Matthew Treinishcb3cece2015-03-16 10:37:51 -040059INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"}
Joe Gordonc9b245b2015-02-10 14:32:39 -080060
Matthew Treinish440464c2016-05-04 11:55:12 -040061# This variable is passed directly to pip install inside the common tox venv
62# that is created
63TEMPEST_PLUGINS=${TEMPEST_PLUGINS:-0}
64
john-griffithdc4dc7f2014-01-22 18:09:32 -070065# Cinder/Volume variables
66TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
Eric Harney01456482014-10-14 18:53:53 -040067TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source"
68TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-$TEMPEST_DEFAULT_VOLUME_VENDOR}
69TEMPEST_DEFAULT_STORAGE_PROTOCOL="iSCSI"
70TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-$TEMPEST_DEFAULT_STORAGE_PROTOCOL}
Dean Troyercc6b4432013-04-08 15:38:03 -050071
armando-migliaccio71ef61a2014-02-19 22:19:24 -080072# Neutron/Network variables
Sean Dague53753292014-12-04 19:38:15 -050073IPV6_ENABLED=$(trueorfalse True IPV6_ENABLED)
74IPV6_SUBNET_ATTRIBUTES_ENABLED=$(trueorfalse True IPV6_SUBNET_ATTRIBUTES_ENABLED)
armando-migliaccio71ef61a2014-02-19 22:19:24 -080075
Matthew Treinishdf8f43b2015-08-09 20:30:39 -040076# Do we want to make a configuration where Tempest has admin on
77# the cloud. We don't always want to so that we can ensure Tempest
78# would work on a public cloud.
79TEMPEST_HAS_ADMIN=$(trueorfalse True TEMPEST_HAS_ADMIN)
80
81# Credential provider configuration option variables
82TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-$TEMPEST_HAS_ADMIN}
Matthew Treinish403fbb12015-08-24 21:17:37 -040083TEMPEST_USE_TEST_ACCOUNTS=$(trueorfalse False TEMPEST_USE_TEST_ACCOUNTS)
Matthew Treinishdf8f43b2015-08-09 20:30:39 -040084
85# The number of workers tempest is expected to be run with. This is used for
86# generating a accounts.yaml for running with test-accounts. This is also the
87# same variable that devstack-gate uses to specify the number of workers that
88# it will run tempest with
89TEMPEST_CONCURRENCY=${TEMPEST_CONCURRENCY:-$(nproc)}
90
Dean Troyerdc97cb72015-03-28 08:20:50 -050091
Dean Troyercc6b4432013-04-08 15:38:03 -050092# Functions
93# ---------
Sean Dagued0931212012-10-04 16:06:44 -040094
Salvatore33e8ee22014-10-05 01:36:34 +020095# remove_disabled_extension - removes disabled extensions from the list of extensions
96# to test for a given service
97function remove_disabled_extensions {
98 local extensions_list=$1
99 shift
100 local disabled_exts=$*
fumihiko kakuma8606c982015-04-13 09:55:06 +0900101 remove_disabled_services "$extensions_list" "$disabled_exts"
Salvatore33e8ee22014-10-05 01:36:34 +0200102}
103
Sean Dagued0931212012-10-04 16:06:44 -0400104# configure_tempest() - Set config files, create data dirs, etc
Ian Wienandaee18c72014-02-21 15:35:08 +1100105function configure_tempest {
Joe Gordonc9b245b2015-02-10 14:32:39 -0800106 if [[ "$INSTALL_TEMPEST" == "True" ]]; then
107 setup_develop $TEMPEST_DIR
108 else
109 # install testr since its used to process tempest logs
Sean Dague60996b12015-04-08 09:06:49 -0400110 pip_install_gr testrepository
Joe Gordonc9b245b2015-02-10 14:32:39 -0800111 fi
Joe Gordond5ac7852015-02-06 19:29:23 -0800112
Attila Fazekas65c08462012-12-07 14:20:51 +0100113 local image_lines
114 local images
115 local num_images
116 local image_uuid
117 local image_uuid_alt
Attila Fazekas65c08462012-12-07 14:20:51 +0100118 local password
119 local line
120 local flavors
Clark Boylan3b80bde2013-11-20 17:51:50 -0800121 local available_flavors
Attila Fazekas65c08462012-12-07 14:20:51 +0100122 local flavors_ref
123 local flavor_lines
Maru Newbya5c774e2012-12-10 10:40:01 +0000124 local public_network_id
Maru Newby31c94ab2012-12-19 03:59:20 +0000125 local public_router_id
Sean Dague5544c4a2016-01-25 08:27:06 -0500126 local ssh_connect_method="floating"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100127
Dean Troyer6d04fd72012-12-21 11:03:37 -0600128 # Save IFS
Attila Fazekas2aa35172012-12-05 20:03:40 +0100129 ifs=$IFS
130
131 # Glance should already contain images to be used in tempest
132 # testing. Here we simply look for images stored in Glance
133 # and set the appropriate variables for use in the tempest config
134 # We ignore ramdisk and kernel images, look for the default image
Attila Fazekas65c08462012-12-07 14:20:51 +0100135 # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the
136 # first image returned and set ``image_uuid_alt`` to the second,
Attila Fazekas2aa35172012-12-05 20:03:40 +0100137 # if there is more than one returned...
138 # ... Also ensure we only take active images, so we don't get snapshots in process
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500139 declare -a images
140
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200141 if is_service_enabled glance; then
142 while read -r IMAGE_NAME IMAGE_UUID; do
143 if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
144 image_uuid="$IMAGE_UUID"
145 image_uuid_alt="$IMAGE_UUID"
146 fi
147 images+=($IMAGE_UUID)
Swapnil Kulkarnia747cd22015-05-13 09:26:15 +0000148 done < <(openstack image list --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500149
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200150 case "${#images[*]}" in
151 0)
152 echo "Found no valid images to use!"
153 exit 1
154 ;;
155 1)
156 if [ -z "$image_uuid" ]; then
157 image_uuid=${images[0]}
158 image_uuid_alt=${images[0]}
159 fi
160 ;;
161 *)
162 if [ -z "$image_uuid" ]; then
163 image_uuid=${images[0]}
164 image_uuid_alt=${images[1]}
165 fi
166 ;;
167 esac
168 fi
Attila Fazekas2aa35172012-12-05 20:03:40 +0100169
Matthew Treinish93c10572015-07-31 10:38:50 -0400170 # (Re)create ``tempest.conf``
171 # Create every time because the image UUIDS are going to change
Dean Troyer8421c2b2015-03-16 13:52:19 -0500172 sudo install -d -o $STACK_USER $TEMPEST_CONFIG_DIR
Matthew Treinish93c10572015-07-31 10:38:50 -0400173 rm -f $TEMPEST_CONFIG
Attila Fazekas2aa35172012-12-05 20:03:40 +0100174
Balagopal7ed812c2016-03-01 04:43:31 +0000175 local password=${ADMIN_PASSWORD:-secret}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100176
Dean Troyerdc97cb72015-03-28 08:20:50 -0500177 # See ``lib/keystone`` where these users and tenants are set up
Sean Dague0f765352016-02-18 06:53:08 -0500178 local admin_username=${ADMIN_USERNAME:-admin}
Sean Dague76392b52016-04-04 09:07:08 -0400179 local admin_project_name=${ADMIN_TENANT_NAME:-admin}
Sean Dague0f765352016-02-18 06:53:08 -0500180 local admin_domain_name=${ADMIN_DOMAIN_NAME:-Default}
Sean Dague0f765352016-02-18 06:53:08 -0500181 local alt_username=${ALT_USERNAME:-alt_demo}
Sean Dague76392b52016-04-04 09:07:08 -0400182 local alt_project_name=${ALT_TENANT_NAME:-alt_demo}
183 local admin_project_id
184 admin_project_id=$(openstack project list | awk "/ admin / { print \$2 }")
Attila Fazekas2aa35172012-12-05 20:03:40 +0100185
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200186 if is_service_enabled nova; then
Dean Troyerdc97cb72015-03-28 08:20:50 -0500187 # If ``DEFAULT_INSTANCE_TYPE`` is not declared, use the new behavior
188 # Tempest creates its own instance types
Rafael Folco0b4c83a2015-11-26 10:08:36 -0600189 available_flavors=$(nova flavor-list)
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200190 if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200191 if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then
Jordan Pittier82fa9462016-11-02 11:15:42 +0100192 openstack flavor create --id 42 --ram 64 --disk 0 --vcpus 1 m1.nano
Rafael Folcoba0f1d32013-12-06 17:56:24 -0200193 fi
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200194 flavor_ref=42
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200195 if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then
Jordan Pittier82fa9462016-11-02 11:15:42 +0100196 openstack flavor create --id 84 --ram 128 --disk 0 --vcpus 1 m1.micro
Rafael Folcoba0f1d32013-12-06 17:56:24 -0200197 fi
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200198 flavor_ref_alt=84
199 else
Dean Troyerdc97cb72015-03-28 08:20:50 -0500200 # Check Nova for existing flavors, if ``DEFAULT_INSTANCE_TYPE`` is set use it.
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200201 IFS=$'\r\n'
202 flavors=""
Rafael Folco0b4c83a2015-11-26 10:08:36 -0600203 for line in $available_flavors; do
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200204 f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }")
205 flavors="$flavors $f"
206 done
Attila Fazekas2aa35172012-12-05 20:03:40 +0100207
Rafael Folco0b4c83a2015-11-26 10:08:36 -0600208 for line in $available_flavors; do
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200209 flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`"
210 done
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100211
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200212 IFS=" "
213 flavors=($flavors)
214 num_flavors=${#flavors[*]}
215 echo "Found $num_flavors flavors"
216 if [[ $num_flavors -eq 0 ]]; then
217 echo "Found no valid flavors to use!"
218 exit 1
Adalberto Medeiros63a71a22013-06-06 08:46:04 -0400219 fi
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200220 flavor_ref=${flavors[0]}
221 flavor_ref_alt=$flavor_ref
222
Dean Troyerdc97cb72015-03-28 08:20:50 -0500223 # Ensure ``flavor_ref`` and ``flavor_ref_alt`` have different values.
224 # Some resize instance in tempest tests depends on this.
Attila Fazekasc411fcf2014-08-19 16:48:14 +0200225 for f in ${flavors[@]:1}; do
226 if [[ $f -ne $flavor_ref ]]; then
227 flavor_ref_alt=$f
228 break
229 fi
230 done
231 fi
Attila Fazekas2aa35172012-12-05 20:03:40 +0100232 fi
233
Dan Smitha2ec7fd2016-08-10 11:14:00 -0700234 iniset $TEMPEST_CONFIG network project_network_cidr $FIXED_RANGE
235
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200236 ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
237
Armando Migliaccio53f59d82016-05-17 15:12:24 -0700238 # the public network (for floating ip access) is only available
239 # if the extension is enabled.
Eric Berglund8e142402016-11-29 17:33:28 -0600240 # If NEUTRON_CREATE_INITIAL_NETWORKS is not true, there is no network created
241 # and the public_network_id should not be set.
242 if [[ "$NEUTRON_CREATE_INITIAL_NETWORKS" == "True" ]] && is_networking_extension_supported 'external-net'; then
Jordan Pittierd038b602016-11-04 13:32:39 +0100243 public_network_id=$(openstack network show -f value -c id $PUBLIC_NETWORK_NAME)
Maru Newbya5c774e2012-12-10 10:40:01 +0000244 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"
Rodrigo Duarteb51a8862016-09-26 15:22:35 -0300262 iniset $TEMPEST_CONFIG identity user_lockout_failure_attempts $KEYSTONE_LOCKOUT_FAILURE_ATTEMPTS
263 iniset $TEMPEST_CONFIG identity user_lockout_duration $KEYSTONE_LOCKOUT_DURATION
264 iniset $TEMPEST_CONFIG identity user_unique_last_password_count $KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT
Andrea Frittoli (andreaf)5cda4912016-06-09 00:33:30 +0100265 # Use domain scoped tokens for admin v3 tests, v3 dynamic credentials of v3 account generation
266 iniset $TEMPEST_CONFIG identity admin_domain_scope True
Matthew Treinish7ced1502015-03-23 15:51:54 -0400267 if [[ "$TEMPEST_HAS_ADMIN" == "True" ]]; then
Sean Dague0f765352016-02-18 06:53:08 -0500268 iniset $TEMPEST_CONFIG auth admin_username $admin_username
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500269 iniset $TEMPEST_CONFIG auth admin_password "$password"
Castulo J. Martinez2d9959c2016-11-01 13:34:20 -0700270 iniset $TEMPEST_CONFIG auth admin_project_name $admin_project_name
Sean Dague0f765352016-02-18 06:53:08 -0500271 iniset $TEMPEST_CONFIG auth admin_domain_name $admin_domain_name
Matthew Treinish7ced1502015-03-23 15:51:54 -0400272 fi
Paulo Ewerton75bf9722016-01-22 19:13:31 +0000273 if [ "$ENABLE_IDENTITY_V2" == "True" ]; then
274 # Run Identity API v2 tests ONLY if needed
275 iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 True
Samuel de Medeiros Queiroz3fd71d62015-05-03 14:54:45 -0300276 iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
Paulo Ewerton75bf9722016-01-22 19:13:31 +0000277 else
278 # Skip Identity API v2 tests by default
279 iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 False
280 # Use v3 auth tokens for running all Tempest tests
281 iniset $TEMPEST_CONFIG identity auth_version v3
Samuel de Medeiros Queiroz3fd71d62015-05-03 14:54:45 -0300282 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
Rodrigo Duarteb51a8862016-09-26 15:22:35 -0300289 if [[ "$KEYSTONE_SECURITY_COMPLIANCE_ENABLED" = True ]]; then
290 iniset $TEMPEST_CONFIG identity-feature-enabled security_compliance True
291 fi
Rodrigo Duarte0578e422016-03-16 12:15:07 -0300292
Sean Daguec3771452013-06-13 14:23:37 -0400293 # Image
Dean Troyerdc97cb72015-03-28 08:20:50 -0500294 # We want to be able to override this variable in the gate to avoid
295 # doing an external HTTP fetch for this test.
Sean Daguec3771452013-06-13 14:23:37 -0400296 if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700297 iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
Sean Daguec3771452013-06-13 14:23:37 -0400298 fi
Bob Ball2dd761b2016-01-15 13:56:37 +0000299 if [ "$VIRT_DRIVER" = "xenserver" ]; then
300 iniset $TEMPEST_CONFIG image disk_formats "ami,ari,aki,vhd,raw,iso"
301 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 image_ref $image_uuid
john-griffithdc4dc7f2014-01-22 18:09:32 -0700311 iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt
john-griffithdc4dc7f2014-01-22 18:09:32 -0700312 iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref
313 iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt
Sean Dague563a7e72015-12-15 17:16:19 -0500314 iniset $TEMPEST_CONFIG validation connect_method $ssh_connect_method
Luigi Toscano4c813ac2016-09-21 19:39:36 +0200315 if ! is_service_enabled n-cell && ! is_service_enabled neutron; then
melanie wittf5b550e2015-04-10 22:20:07 +0000316 iniset $TEMPEST_CONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME
317 fi
Attila Fazekas97d3d202013-01-19 19:20:49 +0100318
Sean Dague8349aff2015-09-01 12:45:28 -0400319 # Set the service catalog entry for Tempest to run on. Typically
320 # used to try different compute API version targets. The tempest
321 # default if 'compute', which is typically valid, so only set this
322 # if you want to change it.
323 if [[ -n "$TEMPEST_COMPUTE_TYPE" ]]; then
324 iniset $TEMPEST_CONFIG compute catalog_type $TEMPEST_COMPUTE_TYPE
325 fi
326
Sean Daguede19bf92014-03-20 16:54:58 -0400327 # Compute Features
ghanshyam642b07b2015-11-19 10:01:14 +0900328 # Set the microversion range for compute tests.
329 # This is used to run the Nova microversions tests.
330 # Setting [None, latest] range of microversion which allow Tempest to run all microversions tests.
331 # NOTE- To avoid microversion tests failure on stable branch, we need to change "tempest_compute_max_microversion"
332 # for stable branch on each release which should be changed from "latest" to max supported version of that release.
333 local tempest_compute_min_microversion=${TEMPEST_COMPUTE_MIN_MICROVERSION:-None}
334 local tempest_compute_max_microversion=${TEMPEST_COMPUTE_MAX_MICROVERSION:-"latest"}
335 # Reset microversions to None where v2.0 is running which does not support microversion.
336 # Both "None" means no microversion testing.
337 if [[ "$TEMPEST_COMPUTE_TYPE" == "compute_legacy" ]]; then
338 tempest_compute_min_microversion=None
339 tempest_compute_max_microversion=None
340 fi
341 if [ "$tempest_compute_min_microversion" == "None" ]; then
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200342 inicomment $TEMPEST_CONFIG compute min_microversion
ghanshyam642b07b2015-11-19 10:01:14 +0900343 else
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200344 iniset $TEMPEST_CONFIG compute min_microversion $tempest_compute_min_microversion
ghanshyam642b07b2015-11-19 10:01:14 +0900345 fi
346 if [ "$tempest_compute_max_microversion" == "None" ]; then
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200347 inicomment $TEMPEST_CONFIG compute max_microversion
ghanshyam642b07b2015-11-19 10:01:14 +0900348 else
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200349 iniset $TEMPEST_CONFIG compute max_microversion $tempest_compute_max_microversion
ghanshyam642b07b2015-11-19 10:01:14 +0900350 fi
351
Matt Riedemann6d3670a2016-07-03 19:40:25 -0400352 iniset $TEMPEST_CONFIG compute-feature-enabled personality ${ENABLE_FILE_INJECTION:-False}
Sean Daguede19bf92014-03-20 16:54:58 -0400353 iniset $TEMPEST_CONFIG compute-feature-enabled resize True
Matthew Treinish270f93e2014-03-20 21:18:42 +0000354 iniset $TEMPEST_CONFIG compute-feature-enabled live_migration ${LIVE_MIGRATION_AVAILABLE:-False}
355 iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
356 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 -0700357 iniset $TEMPEST_CONFIG compute-feature-enabled attach_encrypted_volume ${ATTACH_ENCRYPTED_VOLUME_AVAILABLE:-True}
Chuck Carmack09b431d2015-09-02 14:27:58 +0000358 if is_service_enabled n-cell; then
359 # Cells doesn't support shelving/unshelving
360 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
Matt Riedemannc94403d2015-10-15 12:51:13 -0700361 # Cells doesn't support hot-plugging virtual interfaces.
362 iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
Matt Riedemann2bebf2d2016-04-05 10:34:42 -0400363 # Cells v1 doesn't support the rescue/unrescue tests in Tempest
364 iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
Matt Riedemann6cd616a2015-11-06 10:26:14 -0800365
366 if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
367 # Cells supports resize but does not currently work with devstack
368 # because of the custom flavors created for Tempest runs which are
369 # not in the cells database.
370 # TODO(mriedem): work on adding a nova-manage command to sync
371 # flavors into the cells database.
372 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
373 fi
Chuck Carmack09b431d2015-09-02 14:27:58 +0000374 fi
Sean Daguede19bf92014-03-20 16:54:58 -0400375
Michelle Mandel10db2b82016-07-20 11:39:42 -0400376 if is_service_enabled n-novnc; then
377 iniset $TEMPEST_CONFIG compute-feature-enabled vnc_console True
378 fi
379
Marian Horbanea21eb42015-08-18 06:57:18 -0400380 # Network
Jordan Pittierf5a50a02016-05-10 14:56:12 +0200381 iniset $TEMPEST_CONFIG network project_networks_reachable false
john-griffithdc4dc7f2014-01-22 18:09:32 -0700382 iniset $TEMPEST_CONFIG network public_network_id "$public_network_id"
383 iniset $TEMPEST_CONFIG network public_router_id "$public_router_id"
384 iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE"
Matthew Treinishccf60f72014-03-03 22:48:31 -0500385 iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED"
Sean M. Collinsbb2908b2014-05-15 10:24:31 -0400386 iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED"
Matt Riedemannc9c9d312016-09-15 20:33:22 -0400387 iniset $TEMPEST_CONFIG network-feature-enabled port_security $NEUTRON_PORT_SECURITY
Salvatore33e8ee22014-10-05 01:36:34 +0200388
Sean Dague669c4fc2014-04-03 11:28:01 -0400389 # Orchestration Tests
390 if is_service_enabled heat; then
391 if [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then
Alessandro Pilottif3e75bf2014-12-15 20:02:08 +0200392 iniset $TEMPEST_CONFIG orchestration image_ref $(basename "${HEAT_CFN_IMAGE_URL%.*}")
Sean Dague669c4fc2014-04-03 11:28:01 -0400393 fi
Mathieu Rohon0c985c82016-02-25 10:00:36 +0000394 # Nova might not be enabled, especially when we want to test tempest scenario/API that only create Neutron resources
395 if is_service_enabled nova; then
396 # build a specialized heat flavor
397 available_flavors=$(nova flavor-list)
398 if [[ ! ( $available_flavors =~ 'm1.heat' ) ]]; then
Jordan Pittier82fa9462016-11-02 11:15:42 +0100399 openstack flavor create --id 451 --ram 512 --disk 0 --vcpus 1 m1.heat
Mathieu Rohon0c985c82016-02-25 10:00:36 +0000400 fi
401 iniset $TEMPEST_CONFIG orchestration instance_type "m1.heat"
Sean Dague669c4fc2014-04-03 11:28:01 -0400402 fi
Sean Dague669c4fc2014-04-03 11:28:01 -0400403 iniset $TEMPEST_CONFIG orchestration build_timeout 900
Attila Fazekascac6ef02016-10-11 08:23:48 +0200404 iniset $TEMPEST_CONFIG orchestration stack_owner_role Member
Steve Bakerd5cccad2013-07-19 10:34:24 +1200405 fi
406
William Marshall24d866e2013-07-02 12:26:31 -0500407 # Scenario
Jianghua Wang2b3ac6d2016-11-09 12:50:00 +0800408 if [ "$VIRT_DRIVER" = "xenserver" ]; then
409 SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES}
410 SCENARIO_IMAGE_FILE="cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-disk.vhd.tgz"
411 iniset $TEMPEST_CONFIG scenario img_disk_format vhd
412 iniset $TEMPEST_CONFIG scenario img_container_format ovf
413 else
Matthew Treinish6fc332d2016-07-06 13:44:55 -0400414 SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES}
415 SCENARIO_IMAGE_FILE=$DEFAULT_IMAGE_NAME
Jianghua Wang2b3ac6d2016-11-09 12:50:00 +0800416 fi
Matthew Treinishd2cb2342015-04-02 11:08:24 -0400417 iniset $TEMPEST_CONFIG scenario img_dir $SCENARIO_IMAGE_DIR
Jianghua Wang2b3ac6d2016-11-09 12:50:00 +0800418 iniset $TEMPEST_CONFIG scenario img_file $SCENARIO_IMAGE_FILE
William Marshall24d866e2013-07-02 12:26:31 -0500419
Michael Turek7938d832016-04-12 14:55:21 -0400420 # If using provider networking, use the physical network for validation rather than private
421 TEMPEST_SSH_NETWORK_NAME=$PRIVATE_NETWORK_NAME
422 if is_provider_network; then
423 TEMPEST_SSH_NETWORK_NAME=$PHYSICAL_NETWORK
424 fi
lanoux994db612015-08-03 13:48:12 +0000425 # Validation
426 iniset $TEMPEST_CONFIG validation run_validation ${TEMPEST_RUN_VALIDATION:-False}
Matthew Treinishfbe0a622015-12-10 19:36:50 -0500427 iniset $TEMPEST_CONFIG validation ip_version_for_ssh 4
428 iniset $TEMPEST_CONFIG validation ssh_timeout $BUILD_TIMEOUT
429 iniset $TEMPEST_CONFIG validation image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
Michael Turek7938d832016-04-12 14:55:21 -0400430 iniset $TEMPEST_CONFIG validation network_for_ssh $TEMPEST_SSH_NETWORK_NAME
lanoux994db612015-08-03 13:48:12 +0000431
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200432 # Volume
Patrick East3eb7c972017-01-13 11:44:54 -0800433 # Only turn on TEMPEST_VOLUME_MANAGE_SNAPSHOT by default for "lvm" backends
434 if [[ "$CINDER_ENABLED_BACKENDS" == *"lvm"* ]]; then
435 TEMPEST_VOLUME_MANAGE_SNAPSHOT=${TEMPEST_VOLUME_MANAGE_SNAPSHOT:-True}
436 fi
437 iniset $TEMPEST_CONFIG volume-feature-enabled manage_snapshot $(trueorfalse False TEMPEST_VOLUME_MANAGE_SNAPSHOT)
Jordan Pittier18682322016-12-28 23:12:42 +0100438
Alex Meade06c7a442016-04-01 13:18:32 -0400439 # TODO(ameade): Remove the api_v3 flag when Mitaka and Liberty are end of life.
440 iniset $TEMPEST_CONFIG volume-feature-enabled api_v3 True
Jordan Pittier88312fa2017-02-15 16:48:04 +0100441 iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 $(trueorfalse False TEMPEST_VOLUME_API_V1)
Alex Meade0c0c09a2016-05-13 10:57:29 -0400442 local tempest_volume_min_microversion=${TEMPEST_VOLUME_MIN_MICROVERSION:-None}
443 local tempest_volume_max_microversion=${TEMPEST_VOLUME_MAX_MICROVERSION:-"latest"}
444 if [ "$tempest_volume_min_microversion" == "None" ]; then
445 inicomment $TEMPEST_CONFIG volume min_microversion
446 else
447 iniset $TEMPEST_CONFIG volume min_microversion $tempest_volume_min_microversion
448 fi
449
450 if [ "$tempest_volume_max_microversion" == "None" ]; then
451 inicomment $TEMPEST_CONFIG volume max_microversion
452 else
453 iniset $TEMPEST_CONFIG volume max_microversion $tempest_volume_max_microversion
454 fi
David Kranzd1d66672015-06-11 13:09:37 -0400455
Giulio Fidente3d60f4d2014-02-20 16:43:49 +0100456 if ! is_service_enabled c-bak; then
457 iniset $TEMPEST_CONFIG volume-feature-enabled backup False
Giulio Fidente3632ab12013-09-10 02:51:26 +0200458 fi
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000459
Dean Troyerdc97cb72015-03-28 08:20:50 -0500460 # Using ``CINDER_ENABLED_BACKENDS``
bkopilov3ac1ea82016-06-06 16:00:48 +0300461 # Cinder uses a comma separated list with "type:backend_name":
462 # CINDER_ENABLED_BACKENDS = ceph:cephBE1,lvm:lvmBE2,foo:my_foo
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000463 if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
bkopilov3ac1ea82016-06-06 16:00:48 +0300464 # We have at least 2 backends
Matthew Treinishdb1c3842014-02-04 20:58:00 +0000465 iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
bkopilov3ac1ea82016-06-06 16:00:48 +0300466 local add_comma_seperator=0
467 local backends_list=''
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000468 local be
bkopilov3ac1ea82016-06-06 16:00:48 +0300469 # Tempest uses a comma separated list of backend_names:
470 # backend_names = BACKEND_1,BACKEND_2
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000471 for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
bkopilov3ac1ea82016-06-06 16:00:48 +0300472 if [ "$add_comma_seperator" -eq "1" ]; then
473 backends_list+=,${be##*:}
474 else
475 # first element in the list
476 backends_list+=${be##*:}
477 add_comma_seperator=1
478 fi
Swapnil Kulkarni09fb7ba2014-10-16 06:30:28 +0000479 done
bkopilov3ac1ea82016-06-06 16:00:48 +0300480 iniset $TEMPEST_CONFIG volume "backend_names" "$backends_list"
john-griffithdc4dc7f2014-01-22 18:09:32 -0700481 fi
482
Eric Harney01456482014-10-14 18:53:53 -0400483 if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
Patrick East1c0628f2014-10-22 16:22:47 -0700484 "$TEMPEST_VOLUME_VENDOR" != "$TEMPEST_DEFAULT_VOLUME_VENDOR" ]; then
Ed Balduf2f23d752014-07-29 14:42:27 -0600485 iniset $TEMPEST_CONFIG volume vendor_name "$TEMPEST_VOLUME_VENDOR"
Eric Harney01456482014-10-14 18:53:53 -0400486 fi
487 if [ $TEMPEST_VOLUME_DRIVER != "default" -o \
JordanP82a7d932014-12-04 14:09:16 +0100488 "$TEMPEST_STORAGE_PROTOCOL" != "$TEMPEST_DEFAULT_STORAGE_PROTOCOL" ]; then
489 iniset $TEMPEST_CONFIG volume storage_protocol "$TEMPEST_STORAGE_PROTOCOL"
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200490 fi
491
Adam Gandelman43bd6672014-04-03 11:13:13 -0700492 # Baremetal
493 if [ "$VIRT_DRIVER" = "ironic" ] ; then
Adam Gandelmanfdfe7a02014-07-24 10:06:18 -0400494 iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
495 iniset $TEMPEST_CONFIG compute-feature-enabled console_output False
496 iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
497 iniset $TEMPEST_CONFIG compute-feature-enabled live_migration False
498 iniset $TEMPEST_CONFIG compute-feature-enabled pause False
499 iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
500 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
501 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
502 iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
David Shrewsburycf21b712014-08-13 07:03:58 -0400503 iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
Adam Gandelman43bd6672014-04-03 11:13:13 -0700504 fi
505
Matt Riedemann92575ba2016-09-21 16:15:31 -0400506 # Libvirt
507 if [ "$VIRT_DRIVER" = "libvirt" ]; then
508 # Libvirt-LXC
509 if [ "$LIBVIRT_TYPE" = "lxc" ]; then
510 iniset $TEMPEST_CONFIG compute-feature-enabled rescue False
511 iniset $TEMPEST_CONFIG compute-feature-enabled resize False
512 iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
513 iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False
514 iniset $TEMPEST_CONFIG compute-feature-enabled suspend False
Matt Riedemanne9a9fbe2017-01-30 22:22:43 -0500515 elif ! is_service_enabled n-cell; then
516 # cells v1 does not support swapping volumes
517 iniset $TEMPEST_CONFIG compute-feature-enabled swap_volume True
Matt Riedemann92575ba2016-09-21 16:15:31 -0400518 fi
Nels Nelson7b47c472015-01-05 16:36:42 -0600519 fi
520
Dean Troyerdc97cb72015-03-28 08:20:50 -0500521 # ``service_available``
Sean Dague346edcc2015-08-26 09:38:37 -0400522 #
523 # this tempest service list needs to be all the services that
524 # tempest supports, otherwise we can have an erroneous set of
525 # defaults (something defaulting true in Tempest, but not listed here).
Sean Dague0f765352016-02-18 06:53:08 -0500526 local service
527 local tempest_services="key,glance,nova,neutron,cinder,swift,heat,ceilometer,horizon,sahara,ironic,trove"
528 for service in ${tempest_services//,/ }; do
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400529 if is_service_enabled $service ; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700530 iniset $TEMPEST_CONFIG service_available $service "True"
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400531 else
john-griffithdc4dc7f2014-01-22 18:09:32 -0700532 iniset $TEMPEST_CONFIG service_available $service "False"
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400533 fi
534 done
535
Matt Riedemanncf94edc2015-10-28 09:50:01 -0700536 if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
537 # libvirt-lxc does not support boot from volume or attaching volumes
538 # so basically anything with cinder is out of the question.
539 iniset $TEMPEST_CONFIG service_available cinder "False"
540 fi
541
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400542 # Run tempest configuration utilities. This must be done last during configuration to
543 # ensure as complete a config as possible already exists
544
545 # NOTE(mtreinish): Respect constraints on tempest verify-config venv
546 local tmp_cfg_file
547 tmp_cfg_file=$(mktemp)
548 cd $TEMPEST_DIR
549 if [[ "$OFFLINE" != "True" ]]; then
Matthew Treinish440464c2016-05-04 11:55:12 -0400550 tox -revenv-tempest --notest
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400551 fi
Matthew Treinish440464c2016-05-04 11:55:12 -0400552 tox -evenv-tempest -- pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400553
554 # Auth:
555 iniset $TEMPEST_CONFIG auth tempest_roles "Member"
556 if [[ $TEMPEST_USE_TEST_ACCOUNTS == "True" ]]; then
557 if [[ $TEMPEST_HAS_ADMIN == "True" ]]; then
Matthew Treinish440464c2016-05-04 11:55:12 -0400558 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 -0400559 else
Matthew Treinish440464c2016-05-04 11:55:12 -0400560 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 -0400561 fi
562 iniset $TEMPEST_CONFIG auth use_dynamic_credentials False
563 iniset $TEMPEST_CONFIG auth test_accounts_file "etc/accounts.yaml"
564 elif [[ $TEMPEST_HAS_ADMIN == "False" ]]; then
565 iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
566
567 else
568 iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
569 fi
570
571 # API Extensions
572 # Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints
573 # NOTE(mtreinish): This must be done after auth settings are added to the tempest config
574 tox -evenv -- tempest verify-config -uro $tmp_cfg_file
Sean Dague7b229352016-08-09 13:29:11 -0400575
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400576 # Neutron API Extensions
Sean Dague894ccc92016-08-08 16:19:05 -0400577
578 # disable metering if we didn't enable the service
579 if ! is_service_enabled q-metering; then
580 DISABLE_NETWORK_API_EXTENSIONS+=", metering"
581 fi
582
Matthew Treinishe8f3f7a2016-04-11 12:52:39 -0400583 local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
584 if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
585 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
586 network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
587 # Remove disabled extensions
588 network_api_extensions=$(remove_disabled_extensions $network_api_extensions $DISABLE_NETWORK_API_EXTENSIONS)
589 fi
590 iniset $TEMPEST_CONFIG network-feature-enabled api_extensions $network_api_extensions
591 # Swift API Extensions
592 local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
593 if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
594 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
595 object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
596 # Remove disabled extensions
597 object_storage_api_extensions=$(remove_disabled_extensions $object_storage_api_extensions $DISABLE_STORAGE_API_EXTENSIONS)
598 fi
599 iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis $object_storage_api_extensions
600 # Cinder API Extensions
601 local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
602 if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
603 # Enabled extensions are either the ones explicitly specified or those available on the API endpoint
604 volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
605 # Remove disabled extensions
606 volume_api_extensions=$(remove_disabled_extensions $volume_api_extensions $DISABLE_VOLUME_API_EXTENSIONS)
607 fi
608 iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions $volume_api_extensions
609
Attila Fazekas2aa35172012-12-05 20:03:40 +0100610 # Restore IFS
611 IFS=$ifs
Sean Dagued0931212012-10-04 16:06:44 -0400612}
613
Sean Dagued0931212012-10-04 16:06:44 -0400614# install_tempest() - Collect source and prepare
Ian Wienandaee18c72014-02-21 15:35:08 +1100615function install_tempest {
Sean Dagued0931212012-10-04 16:06:44 -0400616 git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
Clark Boylan33dc8692014-08-19 22:37:10 -0700617 pip_install tox
Matthew Treinish83e166b2015-02-18 19:01:20 -0500618 pushd $TEMPEST_DIR
619 tox --notest -efull
Matthew Treinish1e31e682016-02-09 23:50:54 -0500620 # NOTE(mtreinish) Respect constraints in the tempest full venv, things that
621 # are using a tox job other than full will not be respecting constraints but
622 # running pip install -U on tempest requirements
Matthew Treinish440464c2016-05-04 11:55:12 -0400623 $TEMPEST_DIR/.tox/tempest/bin/pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
624 PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/tempest
Matthew Treinish7e603d12016-06-01 18:16:14 -0400625 popd
626}
627
628# install_tempest_plugins() - Install any specified plugins into the tempest venv
629function install_tempest_plugins {
630 pushd $TEMPEST_DIR
Matthew Treinish440464c2016-05-04 11:55:12 -0400631 if [[ $TEMPEST_PLUGINS != 0 ]] ; then
632 tox -evenv-tempest -- pip install $TEMPEST_PLUGINS
Matthew Treinishb6558672016-05-20 17:30:17 -0400633 echo "Checking installed Tempest plugins:"
634 tox -evenv-tempest -- tempest list-plugins
Matthew Treinishb31640a2016-05-02 16:33:29 -0400635 fi
Matthew Treinish83e166b2015-02-18 19:01:20 -0500636 popd
Sean Dagued0931212012-10-04 16:06:44 -0400637}
638
Sean Dagued0931212012-10-04 16:06:44 -0400639# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +1100640$_XTRACE_TEMPEST
Sean Dague584d90e2013-03-29 14:34:53 -0400641
Adam Spiers6a5aa7c2013-10-24 11:27:02 +0100642# Tell emacs to use shell-script-mode
643## Local variables:
644## mode: shell-script
645## End: