Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 1 | # lib/tempest |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 2 | # Install and configure Tempest |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 3 | |
| 4 | # Dependencies: |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 5 | # |
| 6 | # - ``functions`` file |
| 7 | # - ``lib/nova`` service is running |
| 8 | # - Global vars that are assumed to be defined: |
| 9 | # - ``DEST``, ``FILES`` |
| 10 | # - ``ADMIN_PASSWORD`` |
| 11 | # - ``DEFAULT_IMAGE_NAME`` |
| 12 | # - ``S3_SERVICE_PORT`` |
| 13 | # - ``SERVICE_HOST`` |
| 14 | # - ``BASE_SQL_CONN`` ``lib/database`` declares |
| 15 | # - ``PUBLIC_NETWORK_NAME`` |
| 16 | # - ``Q_USE_NAMESPACE`` |
| 17 | # - ``Q_ROUTER_NAME`` |
Tomoe Sugihara | afbc631 | 2013-11-14 20:02:47 +0000 | [diff] [blame] | 18 | # - ``Q_L3_ENABLED`` |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 19 | # - ``VIRT_DRIVER`` |
| 20 | # - ``LIBVIRT_TYPE`` |
| 21 | # - ``KEYSTONE_SERVICE_PROTOCOL``, ``KEYSTONE_SERVICE_HOST`` from lib/keystone |
| 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 | # |
| 25 | # - ``ALT_*`` (similar vars exists in keystone_data.sh) |
| 26 | # - ``LIVE_MIGRATION_AVAILABLE`` |
| 27 | # - ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION`` |
| 28 | # - ``DEFAULT_INSTANCE_TYPE`` |
| 29 | # - ``DEFAULT_INSTANCE_USER`` |
| 30 | # - ``CINDER_MULTI_LVM_BACKEND`` |
| 31 | # - ``HEAT_CREATE_TEST_IMAGE`` |
| 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 |
| 37 | # - init_tempest |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 38 | |
| 39 | # Save trace setting |
| 40 | XTRACE=$(set +o | grep xtrace) |
| 41 | set +o xtrace |
| 42 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 43 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 44 | # Defaults |
| 45 | # -------- |
| 46 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 47 | # Set up default directories |
| 48 | TEMPEST_DIR=$DEST/tempest |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 49 | TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc} |
| 50 | TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf |
Matthew Treinish | 14ccba0 | 2013-07-29 16:15:53 -0400 | [diff] [blame] | 51 | TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 52 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 53 | NOVA_SOURCE_DIR=$DEST/nova |
| 54 | |
Attila Fazekas | bae0233 | 2013-05-09 09:24:49 +0200 | [diff] [blame] | 55 | BUILD_INTERVAL=1 |
Attila Fazekas | 8111ef0 | 2013-10-18 16:21:26 +0200 | [diff] [blame] | 56 | BUILD_TIMEOUT=196 |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 57 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 58 | |
Scott Moser | cde655a | 2013-02-20 12:33:39 -0500 | [diff] [blame] | 59 | BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1" |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 60 | |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 61 | # Cinder/Volume variables |
| 62 | TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default} |
| 63 | TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-"Open Source"} |
| 64 | TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-iSCSI} |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 65 | |
| 66 | # Functions |
| 67 | # --------- |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 68 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 69 | # configure_tempest() - Set config files, create data dirs, etc |
| 70 | function configure_tempest() { |
Matthew Treinish | 95fb0d4 | 2013-01-28 16:24:14 -0500 | [diff] [blame] | 71 | setup_develop $TEMPEST_DIR |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 72 | local image_lines |
| 73 | local images |
| 74 | local num_images |
| 75 | local image_uuid |
| 76 | local image_uuid_alt |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 77 | local errexit |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 78 | local password |
| 79 | local line |
| 80 | local flavors |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 81 | local available_flavors |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 82 | local flavors_ref |
| 83 | local flavor_lines |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 84 | local public_network_id |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 85 | local public_router_id |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 86 | local tenant_networks_reachable |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 87 | local boto_instance_type="m1.tiny" |
Attila Fazekas | 386ae8c | 2013-10-21 09:27:18 +0200 | [diff] [blame] | 88 | local ssh_connect_method="fixed" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 89 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 90 | # TODO(afazekas): |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 91 | # sudo python setup.py deploy |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 92 | |
| 93 | # This function exits on an error so that errors don't compound and you see |
Joe Gordon | 4640026 | 2013-06-30 04:32:27 -0700 | [diff] [blame] | 94 | # only the first error that occurred. |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 95 | errexit=$(set +o | grep errexit) |
| 96 | set -o errexit |
| 97 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 98 | # Save IFS |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 99 | ifs=$IFS |
| 100 | |
| 101 | # Glance should already contain images to be used in tempest |
| 102 | # testing. Here we simply look for images stored in Glance |
| 103 | # and set the appropriate variables for use in the tempest config |
| 104 | # We ignore ramdisk and kernel images, look for the default image |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 105 | # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the |
| 106 | # first image returned and set ``image_uuid_alt`` to the second, |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 107 | # if there is more than one returned... |
| 108 | # ... 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] | 109 | declare -a images |
| 110 | |
| 111 | while read -r IMAGE_NAME IMAGE_UUID; do |
| 112 | if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then |
| 113 | image_uuid="$IMAGE_UUID" |
| 114 | image_uuid_alt="$IMAGE_UUID" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 115 | fi |
Cody A.W. Somerville | c24e23b | 2012-12-21 02:10:45 -0500 | [diff] [blame] | 116 | images+=($IMAGE_UUID) |
| 117 | done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }') |
| 118 | |
| 119 | case "${#images[*]}" in |
| 120 | 0) |
| 121 | echo "Found no valid images to use!" |
| 122 | exit 1 |
| 123 | ;; |
| 124 | 1) |
| 125 | if [ -z "$image_uuid" ]; then |
| 126 | image_uuid=${images[0]} |
| 127 | image_uuid_alt=${images[0]} |
| 128 | fi |
| 129 | ;; |
| 130 | *) |
| 131 | if [ -z "$image_uuid" ]; then |
| 132 | image_uuid=${images[0]} |
| 133 | image_uuid_alt=${images[1]} |
| 134 | fi |
| 135 | ;; |
| 136 | esac |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 137 | |
| 138 | # Create tempest.conf from tempest.conf.sample |
| 139 | # copy every time, because the image UUIDS are going to change |
Ian Wienand | 5f90fc0 | 2014-02-24 15:40:42 +1100 | [diff] [blame^] | 140 | if [[ ! -d $TEMPEST_CONFIG_DIR ]]; then |
| 141 | sudo mkdir -p $TEMPEST_CONFIG_DIR |
| 142 | fi |
| 143 | sudo chown $STACK_USER $TEMPEST_CONFIG_DIR |
| 144 | cp $TEMPEST_DIR/etc/tempest.conf.sample $TEMPEST_CONFIG |
| 145 | chmod 644 $TEMPEST_CONFIG |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 146 | |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 147 | password=${ADMIN_PASSWORD:-secrete} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 148 | |
| 149 | # See files/keystone_data.sh where alt_demo user |
| 150 | # and tenant are set up... |
| 151 | ALT_USERNAME=${ALT_USERNAME:-alt_demo} |
| 152 | ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo} |
| 153 | |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 154 | # If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior |
| 155 | # Tempest creates instane types for himself |
| 156 | if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 157 | available_flavors=$(nova flavor-list) |
| 158 | if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then |
Rafael Folco | ba0f1d3 | 2013-12-06 17:56:24 -0200 | [diff] [blame] | 159 | if is_arch "ppc64"; then |
| 160 | # qemu needs at least 128MB of memory to boot on ppc64 |
| 161 | nova flavor-create m1.nano 42 128 0 1 |
| 162 | else |
| 163 | nova flavor-create m1.nano 42 64 0 1 |
| 164 | fi |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 165 | fi |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 166 | flavor_ref=42 |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 167 | boto_instance_type=m1.nano |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 168 | if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then |
Rafael Folco | ba0f1d3 | 2013-12-06 17:56:24 -0200 | [diff] [blame] | 169 | if is_arch "ppc64"; then |
| 170 | nova flavor-create m1.micro 84 256 0 1 |
| 171 | else |
| 172 | nova flavor-create m1.micro 84 128 0 1 |
| 173 | fi |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 174 | fi |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 175 | flavor_ref_alt=84 |
| 176 | else |
| 177 | # Check Nova for existing flavors and, if set, look for the |
| 178 | # ``DEFAULT_INSTANCE_TYPE`` and use that. |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 179 | boto_instance_type=$DEFAULT_INSTANCE_TYPE |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 180 | flavor_lines=`nova flavor-list` |
| 181 | IFS=$'\r\n' |
| 182 | flavors="" |
Dean Troyer | ceaa38b | 2012-12-12 17:09:57 -0600 | [diff] [blame] | 183 | for line in $flavor_lines; do |
| 184 | f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }") |
| 185 | flavors="$flavors $f" |
| 186 | done |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 187 | |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 188 | for line in $flavor_lines; do |
| 189 | flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`" |
| 190 | done |
| 191 | |
| 192 | IFS=" " |
| 193 | flavors=($flavors) |
| 194 | num_flavors=${#flavors[*]} |
| 195 | echo "Found $num_flavors flavors" |
| 196 | if [[ $num_flavors -eq 0 ]]; then |
| 197 | echo "Found no valid flavors to use!" |
| 198 | exit 1 |
| 199 | fi |
| 200 | flavor_ref=${flavors[0]} |
| 201 | flavor_ref_alt=$flavor_ref |
Adalberto Medeiros | 63a71a2 | 2013-06-06 08:46:04 -0400 | [diff] [blame] | 202 | |
| 203 | # ensure flavor_ref and flavor_ref_alt have different values |
| 204 | # some resize instance in tempest tests depends on this. |
| 205 | for f in ${flavors[@]:1}; do |
| 206 | if [[ $f -ne $flavor_ref ]]; then |
| 207 | flavor_ref_alt=$f |
| 208 | break |
| 209 | fi |
| 210 | done |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 211 | fi |
| 212 | |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 213 | if [ "$Q_USE_NAMESPACE" != "False" ]; then |
| 214 | tenant_networks_reachable=false |
Attila Fazekas | f9e7739 | 2013-12-03 06:17:16 +0100 | [diff] [blame] | 215 | if ! is_service_enabled n-net; then |
| 216 | ssh_connect_method="floating" |
| 217 | fi |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 218 | else |
| 219 | tenant_networks_reachable=true |
| 220 | fi |
| 221 | |
Attila Fazekas | 386ae8c | 2013-10-21 09:27:18 +0200 | [diff] [blame] | 222 | ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method} |
| 223 | |
Tomoe Sugihara | afbc631 | 2013-11-14 20:02:47 +0000 | [diff] [blame] | 224 | if [ "$Q_L3_ENABLED" = "True" ]; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 225 | public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \ |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 226 | awk '{print $2}') |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 227 | if [ "$Q_USE_NAMESPACE" == "False" ]; then |
| 228 | # If namespaces are disabled, devstack will create a single |
| 229 | # public router that tempest should be configured to use. |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 230 | public_router_id=$(neutron router-list | awk "/ $Q_ROUTER_NAME / \ |
Sean Dague | 101b424 | 2013-10-22 08:47:11 -0400 | [diff] [blame] | 231 | { print \$2 }") |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 232 | fi |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 233 | fi |
| 234 | |
Matthew Treinish | 859cc68 | 2013-07-26 15:22:44 -0400 | [diff] [blame] | 235 | # Oslo |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 236 | iniset $TEMPEST_CONFIG DEFAULT lock_path $TEMPEST_STATE_PATH |
Matthew Treinish | 14ccba0 | 2013-07-29 16:15:53 -0400 | [diff] [blame] | 237 | mkdir -p $TEMPEST_STATE_PATH |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 238 | iniset $TEMPEST_CONFIG DEFAULT use_stderr False |
| 239 | iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log |
| 240 | iniset $TEMPEST_CONFIG DEFAULT debug True |
Matthew Treinish | 859cc68 | 2013-07-26 15:22:44 -0400 | [diff] [blame] | 241 | |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 242 | # Timeouts |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 243 | iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT |
| 244 | iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT |
| 245 | iniset $TEMPEST_CONFIG boto build_timeout $BUILD_TIMEOUT |
| 246 | iniset $TEMPEST_CONFIG compute build_interval $BUILD_INTERVAL |
| 247 | iniset $TEMPEST_CONFIG volume build_interval $BUILD_INTERVAL |
| 248 | iniset $TEMPEST_CONFIG boto build_interval $BUILD_INTERVAL |
| 249 | iniset $TEMPEST_CONFIG boto http_socket_timeout 5 |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 250 | |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 251 | # Identity |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 252 | iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/" |
Matthew Treinish | 6c9430e | 2014-02-06 17:06:00 +0000 | [diff] [blame] | 253 | iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v3/" |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 254 | iniset $TEMPEST_CONFIG identity password "$password" |
| 255 | iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME |
| 256 | iniset $TEMPEST_CONFIG identity alt_password "$password" |
| 257 | iniset $TEMPEST_CONFIG identity alt_tenant_name $ALT_TENANT_NAME |
| 258 | iniset $TEMPEST_CONFIG identity admin_password "$password" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 259 | |
Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 260 | # Image |
| 261 | # for the gate we want to be able to override this variable so we aren't |
| 262 | # doing an HTTP fetch over the wide internet for this test |
| 263 | if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 264 | iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE |
Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 265 | fi |
| 266 | |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 267 | # Compute |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 268 | iniset $TEMPEST_CONFIG compute change_password_available False |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 269 | iniset $TEMPEST_CONFIG compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True} |
| 270 | iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED |
| 271 | iniset $TEMPEST_CONFIG compute network_for_ssh $PRIVATE_NETWORK_NAME |
| 272 | iniset $TEMPEST_CONFIG compute ip_version_for_ssh 4 |
| 273 | iniset $TEMPEST_CONFIG compute ssh_timeout $BUILD_TIMEOUT |
| 274 | iniset $TEMPEST_CONFIG compute image_ref $image_uuid |
| 275 | iniset $TEMPEST_CONFIG compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
| 276 | iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt |
| 277 | iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
| 278 | iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref |
| 279 | iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt |
| 280 | iniset $TEMPEST_CONFIG compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False} |
| 281 | iniset $TEMPEST_CONFIG compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False} |
| 282 | iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 283 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 284 | # Compute admin |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 285 | iniset $TEMPEST_CONFIG "compute-admin" password "$password" # DEPRECATED |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 286 | |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 287 | iniset $TEMPEST_CONFIG network api_version 2.0 |
| 288 | iniset $TEMPEST_CONFIG network tenant_networks_reachable "$tenant_networks_reachable" |
| 289 | iniset $TEMPEST_CONFIG network public_network_id "$public_network_id" |
| 290 | iniset $TEMPEST_CONFIG network public_router_id "$public_router_id" |
| 291 | iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 292 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 293 | # boto |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 294 | iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud" |
| 295 | iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}" |
| 296 | iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH" |
| 297 | iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type" |
| 298 | iniset $TEMPEST_CONFIG boto http_socket_timeout 30 |
| 299 | iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 300 | |
Steve Baker | d5cccad | 2013-07-19 10:34:24 +1200 | [diff] [blame] | 301 | # Orchestration test image |
Steve Baker | 0c5a042 | 2013-12-04 17:01:01 +1300 | [diff] [blame] | 302 | if [[ ! -z "$HEAT_FETCHED_TEST_IMAGE" ]]; then |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 303 | iniset $TEMPEST_CONFIG orchestration image_ref "$HEAT_FETCHED_TEST_IMAGE" |
Steve Baker | 0c5a042 | 2013-12-04 17:01:01 +1300 | [diff] [blame] | 304 | elif [[ "$HEAT_CREATE_TEST_IMAGE" = "True" ]]; then |
Steve Baker | d5cccad | 2013-07-19 10:34:24 +1200 | [diff] [blame] | 305 | disk_image_create /usr/share/tripleo-image-elements "vm fedora heat-cfntools" "i386" "fedora-vm-heat-cfntools-tempest" |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 306 | iniset $TEMPEST_CONFIG orchestration image_ref "fedora-vm-heat-cfntools-tempest" |
Steve Baker | d5cccad | 2013-07-19 10:34:24 +1200 | [diff] [blame] | 307 | fi |
| 308 | |
William Marshall | 24d866e | 2013-07-02 12:26:31 -0500 | [diff] [blame] | 309 | # Scenario |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 310 | iniset $TEMPEST_CONFIG scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec" |
William Marshall | 24d866e | 2013-07-02 12:26:31 -0500 | [diff] [blame] | 311 | |
Joe Gordon | bb8c6d4 | 2013-08-26 17:00:05 -0400 | [diff] [blame] | 312 | # Large Ops Number |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 313 | iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0} |
Joe Gordon | bb8c6d4 | 2013-08-26 17:00:05 -0400 | [diff] [blame] | 314 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 315 | # Volume |
Giulio Fidente | 3d60f4d | 2014-02-20 16:43:49 +0100 | [diff] [blame] | 316 | if ! is_service_enabled c-bak; then |
| 317 | iniset $TEMPEST_CONFIG volume-feature-enabled backup False |
Giulio Fidente | 3632ab1 | 2013-09-10 02:51:26 +0200 | [diff] [blame] | 318 | fi |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 319 | CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND) |
Ian Wienand | c42ed25 | 2013-06-17 13:23:44 +1000 | [diff] [blame] | 320 | if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then |
Matthew Treinish | db1c384 | 2014-02-04 20:58:00 +0000 | [diff] [blame] | 321 | iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True" |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 322 | iniset $TEMPEST_CONFIG volume backend1_name "LVM_iSCSI" |
| 323 | iniset $TEMPEST_CONFIG volume backend2_name "LVM_iSCSI_2" |
| 324 | fi |
| 325 | |
| 326 | if [ $TEMPEST_VOLUME_DRIVER != "default" ]; then |
| 327 | iniset $TEMPEST_CONFIG volume vendor_name $TEMPEST_VOLUME_VENDOR |
| 328 | iniset $TEMPEST_CONFIG volume storage_protocol $TEMPEST_STORAGE_PROTOCOL |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 329 | fi |
| 330 | |
Julie Pichon | fea70f8 | 2013-07-29 11:22:08 +0100 | [diff] [blame] | 331 | # Dashboard |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 332 | iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/" |
| 333 | iniset $TEMPEST_CONFIG dashboard login_url "http://$SERVICE_HOST/auth/login/" |
Julie Pichon | fea70f8 | 2013-07-29 11:22:08 +0100 | [diff] [blame] | 334 | |
Ian Wienand | 7fa1902 | 2013-06-25 14:11:48 +1000 | [diff] [blame] | 335 | # cli |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 336 | iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR |
Ian Wienand | 7fa1902 | 2013-06-25 14:11:48 +1000 | [diff] [blame] | 337 | |
armando-migliaccio | 1692bda | 2013-12-13 10:15:34 -0800 | [diff] [blame] | 338 | # Networking |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 339 | iniset $TEMPEST_CONFIG network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}" |
armando-migliaccio | 1692bda | 2013-12-13 10:15:34 -0800 | [diff] [blame] | 340 | |
Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 341 | # service_available |
Dean Troyer | 4237f59 | 2014-01-29 16:22:11 -0600 | [diff] [blame] | 342 | for service in ${TEMPEST_SERVICES//,/ }; do |
Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 343 | if is_service_enabled $service ; then |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 344 | iniset $TEMPEST_CONFIG service_available $service "True" |
Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 345 | else |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 346 | iniset $TEMPEST_CONFIG service_available $service "False" |
Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 347 | fi |
| 348 | done |
| 349 | |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 350 | # Restore IFS |
| 351 | IFS=$ifs |
| 352 | #Restore errexit |
| 353 | $errexit |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 354 | } |
| 355 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 356 | # install_tempest() - Collect source and prepare |
| 357 | function install_tempest() { |
| 358 | git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 359 | } |
| 360 | |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 361 | # init_tempest() - Initialize ec2 images |
| 362 | function init_tempest() { |
Scott Moser | cde655a | 2013-02-20 12:33:39 -0500 | [diff] [blame] | 363 | local base_image_name=cirros-0.3.1-x86_64 |
| 364 | # /opt/stack/devstack/files/images/cirros-0.3.1-x86_64-uec |
Attila Fazekas | 3c52922 | 2013-01-21 06:50:33 +0100 | [diff] [blame] | 365 | local image_dir="$FILES/images/${base_image_name}-uec" |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 366 | local kernel="$image_dir/${base_image_name}-vmlinuz" |
| 367 | local ramdisk="$image_dir/${base_image_name}-initrd" |
| 368 | local disk_image="$image_dir/${base_image_name}-blank.img" |
| 369 | # if the cirros uec downloaded and the system is uec capable |
| 370 | if [ -f "$kernel" -a -f "$ramdisk" -a -f "$disk_image" -a "$VIRT_DRIVER" != "openvz" \ |
Sean Dague | 101b424 | 2013-10-22 08:47:11 -0400 | [diff] [blame] | 371 | -a \( "$LIBVIRT_TYPE" != "lxc" -o "$VIRT_DRIVER" != "libvirt" \) ]; then |
| 372 | echo "Prepare aki/ari/ami Images" |
| 373 | ( #new namespace |
| 374 | # tenant:demo ; user: demo |
| 375 | source $TOP_DIR/accrc/demo/demo |
| 376 | euca-bundle-image -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH" |
| 377 | euca-bundle-image -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH" |
| 378 | euca-bundle-image -i "$disk_image" -d "$BOTO_MATERIALS_PATH" |
| 379 | ) 2>&1 </dev/null | cat |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 380 | else |
| 381 | echo "Boto materials are not prepared" |
| 382 | fi |
| 383 | } |
| 384 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 385 | # Restore xtrace |
| 386 | $XTRACE |
Sean Dague | 584d90e | 2013-03-29 14:34:53 -0400 | [diff] [blame] | 387 | |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 388 | # Tell emacs to use shell-script-mode |
| 389 | ## Local variables: |
| 390 | ## mode: shell-script |
| 391 | ## End: |