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: |
| 5 | # ``functions`` file |
Joe Gordon | 4640026 | 2013-06-30 04:32:27 -0700 | [diff] [blame] | 6 | # ``lib/nova`` service is running |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 7 | # <list other global vars that are assumed to be defined> |
Attila Fazekas | 3c52922 | 2013-01-21 06:50:33 +0100 | [diff] [blame] | 8 | # - ``DEST``, ``FILES`` |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 9 | # - ``ADMIN_PASSWORD`` |
| 10 | # - ``DEFAULT_IMAGE_NAME`` |
| 11 | # - ``S3_SERVICE_PORT`` |
| 12 | # - ``SERVICE_HOST`` |
| 13 | # - ``BASE_SQL_CONN`` ``lib/database`` declares |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 14 | # - ``PUBLIC_NETWORK_NAME`` |
| 15 | # - ``Q_USE_NAMESPACE`` |
| 16 | # - ``Q_ROUTER_NAME`` |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 17 | # - ``VIRT_DRIVER`` |
| 18 | # - ``LIBVIRT_TYPE`` |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 19 | # - ``KEYSTONE_SERVICE_PROTOCOL``, ``KEYSTONE_SERVICE_HOST`` from lib/keystone |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 20 | # Optional Dependencies: |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 21 | # ALT_* (similar vars exists in keystone_data.sh) |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 22 | # ``LIVE_MIGRATION_AVAILABLE`` |
| 23 | # ``USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION`` |
| 24 | # ``DEFAULT_INSTANCE_TYPE`` |
| 25 | # ``DEFAULT_INSTANCE_USER`` |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 26 | # ``CINDER_MULTI_LVM_BACKEND`` |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 27 | # ``stack.sh`` calls the entry points in this order: |
| 28 | # |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 29 | # install_tempest |
| 30 | # configure_tempest |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 31 | # init_tempest |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 32 | |
| 33 | # Save trace setting |
| 34 | XTRACE=$(set +o | grep xtrace) |
| 35 | set +o xtrace |
| 36 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 37 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 38 | # Defaults |
| 39 | # -------- |
| 40 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 41 | # Set up default directories |
| 42 | TEMPEST_DIR=$DEST/tempest |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 43 | TEMPEST_CONF_DIR=$TEMPEST_DIR/etc |
| 44 | TEMPEST_CONF=$TEMPEST_CONF_DIR/tempest.conf |
| 45 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 46 | NOVA_SOURCE_DIR=$DEST/nova |
| 47 | |
Attila Fazekas | bae0233 | 2013-05-09 09:24:49 +0200 | [diff] [blame] | 48 | BUILD_INTERVAL=1 |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 49 | BUILD_TIMEOUT=400 |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 50 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 51 | |
Scott Moser | cde655a | 2013-02-20 12:33:39 -0500 | [diff] [blame] | 52 | BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1" |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 53 | |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 54 | |
| 55 | # Functions |
| 56 | # --------- |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 57 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 58 | # configure_tempest() - Set config files, create data dirs, etc |
| 59 | function configure_tempest() { |
Matthew Treinish | 95fb0d4 | 2013-01-28 16:24:14 -0500 | [diff] [blame] | 60 | setup_develop $TEMPEST_DIR |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 61 | local image_lines |
| 62 | local images |
| 63 | local num_images |
| 64 | local image_uuid |
| 65 | local image_uuid_alt |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 66 | local errexit |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 67 | local password |
| 68 | local line |
| 69 | local flavors |
| 70 | local flavors_ref |
| 71 | local flavor_lines |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 72 | local public_network_id |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 73 | local public_router_id |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 74 | local tenant_networks_reachable |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 75 | local boto_instance_type="m1.tiny" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 76 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 77 | # TODO(afazekas): |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 78 | # sudo python setup.py deploy |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 79 | |
| 80 | # 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] | 81 | # only the first error that occurred. |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 82 | errexit=$(set +o | grep errexit) |
| 83 | set -o errexit |
| 84 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 85 | # Save IFS |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 86 | ifs=$IFS |
| 87 | |
| 88 | # Glance should already contain images to be used in tempest |
| 89 | # testing. Here we simply look for images stored in Glance |
| 90 | # and set the appropriate variables for use in the tempest config |
| 91 | # We ignore ramdisk and kernel images, look for the default image |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 92 | # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the |
| 93 | # first image returned and set ``image_uuid_alt`` to the second, |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 94 | # if there is more than one returned... |
| 95 | # ... 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] | 96 | declare -a images |
| 97 | |
| 98 | while read -r IMAGE_NAME IMAGE_UUID; do |
| 99 | if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then |
| 100 | image_uuid="$IMAGE_UUID" |
| 101 | image_uuid_alt="$IMAGE_UUID" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 102 | fi |
Cody A.W. Somerville | c24e23b | 2012-12-21 02:10:45 -0500 | [diff] [blame] | 103 | images+=($IMAGE_UUID) |
| 104 | done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }') |
| 105 | |
| 106 | case "${#images[*]}" in |
| 107 | 0) |
| 108 | echo "Found no valid images to use!" |
| 109 | exit 1 |
| 110 | ;; |
| 111 | 1) |
| 112 | if [ -z "$image_uuid" ]; then |
| 113 | image_uuid=${images[0]} |
| 114 | image_uuid_alt=${images[0]} |
| 115 | fi |
| 116 | ;; |
| 117 | *) |
| 118 | if [ -z "$image_uuid" ]; then |
| 119 | image_uuid=${images[0]} |
| 120 | image_uuid_alt=${images[1]} |
| 121 | fi |
| 122 | ;; |
| 123 | esac |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 124 | |
| 125 | # Create tempest.conf from tempest.conf.sample |
| 126 | # copy every time, because the image UUIDS are going to change |
| 127 | cp $TEMPEST_CONF.sample $TEMPEST_CONF |
| 128 | |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 129 | password=${ADMIN_PASSWORD:-secrete} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 130 | |
| 131 | # See files/keystone_data.sh where alt_demo user |
| 132 | # and tenant are set up... |
| 133 | ALT_USERNAME=${ALT_USERNAME:-alt_demo} |
| 134 | ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo} |
| 135 | |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 136 | # If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior |
| 137 | # Tempest creates instane types for himself |
| 138 | if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then |
Attila Fazekas | 02c0bcc | 2013-01-14 19:10:17 +0100 | [diff] [blame] | 139 | nova flavor-create m1.nano 42 64 0 1 |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 140 | flavor_ref=42 |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 141 | boto_instance_type=m1.nano |
Attila Fazekas | 02c0bcc | 2013-01-14 19:10:17 +0100 | [diff] [blame] | 142 | nova flavor-create m1.micro 84 128 0 1 |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 143 | flavor_ref_alt=84 |
| 144 | else |
| 145 | # Check Nova for existing flavors and, if set, look for the |
| 146 | # ``DEFAULT_INSTANCE_TYPE`` and use that. |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 147 | boto_instance_type=$DEFAULT_INSTANCE_TYPE |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 148 | flavor_lines=`nova flavor-list` |
| 149 | IFS=$'\r\n' |
| 150 | flavors="" |
Dean Troyer | ceaa38b | 2012-12-12 17:09:57 -0600 | [diff] [blame] | 151 | for line in $flavor_lines; do |
| 152 | f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }") |
| 153 | flavors="$flavors $f" |
| 154 | done |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 155 | |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 156 | for line in $flavor_lines; do |
| 157 | flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`" |
| 158 | done |
| 159 | |
| 160 | IFS=" " |
| 161 | flavors=($flavors) |
| 162 | num_flavors=${#flavors[*]} |
| 163 | echo "Found $num_flavors flavors" |
| 164 | if [[ $num_flavors -eq 0 ]]; then |
| 165 | echo "Found no valid flavors to use!" |
| 166 | exit 1 |
| 167 | fi |
| 168 | flavor_ref=${flavors[0]} |
| 169 | flavor_ref_alt=$flavor_ref |
Adalberto Medeiros | 63a71a2 | 2013-06-06 08:46:04 -0400 | [diff] [blame] | 170 | |
| 171 | # ensure flavor_ref and flavor_ref_alt have different values |
| 172 | # some resize instance in tempest tests depends on this. |
| 173 | for f in ${flavors[@]:1}; do |
| 174 | if [[ $f -ne $flavor_ref ]]; then |
| 175 | flavor_ref_alt=$f |
| 176 | break |
| 177 | fi |
| 178 | done |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 179 | fi |
| 180 | |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 181 | if [ "$Q_USE_NAMESPACE" != "False" ]; then |
| 182 | tenant_networks_reachable=false |
| 183 | else |
| 184 | tenant_networks_reachable=true |
| 185 | fi |
| 186 | |
| 187 | if is_service_enabled q-l3; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame^] | 188 | public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \ |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 189 | awk '{print $2}') |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 190 | if [ "$Q_USE_NAMESPACE" == "False" ]; then |
| 191 | # If namespaces are disabled, devstack will create a single |
| 192 | # public router that tempest should be configured to use. |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame^] | 193 | public_router_id=$(neutron router-list | awk "/ $Q_ROUTER_NAME / \ |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 194 | { print \$2 }") |
| 195 | fi |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 196 | fi |
| 197 | |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 198 | # Timeouts |
| 199 | iniset $TEMPEST_CONF compute build_timeout $BUILD_TIMEOUT |
| 200 | iniset $TEMPEST_CONF volume build_timeout $BUILD_TIMEOUT |
| 201 | iniset $TEMPEST_CONF boto build_timeout $BUILD_TIMEOUT |
| 202 | iniset $TEMPEST_CONF compute build_interval $BUILD_INTERVAL |
| 203 | iniset $TEMPEST_CONF volume build_interval $BUILD_INTERVAL |
| 204 | iniset $TEMPEST_CONF boto build_interval $BUILD_INTERVAL |
| 205 | iniset $TEMPEST_CONF boto http_socket_timeout 5 |
| 206 | |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 207 | # Identity |
| 208 | iniset $TEMPEST_CONF identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/" |
| 209 | iniset $TEMPEST_CONF identity password "$password" |
| 210 | iniset $TEMPEST_CONF identity alt_username $ALT_USERNAME |
| 211 | iniset $TEMPEST_CONF identity alt_password "$password" |
| 212 | iniset $TEMPEST_CONF identity alt_tenant_name $ALT_TENANT_NAME |
| 213 | iniset $TEMPEST_CONF identity admin_password "$password" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 214 | |
Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 215 | # Image |
| 216 | # for the gate we want to be able to override this variable so we aren't |
| 217 | # doing an HTTP fetch over the wide internet for this test |
| 218 | if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then |
| 219 | iniset $TEMPEST_CONF image http_image $TEMPEST_HTTP_IMAGE |
| 220 | fi |
| 221 | |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 222 | # Compute |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 223 | iniset $TEMPEST_CONF compute change_password_available False |
Nachi Ueno | 06fac37 | 2012-12-26 14:09:43 -0800 | [diff] [blame] | 224 | # Note(nati) current tempest don't create network for each tenant |
| 225 | # so reuse same tenant for now |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame^] | 226 | if is_service_enabled neutron; then |
Nachi Ueno | 06fac37 | 2012-12-26 14:09:43 -0800 | [diff] [blame] | 227 | TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-False} |
| 228 | fi |
| 229 | iniset $TEMPEST_CONF compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True} |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 230 | iniset $TEMPEST_CONF compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED |
Akihiro MOTOKI | 66afb47 | 2012-12-21 15:34:13 +0900 | [diff] [blame] | 231 | iniset $TEMPEST_CONF compute network_for_ssh $PRIVATE_NETWORK_NAME |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 232 | iniset $TEMPEST_CONF compute ip_version_for_ssh 4 |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 233 | iniset $TEMPEST_CONF compute ssh_timeout $BUILD_TIMEOUT |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 234 | iniset $TEMPEST_CONF compute image_ref $image_uuid |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 235 | iniset $TEMPEST_CONF compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 236 | iniset $TEMPEST_CONF compute image_ref_alt $image_uuid_alt |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 237 | iniset $TEMPEST_CONF compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 238 | iniset $TEMPEST_CONF compute flavor_ref $flavor_ref |
| 239 | iniset $TEMPEST_CONF compute flavor_ref_alt $flavor_ref_alt |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 240 | iniset $TEMPEST_CONF compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False} |
Akihiro MOTOKI | 66afb47 | 2012-12-21 15:34:13 +0900 | [diff] [blame] | 241 | iniset $TEMPEST_CONF compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False} |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 242 | |
| 243 | # Whitebox |
| 244 | iniset $TEMPEST_CONF whitebox source_dir $NOVA_SOURCE_DIR |
| 245 | iniset $TEMPEST_CONF whitebox bin_dir $NOVA_BIN_DIR |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 246 | # TODO(jaypipes): Create the key file here... right now, no whitebox |
| 247 | # tests actually use a key. |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 248 | iniset $TEMPEST_CONF whitebox path_to_private_key $TEMPEST_DIR/id_rsa |
| 249 | iniset $TEMPEST_CONF whitebox db_uri $BASE_SQL_CONN/nova |
| 250 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 251 | # Compute admin |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 252 | iniset $TEMPEST_CONF "compute-admin" password "$password" # DEPRECATED |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 253 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 254 | # Network |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame^] | 255 | if is_service_enabled neutron; then |
| 256 | iniset $TEMPEST_CONF network neutron_available "True" |
Sean Dague | 4a20f9a | 2013-03-01 07:23:38 -0500 | [diff] [blame] | 257 | fi |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 258 | iniset $TEMPEST_CONF network api_version 2.0 |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 259 | iniset $TEMPEST_CONF network tenant_networks_reachable "$tenant_networks_reachable" |
| 260 | iniset $TEMPEST_CONF network public_network_id "$public_network_id" |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 261 | iniset $TEMPEST_CONF network public_router_id "$public_router_id" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 262 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 263 | # boto |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 264 | iniset $TEMPEST_CONF boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud" |
| 265 | iniset $TEMPEST_CONF boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}" |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 266 | iniset $TEMPEST_CONF boto s3_materials_path "$BOTO_MATERIALS_PATH" |
| 267 | iniset $TEMPEST_CONF boto instance_type "$boto_instance_type" |
| 268 | iniset $TEMPEST_CONF boto http_socket_timeout 30 |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 269 | iniset $TEMPEST_CONF boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 270 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 271 | # Orchestration |
Steve Baker | 26824b0 | 2013-06-04 13:15:04 +1200 | [diff] [blame] | 272 | if is_service_enabled heat; then |
| 273 | iniset $TEMPEST_CONF orchestration heat_available "True" |
| 274 | fi |
| 275 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 276 | # Volume |
| 277 | CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND) |
Ian Wienand | c42ed25 | 2013-06-17 13:23:44 +1000 | [diff] [blame] | 278 | if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 279 | iniset $TEMPEST_CONF volume multi_backend_enabled "True" |
| 280 | iniset $TEMPEST_CONF volume backend1_name "LVM_iSCSI" |
| 281 | iniset $TEMPEST_CONF volume backend2_name "LVM_iSCSI_2" |
| 282 | fi |
| 283 | |
Ian Wienand | 7fa1902 | 2013-06-25 14:11:48 +1000 | [diff] [blame] | 284 | # cli |
| 285 | iniset $TEMPEST_CONF cli cli_dir $NOVA_BIN_DIR |
| 286 | |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 287 | echo "Created tempest configuration file:" |
| 288 | cat $TEMPEST_CONF |
| 289 | |
| 290 | # Restore IFS |
| 291 | IFS=$ifs |
| 292 | #Restore errexit |
| 293 | $errexit |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 294 | } |
| 295 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 296 | # install_tempest() - Collect source and prepare |
| 297 | function install_tempest() { |
| 298 | git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 299 | } |
| 300 | |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 301 | # init_tempest() - Initialize ec2 images |
| 302 | function init_tempest() { |
Scott Moser | cde655a | 2013-02-20 12:33:39 -0500 | [diff] [blame] | 303 | local base_image_name=cirros-0.3.1-x86_64 |
| 304 | # /opt/stack/devstack/files/images/cirros-0.3.1-x86_64-uec |
Attila Fazekas | 3c52922 | 2013-01-21 06:50:33 +0100 | [diff] [blame] | 305 | local image_dir="$FILES/images/${base_image_name}-uec" |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 306 | local kernel="$image_dir/${base_image_name}-vmlinuz" |
| 307 | local ramdisk="$image_dir/${base_image_name}-initrd" |
| 308 | local disk_image="$image_dir/${base_image_name}-blank.img" |
| 309 | # if the cirros uec downloaded and the system is uec capable |
| 310 | if [ -f "$kernel" -a -f "$ramdisk" -a -f "$disk_image" -a "$VIRT_DRIVER" != "openvz" \ |
| 311 | -a \( "$LIBVIRT_TYPE" != "lxc" -o "$VIRT_DRIVER" != "libvirt" \) ]; then |
| 312 | echo "Prepare aki/ari/ami Images" |
| 313 | ( #new namespace |
| 314 | # tenant:demo ; user: demo |
Chris Yeoh | b0b98b7 | 2013-01-23 21:14:49 +1030 | [diff] [blame] | 315 | source $TOP_DIR/accrc/demo/demo |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 316 | euca-bundle-image -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH" |
| 317 | euca-bundle-image -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH" |
| 318 | euca-bundle-image -i "$disk_image" -d "$BOTO_MATERIALS_PATH" |
| 319 | ) 2>&1 </dev/null | cat |
| 320 | else |
| 321 | echo "Boto materials are not prepared" |
| 322 | fi |
| 323 | } |
| 324 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 325 | # Restore xtrace |
| 326 | $XTRACE |
Sean Dague | 584d90e | 2013-03-29 14:34:53 -0400 | [diff] [blame] | 327 | |
| 328 | # Local variables: |
| 329 | # mode: shell-script |
| 330 | # End: |