| Sean Dague | e263c82 | 2014-12-05 14:25:28 -0500 | [diff] [blame] | 1 | #!/bin/bash | 
 | 2 | # | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 3 | # lib/tempest | 
| Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 4 | # Install and configure Tempest | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 5 |  | 
 | 6 | # Dependencies: | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 7 | # | 
 | 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`` | 
| Matthew Treinish | befe092 | 2017-02-16 15:45:11 -0500 | [diff] [blame] | 14 | #   - ``DEFAULT_IMAGE_FILE_NAME`` | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 15 | #   - ``S3_SERVICE_PORT`` | 
 | 16 | #   - ``SERVICE_HOST`` | 
 | 17 | #   - ``BASE_SQL_CONN`` ``lib/database`` declares | 
 | 18 | #   - ``PUBLIC_NETWORK_NAME`` | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 19 | #   - ``VIRT_DRIVER`` | 
 | 20 | #   - ``LIBVIRT_TYPE`` | 
| Brant Knudson | c2c89e4 | 2017-02-23 20:15:47 -0600 | [diff] [blame] | 21 | #   - ``KEYSTONE_SERVICE_URI``, ``KEYSTONE_SERVICE_URI_V3`` from lib/keystone | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 22 | # | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 23 | # Optional Dependencies: | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 24 | # | 
| Einst Crazy | f54f60a | 2015-10-30 23:00:57 +0800 | [diff] [blame] | 25 | # - ``ALT_*`` | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 26 | # - ``LIVE_MIGRATION_AVAILABLE`` | 
 | 27 | # - ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION`` | 
 | 28 | # - ``DEFAULT_INSTANCE_TYPE`` | 
 | 29 | # - ``DEFAULT_INSTANCE_USER`` | 
| Swapnil Kulkarni | 09fb7ba | 2014-10-16 06:30:28 +0000 | [diff] [blame] | 30 | # - ``CINDER_ENABLED_BACKENDS`` | 
| Matt Riedemann | 89ee585 | 2015-07-09 13:25:04 -0700 | [diff] [blame] | 31 | # - ``NOVA_ALLOW_DUPLICATE_NETWORKS`` | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 32 | # | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 33 | # ``stack.sh`` calls the entry points in this order: | 
 | 34 | # | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 35 | # - install_tempest | 
 | 36 | # - configure_tempest | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 37 |  | 
 | 38 | # Save trace setting | 
| Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 39 | _XTRACE_TEMPEST=$(set +o | grep xtrace) | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 40 | set +o xtrace | 
 | 41 |  | 
| Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 42 |  | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 43 | # Defaults | 
 | 44 | # -------- | 
 | 45 |  | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 46 | # Set up default directories | 
 | 47 | TEMPEST_DIR=$DEST/tempest | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 48 | TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc} | 
 | 49 | TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf | 
| Matthew Treinish | 14ccba0 | 2013-07-29 16:15:53 -0400 | [diff] [blame] | 50 | TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest} | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 51 |  | 
| Arx Cruz | 1bde9b4 | 2014-07-18 11:34:33 -0300 | [diff] [blame] | 52 | # This is the timeout that tempest will wait for a VM to change state, | 
 | 53 | # spawn, delete, etc. | 
 | 54 | # The default is set to 196 seconds. | 
 | 55 | BUILD_TIMEOUT=${BUILD_TIMEOUT:-196} | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 56 |  | 
| Joe Gordon | c9b245b | 2015-02-10 14:32:39 -0800 | [diff] [blame] | 57 | # This must be False on stable branches, as master tempest | 
 | 58 | # deps do not match stable branch deps. Set this to True to | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 59 | # have tempest installed in DevStack by default. | 
| Matthew Treinish | cb3cece | 2015-03-16 10:37:51 -0400 | [diff] [blame] | 60 | INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"} | 
| Joe Gordon | c9b245b | 2015-02-10 14:32:39 -0800 | [diff] [blame] | 61 |  | 
| Matthew Treinish | 440464c | 2016-05-04 11:55:12 -0400 | [diff] [blame] | 62 | # This variable is passed directly to pip install inside the common tox venv | 
 | 63 | # that is created | 
 | 64 | TEMPEST_PLUGINS=${TEMPEST_PLUGINS:-0} | 
 | 65 |  | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 66 | # Cinder/Volume variables | 
 | 67 | TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default} | 
| Eric Harney | 0145648 | 2014-10-14 18:53:53 -0400 | [diff] [blame] | 68 | TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source" | 
 | 69 | TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-$TEMPEST_DEFAULT_VOLUME_VENDOR} | 
 | 70 | TEMPEST_DEFAULT_STORAGE_PROTOCOL="iSCSI" | 
 | 71 | TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-$TEMPEST_DEFAULT_STORAGE_PROTOCOL} | 
| Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 72 |  | 
| armando-migliaccio | 71ef61a | 2014-02-19 22:19:24 -0800 | [diff] [blame] | 73 | # Neutron/Network variables | 
| Sean Dague | 5375329 | 2014-12-04 19:38:15 -0500 | [diff] [blame] | 74 | IPV6_ENABLED=$(trueorfalse True IPV6_ENABLED) | 
 | 75 | IPV6_SUBNET_ATTRIBUTES_ENABLED=$(trueorfalse True IPV6_SUBNET_ATTRIBUTES_ENABLED) | 
| armando-migliaccio | 71ef61a | 2014-02-19 22:19:24 -0800 | [diff] [blame] | 76 |  | 
| Matthew Treinish | df8f43b | 2015-08-09 20:30:39 -0400 | [diff] [blame] | 77 | # Do we want to make a configuration where Tempest has admin on | 
 | 78 | # the cloud. We don't always want to so that we can ensure Tempest | 
 | 79 | # would work on a public cloud. | 
 | 80 | TEMPEST_HAS_ADMIN=$(trueorfalse True TEMPEST_HAS_ADMIN) | 
 | 81 |  | 
 | 82 | # Credential provider configuration option variables | 
 | 83 | TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-$TEMPEST_HAS_ADMIN} | 
| Matthew Treinish | 403fbb1 | 2015-08-24 21:17:37 -0400 | [diff] [blame] | 84 | TEMPEST_USE_TEST_ACCOUNTS=$(trueorfalse False TEMPEST_USE_TEST_ACCOUNTS) | 
| Matthew Treinish | df8f43b | 2015-08-09 20:30:39 -0400 | [diff] [blame] | 85 |  | 
 | 86 | # The number of workers tempest is expected to be run with. This is used for | 
 | 87 | # generating a accounts.yaml for running with test-accounts. This is also the | 
 | 88 | # same variable that devstack-gate uses to specify the number of workers that | 
 | 89 | # it will run tempest with | 
 | 90 | TEMPEST_CONCURRENCY=${TEMPEST_CONCURRENCY:-$(nproc)} | 
 | 91 |  | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 92 |  | 
| Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 93 | # Functions | 
 | 94 | # --------- | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 95 |  | 
| Salvatore | 33e8ee2 | 2014-10-05 01:36:34 +0200 | [diff] [blame] | 96 | # remove_disabled_extension - removes disabled extensions from the list of extensions | 
 | 97 | # to test for a given service | 
 | 98 | function remove_disabled_extensions { | 
 | 99 |     local extensions_list=$1 | 
 | 100 |     shift | 
 | 101 |     local disabled_exts=$* | 
| fumihiko kakuma | 8606c98 | 2015-04-13 09:55:06 +0900 | [diff] [blame] | 102 |     remove_disabled_services "$extensions_list" "$disabled_exts" | 
| Salvatore | 33e8ee2 | 2014-10-05 01:36:34 +0200 | [diff] [blame] | 103 | } | 
 | 104 |  | 
| Matt Riedemann | 23d33a8 | 2018-11-21 12:10:32 -0500 | [diff] [blame] | 105 | # image_size_in_gib - converts an image size from bytes to GiB, rounded up | 
 | 106 | # Takes an image ID parameter as input | 
 | 107 | function image_size_in_gib { | 
 | 108 |     local size | 
 | 109 |     size=$(openstack image show $1 -c size -f value) | 
 | 110 |     echo $size | python -c "import math; print int(math.ceil(float(int(raw_input()) / 1024.0 ** 3)))" | 
 | 111 | } | 
 | 112 |  | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 113 | # configure_tempest() - Set config files, create data dirs, etc | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 114 | function configure_tempest { | 
| Joe Gordon | c9b245b | 2015-02-10 14:32:39 -0800 | [diff] [blame] | 115 |     if [[ "$INSTALL_TEMPEST" == "True" ]]; then | 
 | 116 |         setup_develop $TEMPEST_DIR | 
 | 117 |     else | 
 | 118 |         # install testr since its used to process tempest logs | 
| Sean Dague | 60996b1 | 2015-04-08 09:06:49 -0400 | [diff] [blame] | 119 |         pip_install_gr testrepository | 
| Joe Gordon | c9b245b | 2015-02-10 14:32:39 -0800 | [diff] [blame] | 120 |     fi | 
| Joe Gordon | d5ac785 | 2015-02-06 19:29:23 -0800 | [diff] [blame] | 121 |  | 
| Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 122 |     local image_lines | 
 | 123 |     local images | 
 | 124 |     local num_images | 
 | 125 |     local image_uuid | 
 | 126 |     local image_uuid_alt | 
| Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 127 |     local password | 
 | 128 |     local line | 
 | 129 |     local flavors | 
| Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 130 |     local available_flavors | 
| Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 131 |     local flavors_ref | 
 | 132 |     local flavor_lines | 
| Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 133 |     local public_network_id | 
| Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 134 |     local public_router_id | 
| Sean Dague | 5544c4a | 2016-01-25 08:27:06 -0500 | [diff] [blame] | 135 |     local ssh_connect_method="floating" | 
| Matt Riedemann | 23d33a8 | 2018-11-21 12:10:32 -0500 | [diff] [blame] | 136 |     local disk | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 137 |  | 
| Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 138 |     # Save IFS | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 139 |     ifs=$IFS | 
 | 140 |  | 
 | 141 |     # Glance should already contain images to be used in tempest | 
 | 142 |     # testing. Here we simply look for images stored in Glance | 
 | 143 |     # and set the appropriate variables for use in the tempest config | 
 | 144 |     # We ignore ramdisk and kernel images, look for the default image | 
| Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 145 |     # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the | 
 | 146 |     # first image returned and set ``image_uuid_alt`` to the second, | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 147 |     # if there is more than one returned... | 
 | 148 |     # ... Also ensure we only take active images, so we don't get snapshots in process | 
| Cody A.W. Somerville | c24e23b | 2012-12-21 02:10:45 -0500 | [diff] [blame] | 149 |     declare -a images | 
 | 150 |  | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 151 |     if is_service_enabled glance; then | 
 | 152 |         while read -r IMAGE_NAME IMAGE_UUID; do | 
 | 153 |             if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then | 
 | 154 |                 image_uuid="$IMAGE_UUID" | 
 | 155 |                 image_uuid_alt="$IMAGE_UUID" | 
 | 156 |             fi | 
 | 157 |             images+=($IMAGE_UUID) | 
| Swapnil Kulkarni | a747cd2 | 2015-05-13 09:26:15 +0000 | [diff] [blame] | 158 |         done < <(openstack image list --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }') | 
| Cody A.W. Somerville | c24e23b | 2012-12-21 02:10:45 -0500 | [diff] [blame] | 159 |  | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 160 |         case "${#images[*]}" in | 
 | 161 |             0) | 
 | 162 |                 echo "Found no valid images to use!" | 
 | 163 |                 exit 1 | 
 | 164 |                 ;; | 
 | 165 |             1) | 
 | 166 |                 if [ -z "$image_uuid" ]; then | 
 | 167 |                     image_uuid=${images[0]} | 
 | 168 |                     image_uuid_alt=${images[0]} | 
 | 169 |                 fi | 
 | 170 |                 ;; | 
 | 171 |             *) | 
 | 172 |                 if [ -z "$image_uuid" ]; then | 
 | 173 |                     image_uuid=${images[0]} | 
 | 174 |                     image_uuid_alt=${images[1]} | 
 | 175 |                 fi | 
 | 176 |                 ;; | 
 | 177 |         esac | 
 | 178 |     fi | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 179 |  | 
| Matthew Treinish | 93c1057 | 2015-07-31 10:38:50 -0400 | [diff] [blame] | 180 |     # (Re)create ``tempest.conf`` | 
 | 181 |     # Create every time because the image UUIDS are going to change | 
| Dean Troyer | 8421c2b | 2015-03-16 13:52:19 -0500 | [diff] [blame] | 182 |     sudo install -d -o $STACK_USER $TEMPEST_CONFIG_DIR | 
| Matthew Treinish | 93c1057 | 2015-07-31 10:38:50 -0400 | [diff] [blame] | 183 |     rm -f $TEMPEST_CONFIG | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 184 |  | 
| Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 185 |     local password=${ADMIN_PASSWORD:-secret} | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 186 |  | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 187 |     # See ``lib/keystone`` where these users and tenants are set up | 
| Sean Dague | 0f76535 | 2016-02-18 06:53:08 -0500 | [diff] [blame] | 188 |     local admin_username=${ADMIN_USERNAME:-admin} | 
| Sean Dague | 76392b5 | 2016-04-04 09:07:08 -0400 | [diff] [blame] | 189 |     local admin_project_name=${ADMIN_TENANT_NAME:-admin} | 
| Sean Dague | 0f76535 | 2016-02-18 06:53:08 -0500 | [diff] [blame] | 190 |     local admin_domain_name=${ADMIN_DOMAIN_NAME:-Default} | 
| Sean Dague | 0f76535 | 2016-02-18 06:53:08 -0500 | [diff] [blame] | 191 |     local alt_username=${ALT_USERNAME:-alt_demo} | 
| Sean Dague | 76392b5 | 2016-04-04 09:07:08 -0400 | [diff] [blame] | 192 |     local alt_project_name=${ALT_TENANT_NAME:-alt_demo} | 
 | 193 |     local admin_project_id | 
 | 194 |     admin_project_id=$(openstack project list | awk "/ admin / { print \$2 }") | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 195 |  | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 196 |     if is_service_enabled nova; then | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 197 |         # If ``DEFAULT_INSTANCE_TYPE`` is not declared, use the new behavior | 
 | 198 |         # Tempest creates its own instance types | 
| Rafael Folco | 0b4c83a | 2015-11-26 10:08:36 -0600 | [diff] [blame] | 199 |         available_flavors=$(nova flavor-list) | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 200 |         if  [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 201 |             if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then | 
| Matt Riedemann | 23d33a8 | 2018-11-21 12:10:32 -0500 | [diff] [blame] | 202 |                 # Determine the flavor disk size based on the image size. | 
 | 203 |                 disk=$(image_size_in_gib $image_uuid) | 
 | 204 |                 openstack flavor create --id 42 --ram 64 --disk $disk --vcpus 1 m1.nano | 
| Rafael Folco | ba0f1d3 | 2013-12-06 17:56:24 -0200 | [diff] [blame] | 205 |             fi | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 206 |             flavor_ref=42 | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 207 |             if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then | 
| Matt Riedemann | 23d33a8 | 2018-11-21 12:10:32 -0500 | [diff] [blame] | 208 |                 # Determine the alt flavor disk size based on the alt image size. | 
 | 209 |                 disk=$(image_size_in_gib $image_uuid_alt) | 
 | 210 |                 openstack flavor create --id 84 --ram 128 --disk $disk --vcpus 1 m1.micro | 
| Rafael Folco | ba0f1d3 | 2013-12-06 17:56:24 -0200 | [diff] [blame] | 211 |             fi | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 212 |             flavor_ref_alt=84 | 
 | 213 |         else | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 214 |             # Check Nova for existing flavors, if ``DEFAULT_INSTANCE_TYPE`` is set use it. | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 215 |             IFS=$'\r\n' | 
 | 216 |             flavors="" | 
| Rafael Folco | 0b4c83a | 2015-11-26 10:08:36 -0600 | [diff] [blame] | 217 |             for line in $available_flavors; do | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 218 |                 f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }") | 
 | 219 |                 flavors="$flavors $f" | 
 | 220 |             done | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 221 |  | 
| Rafael Folco | 0b4c83a | 2015-11-26 10:08:36 -0600 | [diff] [blame] | 222 |             for line in $available_flavors; do | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 223 |                 flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`" | 
 | 224 |             done | 
| Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 225 |  | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 226 |             IFS=" " | 
 | 227 |             flavors=($flavors) | 
 | 228 |             num_flavors=${#flavors[*]} | 
 | 229 |             echo "Found $num_flavors flavors" | 
 | 230 |             if [[ $num_flavors -eq 0 ]]; then | 
 | 231 |                 echo "Found no valid flavors to use!" | 
 | 232 |                 exit 1 | 
| Adalberto Medeiros | 63a71a2 | 2013-06-06 08:46:04 -0400 | [diff] [blame] | 233 |             fi | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 234 |             flavor_ref=${flavors[0]} | 
 | 235 |             flavor_ref_alt=$flavor_ref | 
 | 236 |  | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 237 |             # Ensure ``flavor_ref`` and ``flavor_ref_alt`` have different values. | 
 | 238 |             # Some resize instance in tempest tests depends on this. | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 239 |             for f in ${flavors[@]:1}; do | 
| John L. Villalovos | 3345a6d | 2017-03-13 13:47:34 -0700 | [diff] [blame] | 240 |                 if [[ "$f" != "$flavor_ref" ]]; then | 
| Attila Fazekas | c411fcf | 2014-08-19 16:48:14 +0200 | [diff] [blame] | 241 |                     flavor_ref_alt=$f | 
 | 242 |                     break | 
 | 243 |                 fi | 
 | 244 |             done | 
 | 245 |         fi | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 246 |     fi | 
 | 247 |  | 
| Dan Smith | a2ec7fd | 2016-08-10 11:14:00 -0700 | [diff] [blame] | 248 |     iniset $TEMPEST_CONFIG network project_network_cidr $FIXED_RANGE | 
 | 249 |  | 
| Attila Fazekas | 386ae8c | 2013-10-21 09:27:18 +0200 | [diff] [blame] | 250 |     ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method} | 
 | 251 |  | 
| Armando Migliaccio | 53f59d8 | 2016-05-17 15:12:24 -0700 | [diff] [blame] | 252 |     # the public network (for floating ip access) is only available | 
 | 253 |     # if the extension is enabled. | 
| Eric Berglund | 8e14240 | 2016-11-29 17:33:28 -0600 | [diff] [blame] | 254 |     # If NEUTRON_CREATE_INITIAL_NETWORKS is not true, there is no network created | 
 | 255 |     # and the public_network_id should not be set. | 
 | 256 |     if [[ "$NEUTRON_CREATE_INITIAL_NETWORKS" == "True" ]] && is_networking_extension_supported 'external-net'; then | 
| Jordan Pittier | d038b60 | 2016-11-04 13:32:39 +0100 | [diff] [blame] | 257 |         public_network_id=$(openstack network show -f value -c id $PUBLIC_NETWORK_NAME) | 
| Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 258 |     fi | 
 | 259 |  | 
| Masayuki Igawa | 5a252d9 | 2014-11-21 21:55:09 +0900 | [diff] [blame] | 260 |     iniset $TEMPEST_CONFIG DEFAULT use_syslog $SYSLOG | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 261 |  | 
| Matthew Treinish | 859cc68 | 2013-07-26 15:22:44 -0400 | [diff] [blame] | 262 |     # Oslo | 
| Joe Gordon | 23d6d50 | 2015-03-06 15:24:22 -0800 | [diff] [blame] | 263 |     iniset $TEMPEST_CONFIG oslo_concurrency lock_path $TEMPEST_STATE_PATH | 
| Matthew Treinish | 14ccba0 | 2013-07-29 16:15:53 -0400 | [diff] [blame] | 264 |     mkdir -p $TEMPEST_STATE_PATH | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 265 |     iniset $TEMPEST_CONFIG DEFAULT use_stderr False | 
 | 266 |     iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log | 
 | 267 |     iniset $TEMPEST_CONFIG DEFAULT debug True | 
| Matthew Treinish | 859cc68 | 2013-07-26 15:22:44 -0400 | [diff] [blame] | 268 |  | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 269 |     # Timeouts | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 270 |     iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT | 
 | 271 |     iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 272 |  | 
| Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 273 |     # Identity | 
| Brant Knudson | c2c89e4 | 2017-02-23 20:15:47 -0600 | [diff] [blame] | 274 |     iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_URI/v2.0/" | 
| Steve Martinelli | b74e01c | 2014-12-18 01:35:35 -0500 | [diff] [blame] | 275 |     iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_URI_V3" | 
| Rodrigo Duarte | b51a886 | 2016-09-26 15:22:35 -0300 | [diff] [blame] | 276 |     iniset $TEMPEST_CONFIG identity user_lockout_failure_attempts $KEYSTONE_LOCKOUT_FAILURE_ATTEMPTS | 
 | 277 |     iniset $TEMPEST_CONFIG identity user_lockout_duration $KEYSTONE_LOCKOUT_DURATION | 
 | 278 |     iniset $TEMPEST_CONFIG identity user_unique_last_password_count $KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT | 
| Andrea Frittoli (andreaf) | 5cda491 | 2016-06-09 00:33:30 +0100 | [diff] [blame] | 279 |     # Use domain scoped tokens for admin v3 tests, v3 dynamic credentials of v3 account generation | 
 | 280 |     iniset $TEMPEST_CONFIG identity admin_domain_scope True | 
| Matthew Treinish | 7ced150 | 2015-03-23 15:51:54 -0400 | [diff] [blame] | 281 |     if [[ "$TEMPEST_HAS_ADMIN" == "True" ]]; then | 
| Sean Dague | 0f76535 | 2016-02-18 06:53:08 -0500 | [diff] [blame] | 282 |         iniset $TEMPEST_CONFIG auth admin_username $admin_username | 
| Matthew Treinish | fbe0a62 | 2015-12-10 19:36:50 -0500 | [diff] [blame] | 283 |         iniset $TEMPEST_CONFIG auth admin_password "$password" | 
| Castulo J. Martinez | 2d9959c | 2016-11-01 13:34:20 -0700 | [diff] [blame] | 284 |         iniset $TEMPEST_CONFIG auth admin_project_name $admin_project_name | 
| Sean Dague | 0f76535 | 2016-02-18 06:53:08 -0500 | [diff] [blame] | 285 |         iniset $TEMPEST_CONFIG auth admin_domain_name $admin_domain_name | 
| Matthew Treinish | 7ced150 | 2015-03-23 15:51:54 -0400 | [diff] [blame] | 286 |     fi | 
| Paulo Ewerton | 75bf972 | 2016-01-22 19:13:31 +0000 | [diff] [blame] | 287 |     if [ "$ENABLE_IDENTITY_V2" == "True" ]; then | 
 | 288 |         # Run Identity API v2 tests ONLY if needed | 
 | 289 |         iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 True | 
| Paulo Ewerton | 75bf972 | 2016-01-22 19:13:31 +0000 | [diff] [blame] | 290 |     else | 
 | 291 |         # Skip Identity API v2 tests by default | 
 | 292 |         iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 False | 
| Samuel de Medeiros Queiroz | 3fd71d6 | 2015-05-03 14:54:45 -0300 | [diff] [blame] | 293 |     fi | 
| Ken'ichi Ohmichi | dc6e550 | 2017-03-03 16:55:50 -0800 | [diff] [blame] | 294 |     iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v3} | 
| ghanshyam | 11b8649 | 2018-08-07 08:37:24 +0000 | [diff] [blame] | 295 |     if [[ "$TEMPEST_AUTH_VERSION" != "v2" ]]; then | 
 | 296 |         # we're going to disable v2 admin unless we're using v2 by default. | 
| Sean Dague | bb44311 | 2017-04-19 16:22:42 -0400 | [diff] [blame] | 297 |         iniset $TEMPEST_CONFIG identity-feature-enabled api_v2_admin False | 
 | 298 |     fi | 
| Samuel de Medeiros Queiroz | 3fd71d6 | 2015-05-03 14:54:45 -0300 | [diff] [blame] | 299 |  | 
| Sean Dague | f3b2f4c | 2017-04-13 10:11:48 -0400 | [diff] [blame] | 300 |     if is_service_enabled tls-proxy; then | 
| Rob Crittenden | e1d013f | 2015-02-10 14:15:35 -0500 | [diff] [blame] | 301 |         iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE | 
 | 302 |     fi | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 303 |  | 
| Rodrigo Duarte | 0578e42 | 2016-03-16 12:15:07 -0300 | [diff] [blame] | 304 |     # Identity Features | 
| Rodrigo Duarte | b51a886 | 2016-09-26 15:22:35 -0300 | [diff] [blame] | 305 |     if [[ "$KEYSTONE_SECURITY_COMPLIANCE_ENABLED" = True ]]; then | 
 | 306 |         iniset $TEMPEST_CONFIG identity-feature-enabled security_compliance True | 
 | 307 |     fi | 
| Rodrigo Duarte | 0578e42 | 2016-03-16 12:15:07 -0300 | [diff] [blame] | 308 |  | 
| Leticia Wanderley | 1d141da | 2017-08-04 00:42:59 -0300 | [diff] [blame] | 309 |     # When LDAP is enabled domain specific drivers are also enabled and the users | 
 | 310 |     # and groups identity tests must adapt to this scenario | 
 | 311 |     if is_service_enabled ldap; then | 
 | 312 |         iniset $TEMPEST_CONFIG identity-feature-enabled domain_specific_drivers True | 
 | 313 |     fi | 
 | 314 |  | 
| Felipe Monteiro | 1ab9a2d | 2018-03-16 02:02:12 +0000 | [diff] [blame] | 315 |     # TODO(felipemonteiro): Remove this once Tempest no longer supports Pike | 
 | 316 |     # as this is supported in Queens and beyond. | 
 | 317 |     iniset $TEMPEST_CONFIG identity-feature-enabled project_tags True | 
 | 318 |  | 
| Colleen Murphy | 931f82d | 2018-02-18 14:11:10 +0100 | [diff] [blame] | 319 |     # In Queens and later, application credentials are enabled by default | 
 | 320 |     # so remove this once Tempest no longer supports Pike. | 
 | 321 |     iniset $TEMPEST_CONFIG identity-feature-enabled application_credentials True | 
 | 322 |  | 
| Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 323 |     # Image | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 324 |     # We want to be able to override this variable in the gate to avoid | 
 | 325 |     # doing an external HTTP fetch for this test. | 
| Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 326 |     if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 327 |         iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE | 
| Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 328 |     fi | 
| Bob Ball | 2dd761b | 2016-01-15 13:56:37 +0000 | [diff] [blame] | 329 |     if [ "$VIRT_DRIVER" = "xenserver" ]; then | 
 | 330 |         iniset $TEMPEST_CONFIG image disk_formats "ami,ari,aki,vhd,raw,iso" | 
 | 331 |     fi | 
| Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 332 |  | 
| David Kranz | f100e1c | 2015-06-01 10:29:59 -0400 | [diff] [blame] | 333 |     # Image Features | 
| Flavio Percoco | 22c695f | 2016-05-11 12:49:07 -0500 | [diff] [blame] | 334 |     if [ "$GLANCE_V1_ENABLED" != "True" ]; then | 
 | 335 |         iniset $TEMPEST_CONFIG image-feature-enabled api_v1 False | 
 | 336 |     fi | 
| David Kranz | f100e1c | 2015-06-01 10:29:59 -0400 | [diff] [blame] | 337 |  | 
| Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 338 |     # Compute | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 339 |     iniset $TEMPEST_CONFIG compute image_ref $image_uuid | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 340 |     iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 341 |     iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref | 
 | 342 |     iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt | 
| Sean Dague | 563a7e7 | 2015-12-15 17:16:19 -0500 | [diff] [blame] | 343 |     iniset $TEMPEST_CONFIG validation connect_method $ssh_connect_method | 
| Luigi Toscano | 4c813ac | 2016-09-21 19:39:36 +0200 | [diff] [blame] | 344 |     if ! is_service_enabled n-cell && ! is_service_enabled neutron; then | 
| melanie witt | f5b550e | 2015-04-10 22:20:07 +0000 | [diff] [blame] | 345 |         iniset $TEMPEST_CONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME | 
 | 346 |     fi | 
| Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 347 |  | 
| Sean Dague | 8349aff | 2015-09-01 12:45:28 -0400 | [diff] [blame] | 348 |     # Set the service catalog entry for Tempest to run on. Typically | 
 | 349 |     # used to try different compute API version targets. The tempest | 
 | 350 |     # default if 'compute', which is typically valid, so only set this | 
 | 351 |     # if you want to change it. | 
 | 352 |     if [[ -n "$TEMPEST_COMPUTE_TYPE" ]]; then | 
 | 353 |         iniset $TEMPEST_CONFIG compute catalog_type $TEMPEST_COMPUTE_TYPE | 
 | 354 |     fi | 
 | 355 |  | 
| Sean Dague | de19bf9 | 2014-03-20 16:54:58 -0400 | [diff] [blame] | 356 |     # Compute Features | 
| ghanshyam | 642b07b | 2015-11-19 10:01:14 +0900 | [diff] [blame] | 357 |     # Set the microversion range for compute tests. | 
 | 358 |     # This is used to run the Nova microversions tests. | 
 | 359 |     # Setting [None, latest] range of microversion which allow Tempest to run all microversions tests. | 
 | 360 |     # NOTE- To avoid microversion tests failure on stable branch, we need to change "tempest_compute_max_microversion" | 
 | 361 |     #       for stable branch on each release which should be changed from "latest" to max supported version of that release. | 
 | 362 |     local tempest_compute_min_microversion=${TEMPEST_COMPUTE_MIN_MICROVERSION:-None} | 
 | 363 |     local tempest_compute_max_microversion=${TEMPEST_COMPUTE_MAX_MICROVERSION:-"latest"} | 
 | 364 |     # Reset microversions to None where v2.0 is running which does not support microversion. | 
 | 365 |     # Both "None" means no microversion testing. | 
 | 366 |     if [[ "$TEMPEST_COMPUTE_TYPE" == "compute_legacy" ]]; then | 
 | 367 |         tempest_compute_min_microversion=None | 
 | 368 |         tempest_compute_max_microversion=None | 
 | 369 |     fi | 
 | 370 |     if [ "$tempest_compute_min_microversion" == "None" ]; then | 
| Jordan Pittier | f5a50a0 | 2016-05-10 14:56:12 +0200 | [diff] [blame] | 371 |         inicomment $TEMPEST_CONFIG compute min_microversion | 
| ghanshyam | 642b07b | 2015-11-19 10:01:14 +0900 | [diff] [blame] | 372 |     else | 
| Jordan Pittier | f5a50a0 | 2016-05-10 14:56:12 +0200 | [diff] [blame] | 373 |         iniset $TEMPEST_CONFIG compute min_microversion $tempest_compute_min_microversion | 
| ghanshyam | 642b07b | 2015-11-19 10:01:14 +0900 | [diff] [blame] | 374 |     fi | 
 | 375 |     if [ "$tempest_compute_max_microversion" == "None" ]; then | 
| Jordan Pittier | f5a50a0 | 2016-05-10 14:56:12 +0200 | [diff] [blame] | 376 |         inicomment $TEMPEST_CONFIG compute max_microversion | 
| ghanshyam | 642b07b | 2015-11-19 10:01:14 +0900 | [diff] [blame] | 377 |     else | 
| Jordan Pittier | f5a50a0 | 2016-05-10 14:56:12 +0200 | [diff] [blame] | 378 |         iniset $TEMPEST_CONFIG compute max_microversion $tempest_compute_max_microversion | 
| ghanshyam | 642b07b | 2015-11-19 10:01:14 +0900 | [diff] [blame] | 379 |     fi | 
 | 380 |  | 
| Matt Riedemann | 6d3670a | 2016-07-03 19:40:25 -0400 | [diff] [blame] | 381 |     iniset $TEMPEST_CONFIG compute-feature-enabled personality ${ENABLE_FILE_INJECTION:-False} | 
| Sean Dague | de19bf9 | 2014-03-20 16:54:58 -0400 | [diff] [blame] | 382 |     iniset $TEMPEST_CONFIG compute-feature-enabled resize True | 
| Matthew Treinish | 270f93e | 2014-03-20 21:18:42 +0000 | [diff] [blame] | 383 |     iniset $TEMPEST_CONFIG compute-feature-enabled live_migration ${LIVE_MIGRATION_AVAILABLE:-False} | 
 | 384 |     iniset $TEMPEST_CONFIG compute-feature-enabled change_password False | 
 | 385 |     iniset $TEMPEST_CONFIG compute-feature-enabled block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False} | 
| Pawel Koniszewski | 8a92b7f | 2016-10-05 16:14:19 +0200 | [diff] [blame] | 386 |     iniset $TEMPEST_CONFIG compute-feature-enabled live_migrate_back_and_forth ${LIVE_MIGRATE_BACK_AND_FORTH:-False} | 
| Matt Riedemann | e57a332 | 2015-06-20 14:48:00 -0700 | [diff] [blame] | 387 |     iniset $TEMPEST_CONFIG compute-feature-enabled attach_encrypted_volume ${ATTACH_ENCRYPTED_VOLUME_AVAILABLE:-True} | 
| Chuck Carmack | 09b431d | 2015-09-02 14:27:58 +0000 | [diff] [blame] | 388 |     if is_service_enabled n-cell; then | 
 | 389 |         # Cells doesn't support shelving/unshelving | 
 | 390 |         iniset $TEMPEST_CONFIG compute-feature-enabled shelve False | 
| Matt Riedemann | c94403d | 2015-10-15 12:51:13 -0700 | [diff] [blame] | 391 |         # Cells doesn't support hot-plugging virtual interfaces. | 
 | 392 |         iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False | 
| Matt Riedemann | 2bebf2d | 2016-04-05 10:34:42 -0400 | [diff] [blame] | 393 |         # Cells v1 doesn't support the rescue/unrescue tests in Tempest | 
 | 394 |         iniset $TEMPEST_CONFIG compute-feature-enabled rescue False | 
| Matt Riedemann | 6cd616a | 2015-11-06 10:26:14 -0800 | [diff] [blame] | 395 |  | 
 | 396 |         if  [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then | 
 | 397 |             # Cells supports resize but does not currently work with devstack | 
 | 398 |             # because of the custom flavors created for Tempest runs which are | 
 | 399 |             # not in the cells database. | 
 | 400 |             # TODO(mriedem): work on adding a nova-manage command to sync | 
 | 401 |             # flavors into the cells database. | 
 | 402 |             iniset $TEMPEST_CONFIG compute-feature-enabled resize False | 
 | 403 |         fi | 
| Chuck Carmack | 09b431d | 2015-09-02 14:27:58 +0000 | [diff] [blame] | 404 |     fi | 
| Sean Dague | de19bf9 | 2014-03-20 16:54:58 -0400 | [diff] [blame] | 405 |  | 
| Matt Riedemann | ffe691e | 2016-01-12 17:58:44 -0800 | [diff] [blame] | 406 |     if [[ $ENABLE_VOLUME_MULTIATTACH == "True" ]]; then | 
 | 407 |         iniset $TEMPEST_CONFIG compute-feature-enabled volume_multiattach True | 
 | 408 |     fi | 
 | 409 |  | 
| melanie witt | 6645cf7 | 2017-12-13 23:59:09 +0000 | [diff] [blame] | 410 |     if is_service_enabled n-novnc; then | 
| Michelle Mandel | 10db2b8 | 2016-07-20 11:39:42 -0400 | [diff] [blame] | 411 |         iniset $TEMPEST_CONFIG compute-feature-enabled vnc_console True | 
 | 412 |     fi | 
 | 413 |  | 
| Marian Horban | ea21eb4 | 2015-08-18 06:57:18 -0400 | [diff] [blame] | 414 |     # Network | 
| Jordan Pittier | f5a50a0 | 2016-05-10 14:56:12 +0200 | [diff] [blame] | 415 |     iniset $TEMPEST_CONFIG network project_networks_reachable false | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 416 |     iniset $TEMPEST_CONFIG network public_network_id "$public_network_id" | 
 | 417 |     iniset $TEMPEST_CONFIG network public_router_id "$public_router_id" | 
 | 418 |     iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE" | 
| Matthew Treinish | ccf60f7 | 2014-03-03 22:48:31 -0500 | [diff] [blame] | 419 |     iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED" | 
| Sean M. Collins | bb2908b | 2014-05-15 10:24:31 -0400 | [diff] [blame] | 420 |     iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED" | 
| Matt Riedemann | c9c9d31 | 2016-09-15 20:33:22 -0400 | [diff] [blame] | 421 |     iniset $TEMPEST_CONFIG network-feature-enabled port_security $NEUTRON_PORT_SECURITY | 
| Salvatore | 33e8ee2 | 2014-10-05 01:36:34 +0200 | [diff] [blame] | 422 |  | 
| William Marshall | 24d866e | 2013-07-02 12:26:31 -0500 | [diff] [blame] | 423 |     # Scenario | 
| Jianghua Wang | 2b3ac6d | 2016-11-09 12:50:00 +0800 | [diff] [blame] | 424 |     if [ "$VIRT_DRIVER" = "xenserver" ]; then | 
 | 425 |         SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES} | 
 | 426 |         SCENARIO_IMAGE_FILE="cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-disk.vhd.tgz" | 
 | 427 |         iniset $TEMPEST_CONFIG scenario img_disk_format vhd | 
 | 428 |         iniset $TEMPEST_CONFIG scenario img_container_format ovf | 
 | 429 |     else | 
| Matthew Treinish | 6fc332d | 2016-07-06 13:44:55 -0400 | [diff] [blame] | 430 |         SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES} | 
| Matthew Treinish | befe092 | 2017-02-16 15:45:11 -0500 | [diff] [blame] | 431 |         SCENARIO_IMAGE_FILE=$DEFAULT_IMAGE_FILE_NAME | 
| Jianghua Wang | 2b3ac6d | 2016-11-09 12:50:00 +0800 | [diff] [blame] | 432 |     fi | 
| Matthew Treinish | d2cb234 | 2015-04-02 11:08:24 -0400 | [diff] [blame] | 433 |     iniset $TEMPEST_CONFIG scenario img_dir $SCENARIO_IMAGE_DIR | 
| Jianghua Wang | 2b3ac6d | 2016-11-09 12:50:00 +0800 | [diff] [blame] | 434 |     iniset $TEMPEST_CONFIG scenario img_file $SCENARIO_IMAGE_FILE | 
| William Marshall | 24d866e | 2013-07-02 12:26:31 -0500 | [diff] [blame] | 435 |  | 
| Michael Turek | 7938d83 | 2016-04-12 14:55:21 -0400 | [diff] [blame] | 436 |     # If using provider networking, use the physical network for validation rather than private | 
 | 437 |     TEMPEST_SSH_NETWORK_NAME=$PRIVATE_NETWORK_NAME | 
 | 438 |     if is_provider_network; then | 
 | 439 |         TEMPEST_SSH_NETWORK_NAME=$PHYSICAL_NETWORK | 
 | 440 |     fi | 
| lanoux | 994db61 | 2015-08-03 13:48:12 +0000 | [diff] [blame] | 441 |     # Validation | 
| Andrea Frittoli | ef1e88e | 2017-04-20 23:37:32 +0100 | [diff] [blame] | 442 |     iniset $TEMPEST_CONFIG validation run_validation ${TEMPEST_RUN_VALIDATION:-True} | 
| Matthew Treinish | fbe0a62 | 2015-12-10 19:36:50 -0500 | [diff] [blame] | 443 |     iniset $TEMPEST_CONFIG validation ip_version_for_ssh 4 | 
 | 444 |     iniset $TEMPEST_CONFIG validation ssh_timeout $BUILD_TIMEOUT | 
 | 445 |     iniset $TEMPEST_CONFIG validation image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros} | 
| Michael Turek | 7938d83 | 2016-04-12 14:55:21 -0400 | [diff] [blame] | 446 |     iniset $TEMPEST_CONFIG validation network_for_ssh $TEMPEST_SSH_NETWORK_NAME | 
| lanoux | 994db61 | 2015-08-03 13:48:12 +0000 | [diff] [blame] | 447 |  | 
| Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 448 |     # Volume | 
| ghanshyam | 7a8d850 | 2017-12-14 09:16:56 +0000 | [diff] [blame] | 449 |     # Set the service catalog entry for Tempest to run on. Typically | 
 | 450 |     # used to try different Volume API version targets. The tempest | 
 | 451 |     # default it to 'volumev3'(v3 APIs endpoint) , so only set this | 
 | 452 |     # if you want to change it. | 
 | 453 |     if [[ -n "$TEMPEST_VOLUME_TYPE" ]]; then | 
 | 454 |         iniset $TEMPEST_CONFIG volume catalog_type $TEMPEST_VOLUME_TYPE | 
 | 455 |     fi | 
| Patrick East | 3eb7c97 | 2017-01-13 11:44:54 -0800 | [diff] [blame] | 456 |     # Only turn on TEMPEST_VOLUME_MANAGE_SNAPSHOT by default for "lvm" backends | 
 | 457 |     if [[ "$CINDER_ENABLED_BACKENDS" == *"lvm"* ]]; then | 
 | 458 |         TEMPEST_VOLUME_MANAGE_SNAPSHOT=${TEMPEST_VOLUME_MANAGE_SNAPSHOT:-True} | 
 | 459 |     fi | 
 | 460 |     iniset $TEMPEST_CONFIG volume-feature-enabled manage_snapshot $(trueorfalse False TEMPEST_VOLUME_MANAGE_SNAPSHOT) | 
| jeremy.zhang | d5919d0 | 2017-03-08 15:27:37 +0800 | [diff] [blame] | 461 |     # Only turn on TEMPEST_VOLUME_MANAGE_VOLUME by default for "lvm" backends | 
 | 462 |     if [[ "$CINDER_ENABLED_BACKENDS" == *"lvm"* ]]; then | 
 | 463 |         TEMPEST_VOLUME_MANAGE_VOLUME=${TEMPEST_VOLUME_MANAGE_VOLUME:-True} | 
 | 464 |     fi | 
 | 465 |     iniset $TEMPEST_CONFIG volume-feature-enabled manage_volume $(trueorfalse False TEMPEST_VOLUME_MANAGE_VOLUME) | 
| Matt Riedemann | 17cdecc | 2017-07-05 20:25:02 -0400 | [diff] [blame] | 466 |     # Only turn on TEMPEST_EXTEND_ATTACHED_VOLUME by default for "lvm" backends | 
 | 467 |     # in Cinder and the libvirt driver in Nova. | 
 | 468 |     if [[ "$CINDER_ENABLED_BACKENDS" == *"lvm"* ]] && [ "$VIRT_DRIVER" = "libvirt" ]; then | 
 | 469 |         TEMPEST_EXTEND_ATTACHED_VOLUME=${TEMPEST_EXTEND_ATTACHED_VOLUME:-True} | 
 | 470 |     fi | 
 | 471 |     iniset $TEMPEST_CONFIG volume-feature-enabled extend_attached_volume $(trueorfalse False TEMPEST_EXTEND_ATTACHED_VOLUME) | 
| Alex Meade | 0c0c09a | 2016-05-13 10:57:29 -0400 | [diff] [blame] | 472 |     local tempest_volume_min_microversion=${TEMPEST_VOLUME_MIN_MICROVERSION:-None} | 
 | 473 |     local tempest_volume_max_microversion=${TEMPEST_VOLUME_MAX_MICROVERSION:-"latest"} | 
| ghanshyam | 7a8d850 | 2017-12-14 09:16:56 +0000 | [diff] [blame] | 474 |     # Reset microversions to None where v2 is running which does not support microversion. | 
 | 475 |     # Both "None" means no microversion testing. | 
 | 476 |     if [[ "$TEMPEST_VOLUME_TYPE" == "volumev2" ]]; then | 
 | 477 |         tempest_volume_min_microversion=None | 
 | 478 |         tempest_volume_max_microversion=None | 
 | 479 |     fi | 
| Alex Meade | 0c0c09a | 2016-05-13 10:57:29 -0400 | [diff] [blame] | 480 |     if [ "$tempest_volume_min_microversion" == "None" ]; then | 
 | 481 |         inicomment $TEMPEST_CONFIG volume min_microversion | 
 | 482 |     else | 
 | 483 |         iniset $TEMPEST_CONFIG volume min_microversion $tempest_volume_min_microversion | 
 | 484 |     fi | 
 | 485 |  | 
 | 486 |     if [ "$tempest_volume_max_microversion" == "None" ]; then | 
 | 487 |         inicomment $TEMPEST_CONFIG volume max_microversion | 
 | 488 |     else | 
 | 489 |         iniset $TEMPEST_CONFIG volume max_microversion $tempest_volume_max_microversion | 
 | 490 |     fi | 
| David Kranz | d1d6667 | 2015-06-11 13:09:37 -0400 | [diff] [blame] | 491 |  | 
| Giulio Fidente | 3d60f4d | 2014-02-20 16:43:49 +0100 | [diff] [blame] | 492 |     if ! is_service_enabled c-bak; then | 
 | 493 |         iniset $TEMPEST_CONFIG volume-feature-enabled backup False | 
| Giulio Fidente | 3632ab1 | 2013-09-10 02:51:26 +0200 | [diff] [blame] | 494 |     fi | 
| Swapnil Kulkarni | 09fb7ba | 2014-10-16 06:30:28 +0000 | [diff] [blame] | 495 |  | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 496 |     # Using ``CINDER_ENABLED_BACKENDS`` | 
| bkopilov | 3ac1ea8 | 2016-06-06 16:00:48 +0300 | [diff] [blame] | 497 |     # Cinder uses a comma separated list with "type:backend_name": | 
 | 498 |     #  CINDER_ENABLED_BACKENDS = ceph:cephBE1,lvm:lvmBE2,foo:my_foo | 
| Swapnil Kulkarni | 09fb7ba | 2014-10-16 06:30:28 +0000 | [diff] [blame] | 499 |     if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then | 
| bkopilov | 3ac1ea8 | 2016-06-06 16:00:48 +0300 | [diff] [blame] | 500 |         # We have at least 2 backends | 
| Matthew Treinish | db1c384 | 2014-02-04 20:58:00 +0000 | [diff] [blame] | 501 |         iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True" | 
| bkopilov | 3ac1ea8 | 2016-06-06 16:00:48 +0300 | [diff] [blame] | 502 |         local add_comma_seperator=0 | 
 | 503 |         local backends_list='' | 
| Swapnil Kulkarni | 09fb7ba | 2014-10-16 06:30:28 +0000 | [diff] [blame] | 504 |         local be | 
| bkopilov | 3ac1ea8 | 2016-06-06 16:00:48 +0300 | [diff] [blame] | 505 |         # Tempest uses a comma separated list of backend_names: | 
 | 506 |         #   backend_names = BACKEND_1,BACKEND_2 | 
| Swapnil Kulkarni | 09fb7ba | 2014-10-16 06:30:28 +0000 | [diff] [blame] | 507 |         for be in ${CINDER_ENABLED_BACKENDS//,/ }; do | 
| bkopilov | 3ac1ea8 | 2016-06-06 16:00:48 +0300 | [diff] [blame] | 508 |             if [ "$add_comma_seperator" -eq "1" ]; then | 
 | 509 |                 backends_list+=,${be##*:} | 
 | 510 |             else | 
 | 511 |             # first element in the list | 
 | 512 |                 backends_list+=${be##*:} | 
 | 513 |                 add_comma_seperator=1 | 
 | 514 |             fi | 
| Swapnil Kulkarni | 09fb7ba | 2014-10-16 06:30:28 +0000 | [diff] [blame] | 515 |         done | 
| bkopilov | 3ac1ea8 | 2016-06-06 16:00:48 +0300 | [diff] [blame] | 516 |         iniset $TEMPEST_CONFIG volume "backend_names" "$backends_list" | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 517 |     fi | 
 | 518 |  | 
| Eric Harney | 0145648 | 2014-10-14 18:53:53 -0400 | [diff] [blame] | 519 |     if [ $TEMPEST_VOLUME_DRIVER != "default" -o \ | 
| Patrick East | 1c0628f | 2014-10-22 16:22:47 -0700 | [diff] [blame] | 520 |         "$TEMPEST_VOLUME_VENDOR" != "$TEMPEST_DEFAULT_VOLUME_VENDOR" ]; then | 
| Ed Balduf | 2f23d75 | 2014-07-29 14:42:27 -0600 | [diff] [blame] | 521 |         iniset $TEMPEST_CONFIG volume vendor_name "$TEMPEST_VOLUME_VENDOR" | 
| Eric Harney | 0145648 | 2014-10-14 18:53:53 -0400 | [diff] [blame] | 522 |     fi | 
 | 523 |     if [ $TEMPEST_VOLUME_DRIVER != "default" -o \ | 
| JordanP | 82a7d93 | 2014-12-04 14:09:16 +0100 | [diff] [blame] | 524 |         "$TEMPEST_STORAGE_PROTOCOL" != "$TEMPEST_DEFAULT_STORAGE_PROTOCOL" ]; then | 
 | 525 |         iniset $TEMPEST_CONFIG volume storage_protocol "$TEMPEST_STORAGE_PROTOCOL" | 
| Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 526 |     fi | 
 | 527 |  | 
| Adam Gandelman | 43bd667 | 2014-04-03 11:13:13 -0700 | [diff] [blame] | 528 |     # Baremetal | 
 | 529 |     if [ "$VIRT_DRIVER" = "ironic" ] ; then | 
| Adam Gandelman | fdfe7a0 | 2014-07-24 10:06:18 -0400 | [diff] [blame] | 530 |         iniset $TEMPEST_CONFIG compute-feature-enabled change_password False | 
 | 531 |         iniset $TEMPEST_CONFIG compute-feature-enabled console_output False | 
 | 532 |         iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False | 
 | 533 |         iniset $TEMPEST_CONFIG compute-feature-enabled live_migration False | 
 | 534 |         iniset $TEMPEST_CONFIG compute-feature-enabled pause False | 
 | 535 |         iniset $TEMPEST_CONFIG compute-feature-enabled rescue False | 
 | 536 |         iniset $TEMPEST_CONFIG compute-feature-enabled resize False | 
 | 537 |         iniset $TEMPEST_CONFIG compute-feature-enabled shelve False | 
 | 538 |         iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False | 
| David Shrewsbury | cf21b71 | 2014-08-13 07:03:58 -0400 | [diff] [blame] | 539 |         iniset $TEMPEST_CONFIG compute-feature-enabled suspend False | 
| Adam Gandelman | 43bd667 | 2014-04-03 11:13:13 -0700 | [diff] [blame] | 540 |     fi | 
 | 541 |  | 
| Matt Riedemann | 92575ba | 2016-09-21 16:15:31 -0400 | [diff] [blame] | 542 |     # Libvirt | 
 | 543 |     if [ "$VIRT_DRIVER" = "libvirt" ]; then | 
 | 544 |         # Libvirt-LXC | 
 | 545 |         if [ "$LIBVIRT_TYPE" = "lxc" ]; then | 
 | 546 |             iniset $TEMPEST_CONFIG compute-feature-enabled rescue False | 
 | 547 |             iniset $TEMPEST_CONFIG compute-feature-enabled resize False | 
 | 548 |             iniset $TEMPEST_CONFIG compute-feature-enabled shelve False | 
 | 549 |             iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False | 
 | 550 |             iniset $TEMPEST_CONFIG compute-feature-enabled suspend False | 
| Matt Riedemann | e9a9fbe | 2017-01-30 22:22:43 -0500 | [diff] [blame] | 551 |         elif ! is_service_enabled n-cell; then | 
 | 552 |             # cells v1 does not support swapping volumes | 
 | 553 |             iniset $TEMPEST_CONFIG compute-feature-enabled swap_volume True | 
| Matt Riedemann | 92575ba | 2016-09-21 16:15:31 -0400 | [diff] [blame] | 554 |         fi | 
| Nels Nelson | 7b47c47 | 2015-01-05 16:36:42 -0600 | [diff] [blame] | 555 |     fi | 
 | 556 |  | 
| Dean Troyer | dc97cb7 | 2015-03-28 08:20:50 -0500 | [diff] [blame] | 557 |     # ``service_available`` | 
| Sean Dague | 346edcc | 2015-08-26 09:38:37 -0400 | [diff] [blame] | 558 |     # | 
 | 559 |     # this tempest service list needs to be all the services that | 
 | 560 |     # tempest supports, otherwise we can have an erroneous set of | 
 | 561 |     # defaults (something defaulting true in Tempest, but not listed here). | 
| Sean Dague | 0f76535 | 2016-02-18 06:53:08 -0500 | [diff] [blame] | 562 |     local service | 
 | 563 |     local tempest_services="key,glance,nova,neutron,cinder,swift,heat,ceilometer,horizon,sahara,ironic,trove" | 
 | 564 |     for service in ${tempest_services//,/ }; do | 
| Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 565 |         if is_service_enabled $service ; then | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 566 |             iniset $TEMPEST_CONFIG service_available $service "True" | 
| Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 567 |         else | 
| john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 568 |             iniset $TEMPEST_CONFIG service_available $service "False" | 
| Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 569 |         fi | 
 | 570 |     done | 
 | 571 |  | 
| Matt Riedemann | cf94edc | 2015-10-28 09:50:01 -0700 | [diff] [blame] | 572 |     if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then | 
 | 573 |         # libvirt-lxc does not support boot from volume or attaching volumes | 
 | 574 |         # so basically anything with cinder is out of the question. | 
 | 575 |         iniset $TEMPEST_CONFIG service_available cinder "False" | 
 | 576 |     fi | 
 | 577 |  | 
| Matthew Treinish | e8f3f7a | 2016-04-11 12:52:39 -0400 | [diff] [blame] | 578 |     # Run tempest configuration utilities. This must be done last during configuration to | 
 | 579 |     # ensure as complete a config as possible already exists | 
 | 580 |  | 
 | 581 |     # NOTE(mtreinish): Respect constraints on tempest verify-config venv | 
 | 582 |     local tmp_cfg_file | 
 | 583 |     tmp_cfg_file=$(mktemp) | 
 | 584 |     cd $TEMPEST_DIR | 
 | 585 |     if [[ "$OFFLINE" != "True" ]]; then | 
| Matthew Treinish | 440464c | 2016-05-04 11:55:12 -0400 | [diff] [blame] | 586 |         tox -revenv-tempest --notest | 
| Matthew Treinish | e8f3f7a | 2016-04-11 12:52:39 -0400 | [diff] [blame] | 587 |     fi | 
| Claudiu Belu | 34c1679 | 2017-06-12 09:32:21 -0700 | [diff] [blame] | 588 |  | 
 | 589 |     # The requirements might be on a different branch, while tempest needs master requirements. | 
| Lenny Verkhovsky | 6465219 | 2018-08-29 16:41:04 +0300 | [diff] [blame] | 590 |     (cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) > u-c-m.txt | 
| Claudiu Belu | 34c1679 | 2017-06-12 09:32:21 -0700 | [diff] [blame] | 591 |     tox -evenv-tempest -- pip install -c u-c-m.txt -r requirements.txt | 
| Matthew Treinish | e8f3f7a | 2016-04-11 12:52:39 -0400 | [diff] [blame] | 592 |  | 
 | 593 |     # Auth: | 
| Felipe Monteiro | 3cdff78 | 2018-07-09 20:25:08 +0100 | [diff] [blame] | 594 |     iniset $TEMPEST_CONFIG auth tempest_roles "member" | 
| Matthew Treinish | e8f3f7a | 2016-04-11 12:52:39 -0400 | [diff] [blame] | 595 |     if [[ $TEMPEST_USE_TEST_ACCOUNTS == "True" ]]; then | 
 | 596 |         if [[ $TEMPEST_HAS_ADMIN == "True" ]]; then | 
| Matthew Treinish | 440464c | 2016-05-04 11:55:12 -0400 | [diff] [blame] | 597 |             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 Treinish | e8f3f7a | 2016-04-11 12:52:39 -0400 | [diff] [blame] | 598 |         else | 
| Matthew Treinish | 440464c | 2016-05-04 11:55:12 -0400 | [diff] [blame] | 599 |             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 Treinish | e8f3f7a | 2016-04-11 12:52:39 -0400 | [diff] [blame] | 600 |         fi | 
 | 601 |         iniset $TEMPEST_CONFIG auth use_dynamic_credentials False | 
 | 602 |         iniset $TEMPEST_CONFIG auth test_accounts_file "etc/accounts.yaml" | 
 | 603 |     elif [[ $TEMPEST_HAS_ADMIN == "False" ]]; then | 
 | 604 |         iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-False} | 
 | 605 |  | 
 | 606 |     else | 
 | 607 |         iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-True} | 
 | 608 |     fi | 
 | 609 |  | 
 | 610 |     # API Extensions | 
 | 611 |     # Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints | 
 | 612 |     # NOTE(mtreinish): This must be done after auth settings are added to the tempest config | 
 | 613 |     tox -evenv -- tempest verify-config -uro $tmp_cfg_file | 
| Sean Dague | 7b22935 | 2016-08-09 13:29:11 -0400 | [diff] [blame] | 614 |  | 
| Matthew Treinish | e8f3f7a | 2016-04-11 12:52:39 -0400 | [diff] [blame] | 615 |     # Neutron API Extensions | 
| Sean Dague | 894ccc9 | 2016-08-08 16:19:05 -0400 | [diff] [blame] | 616 |  | 
 | 617 |     # disable metering if we didn't enable the service | 
 | 618 |     if ! is_service_enabled q-metering; then | 
 | 619 |         DISABLE_NETWORK_API_EXTENSIONS+=", metering" | 
 | 620 |     fi | 
 | 621 |  | 
| Dima Kuznetsov | 787412c | 2017-08-28 09:09:38 +0300 | [diff] [blame] | 622 |     # disable l3_agent_scheduler if we didn't enable L3 agent | 
 | 623 |     if ! is_service_enabled q-l3; then | 
 | 624 |         DISABLE_NETWORK_API_EXTENSIONS+=", l3_agent_scheduler" | 
 | 625 |     fi | 
 | 626 |  | 
| Matthew Treinish | e8f3f7a | 2016-04-11 12:52:39 -0400 | [diff] [blame] | 627 |     local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"} | 
 | 628 |     if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then | 
 | 629 |         # Enabled extensions are either the ones explicitly specified or those available on the API endpoint | 
 | 630 |         network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")} | 
 | 631 |         # Remove disabled extensions | 
 | 632 |         network_api_extensions=$(remove_disabled_extensions $network_api_extensions $DISABLE_NETWORK_API_EXTENSIONS) | 
 | 633 |     fi | 
 | 634 |     iniset $TEMPEST_CONFIG network-feature-enabled api_extensions $network_api_extensions | 
 | 635 |     # Swift API Extensions | 
 | 636 |     local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"} | 
 | 637 |     if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then | 
 | 638 |         # Enabled extensions are either the ones explicitly specified or those available on the API endpoint | 
 | 639 |         object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")} | 
 | 640 |         # Remove disabled extensions | 
 | 641 |         object_storage_api_extensions=$(remove_disabled_extensions $object_storage_api_extensions $DISABLE_STORAGE_API_EXTENSIONS) | 
 | 642 |     fi | 
 | 643 |     iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis $object_storage_api_extensions | 
 | 644 |     # Cinder API Extensions | 
 | 645 |     local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"} | 
 | 646 |     if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then | 
 | 647 |         # Enabled extensions are either the ones explicitly specified or those available on the API endpoint | 
 | 648 |         volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")} | 
 | 649 |         # Remove disabled extensions | 
 | 650 |         volume_api_extensions=$(remove_disabled_extensions $volume_api_extensions $DISABLE_VOLUME_API_EXTENSIONS) | 
 | 651 |     fi | 
 | 652 |     iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions $volume_api_extensions | 
 | 653 |  | 
| Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 654 |     # Restore IFS | 
 | 655 |     IFS=$ifs | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 656 | } | 
 | 657 |  | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 658 | # install_tempest() - Collect source and prepare | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 659 | function install_tempest { | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 660 |     git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH | 
| Anna Khmelnitsky | 730faa2 | 2017-09-01 16:25:09 -0700 | [diff] [blame] | 661 |     pip_install 'tox!=2.8.0' | 
| Matthew Treinish | 83e166b | 2015-02-18 19:01:20 -0500 | [diff] [blame] | 662 |     pushd $TEMPEST_DIR | 
| Sean Dague | 583c520 | 2017-03-21 11:15:05 -0400 | [diff] [blame] | 663 |     tox -r --notest -efull | 
| Matthew Treinish | 1e31e68 | 2016-02-09 23:50:54 -0500 | [diff] [blame] | 664 |     # NOTE(mtreinish) Respect constraints in the tempest full venv, things that | 
 | 665 |     # are using a tox job other than full will not be respecting constraints but | 
 | 666 |     # running pip install -U on tempest requirements | 
| Matthew Treinish | 440464c | 2016-05-04 11:55:12 -0400 | [diff] [blame] | 667 |     $TEMPEST_DIR/.tox/tempest/bin/pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt | 
 | 668 |     PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/tempest | 
| Matthew Treinish | 7e603d1 | 2016-06-01 18:16:14 -0400 | [diff] [blame] | 669 |     popd | 
 | 670 | } | 
 | 671 |  | 
 | 672 | # install_tempest_plugins() - Install any specified plugins into the tempest venv | 
 | 673 | function install_tempest_plugins { | 
 | 674 |     pushd $TEMPEST_DIR | 
| Matthew Treinish | 440464c | 2016-05-04 11:55:12 -0400 | [diff] [blame] | 675 |     if [[ $TEMPEST_PLUGINS != 0 ]] ; then | 
| ghanshyam | 0d83e09 | 2019-02-27 11:10:05 +0000 | [diff] [blame] | 676 |         # The requirements might be on a different branch, while tempest & tempest plugins needs master requirements. | 
| Vlad Gridin | bcd8a50 | 2019-03-14 14:40:55 +0100 | [diff] [blame^] | 677 |         (cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) > u-c-m.txt | 
| ghanshyam | 0d83e09 | 2019-02-27 11:10:05 +0000 | [diff] [blame] | 678 |         tox -evenv-tempest -- pip install -c u-c-m.txt $TEMPEST_PLUGINS | 
| Matthew Treinish | b655867 | 2016-05-20 17:30:17 -0400 | [diff] [blame] | 679 |         echo "Checking installed Tempest plugins:" | 
 | 680 |         tox -evenv-tempest -- tempest list-plugins | 
| Matthew Treinish | b31640a | 2016-05-02 16:33:29 -0400 | [diff] [blame] | 681 |     fi | 
| Matthew Treinish | 83e166b | 2015-02-18 19:01:20 -0500 | [diff] [blame] | 682 |     popd | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 683 | } | 
 | 684 |  | 
| Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 685 | # Restore xtrace | 
| Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 686 | $_XTRACE_TEMPEST | 
| Sean Dague | 584d90e | 2013-03-29 14:34:53 -0400 | [diff] [blame] | 687 |  | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 688 | # Tell emacs to use shell-script-mode | 
 | 689 | ## Local variables: | 
 | 690 | ## mode: shell-script | 
 | 691 | ## End: |