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