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`` |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 31 | # |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 32 | # ``stack.sh`` calls the entry points in this order: |
| 33 | # |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 34 | # - install_tempest |
| 35 | # - configure_tempest |
| 36 | # - init_tempest |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 37 | |
| 38 | # Save trace setting |
| 39 | XTRACE=$(set +o | grep xtrace) |
| 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} |
Matthew Treinish | 3472386 | 2014-09-08 14:01:21 -0400 | [diff] [blame] | 51 | TEMPEST_LIB_DIR=$DEST/tempest-lib |
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 |
Arx Cruz | 1bde9b4 | 2014-07-18 11:34:33 -0300 | [diff] [blame] | 56 | |
| 57 | # This is the timeout that tempest will wait for a VM to change state, |
| 58 | # spawn, delete, etc. |
| 59 | # The default is set to 196 seconds. |
| 60 | BUILD_TIMEOUT=${BUILD_TIMEOUT:-196} |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 61 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 62 | |
Attila Fazekas | 2d4c8da | 2014-03-19 10:42:01 +0100 | [diff] [blame] | 63 | BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-${CIRROS_VERSION}" |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 64 | |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 65 | # Cinder/Volume variables |
| 66 | TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default} |
Eric Harney | 0145648 | 2014-10-14 18:53:53 -0400 | [diff] [blame] | 67 | TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source" |
| 68 | TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-$TEMPEST_DEFAULT_VOLUME_VENDOR} |
| 69 | TEMPEST_DEFAULT_STORAGE_PROTOCOL="iSCSI" |
| 70 | TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-$TEMPEST_DEFAULT_STORAGE_PROTOCOL} |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 71 | |
armando-migliaccio | 71ef61a | 2014-02-19 22:19:24 -0800 | [diff] [blame] | 72 | # Neutron/Network variables |
| 73 | IPV6_ENABLED=$(trueorfalse True $IPV6_ENABLED) |
sridhargaddam | fe733ae | 2014-06-03 09:03:45 +0530 | [diff] [blame] | 74 | IPV6_SUBNET_ATTRIBUTES_ENABLED=$(trueorfalse True $IPV6_SUBNET_ATTRIBUTES_ENABLED) |
armando-migliaccio | 71ef61a | 2014-02-19 22:19:24 -0800 | [diff] [blame] | 75 | |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 76 | # Functions |
| 77 | # --------- |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 78 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 79 | # configure_tempest() - Set config files, create data dirs, etc |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 80 | function configure_tempest { |
Matthew Treinish | 95fb0d4 | 2013-01-28 16:24:14 -0500 | [diff] [blame] | 81 | setup_develop $TEMPEST_DIR |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 82 | local image_lines |
| 83 | local images |
| 84 | local num_images |
| 85 | local image_uuid |
| 86 | local image_uuid_alt |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 87 | local password |
| 88 | local line |
| 89 | local flavors |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 90 | local available_flavors |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 91 | local flavors_ref |
| 92 | local flavor_lines |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 93 | local public_network_id |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 94 | local public_router_id |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 95 | local tenant_networks_reachable |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 96 | local boto_instance_type="m1.tiny" |
Attila Fazekas | 386ae8c | 2013-10-21 09:27:18 +0200 | [diff] [blame] | 97 | local ssh_connect_method="fixed" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 98 | |
Dean Troyer | 6d04fd7 | 2012-12-21 11:03:37 -0600 | [diff] [blame] | 99 | # Save IFS |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 100 | ifs=$IFS |
| 101 | |
| 102 | # Glance should already contain images to be used in tempest |
| 103 | # testing. Here we simply look for images stored in Glance |
| 104 | # and set the appropriate variables for use in the tempest config |
| 105 | # We ignore ramdisk and kernel images, look for the default image |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 106 | # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the |
| 107 | # first image returned and set ``image_uuid_alt`` to the second, |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 108 | # if there is more than one returned... |
| 109 | # ... 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] | 110 | declare -a images |
| 111 | |
| 112 | while read -r IMAGE_NAME IMAGE_UUID; do |
| 113 | if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then |
| 114 | image_uuid="$IMAGE_UUID" |
| 115 | image_uuid_alt="$IMAGE_UUID" |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 116 | fi |
Cody A.W. Somerville | c24e23b | 2012-12-21 02:10:45 -0500 | [diff] [blame] | 117 | images+=($IMAGE_UUID) |
Steve Martinelli | 5c206c2 | 2014-08-02 20:32:31 -0400 | [diff] [blame] | 118 | # TODO(stevemar): update this command to use openstackclient's `openstack image list` |
| 119 | # when it supports listing by status. |
Cody A.W. Somerville | c24e23b | 2012-12-21 02:10:45 -0500 | [diff] [blame] | 120 | done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }') |
| 121 | |
| 122 | case "${#images[*]}" in |
| 123 | 0) |
| 124 | echo "Found no valid images to use!" |
| 125 | exit 1 |
| 126 | ;; |
| 127 | 1) |
| 128 | if [ -z "$image_uuid" ]; then |
| 129 | image_uuid=${images[0]} |
| 130 | image_uuid_alt=${images[0]} |
| 131 | fi |
| 132 | ;; |
| 133 | *) |
| 134 | if [ -z "$image_uuid" ]; then |
| 135 | image_uuid=${images[0]} |
| 136 | image_uuid_alt=${images[1]} |
| 137 | fi |
| 138 | ;; |
| 139 | esac |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 140 | |
| 141 | # Create tempest.conf from tempest.conf.sample |
| 142 | # copy every time, because the image UUIDS are going to change |
Ian Wienand | 5f90fc0 | 2014-02-24 15:40:42 +1100 | [diff] [blame] | 143 | if [[ ! -d $TEMPEST_CONFIG_DIR ]]; then |
| 144 | sudo mkdir -p $TEMPEST_CONFIG_DIR |
| 145 | fi |
| 146 | sudo chown $STACK_USER $TEMPEST_CONFIG_DIR |
| 147 | cp $TEMPEST_DIR/etc/tempest.conf.sample $TEMPEST_CONFIG |
| 148 | chmod 644 $TEMPEST_CONFIG |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 149 | |
Attila Fazekas | 65c0846 | 2012-12-07 14:20:51 +0100 | [diff] [blame] | 150 | password=${ADMIN_PASSWORD:-secrete} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 151 | |
Andrea Frittoli | d46d9dd | 2014-03-05 13:38:19 +0000 | [diff] [blame] | 152 | # See files/keystone_data.sh and stack.sh where admin, demo and alt_demo |
| 153 | # user and tenant are set up... |
| 154 | ADMIN_USERNAME=${ADMIN_USERNAME:-admin} |
| 155 | ADMIN_TENANT_NAME=${ADMIN_TENANT_NAME:-admin} |
Andrea Frittoli | 0352325 | 2014-04-08 13:43:56 +0100 | [diff] [blame] | 156 | ADMIN_DOMAIN_NAME=${ADMIN_DOMAIN_NAME:-Default} |
Andrea Frittoli | d46d9dd | 2014-03-05 13:38:19 +0000 | [diff] [blame] | 157 | TEMPEST_USERNAME=${TEMPEST_USERNAME:-demo} |
| 158 | TEMPEST_TENANT_NAME=${TEMPEST_TENANT_NAME:-demo} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 159 | ALT_USERNAME=${ALT_USERNAME:-alt_demo} |
| 160 | ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo} |
Harshada Mangesh Kakad | 4912623 | 2014-05-23 09:16:52 +0000 | [diff] [blame] | 161 | ADMIN_TENANT_ID=$(openstack project list | awk "/ admin / { print \$2 }") |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 162 | |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 163 | # If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior |
| 164 | # Tempest creates instane types for himself |
| 165 | if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 166 | available_flavors=$(nova flavor-list) |
| 167 | if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then |
Rafael Folco | ba0f1d3 | 2013-12-06 17:56:24 -0200 | [diff] [blame] | 168 | if is_arch "ppc64"; then |
| 169 | # qemu needs at least 128MB of memory to boot on ppc64 |
| 170 | nova flavor-create m1.nano 42 128 0 1 |
| 171 | else |
| 172 | nova flavor-create m1.nano 42 64 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=42 |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 176 | boto_instance_type=m1.nano |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 177 | if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then |
Rafael Folco | ba0f1d3 | 2013-12-06 17:56:24 -0200 | [diff] [blame] | 178 | if is_arch "ppc64"; then |
| 179 | nova flavor-create m1.micro 84 256 0 1 |
| 180 | else |
| 181 | nova flavor-create m1.micro 84 128 0 1 |
| 182 | fi |
Clark Boylan | 3b80bde | 2013-11-20 17:51:50 -0800 | [diff] [blame] | 183 | fi |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 184 | flavor_ref_alt=84 |
| 185 | else |
| 186 | # Check Nova for existing flavors and, if set, look for the |
| 187 | # ``DEFAULT_INSTANCE_TYPE`` and use that. |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 188 | boto_instance_type=$DEFAULT_INSTANCE_TYPE |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 189 | flavor_lines=`nova flavor-list` |
| 190 | IFS=$'\r\n' |
| 191 | flavors="" |
Dean Troyer | ceaa38b | 2012-12-12 17:09:57 -0600 | [diff] [blame] | 192 | for line in $flavor_lines; do |
| 193 | f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }") |
| 194 | flavors="$flavors $f" |
| 195 | done |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 196 | |
Attila Fazekas | 7bf1dd3 | 2013-01-12 17:31:26 +0100 | [diff] [blame] | 197 | for line in $flavor_lines; do |
| 198 | flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`" |
| 199 | done |
| 200 | |
| 201 | IFS=" " |
| 202 | flavors=($flavors) |
| 203 | num_flavors=${#flavors[*]} |
| 204 | echo "Found $num_flavors flavors" |
| 205 | if [[ $num_flavors -eq 0 ]]; then |
| 206 | echo "Found no valid flavors to use!" |
| 207 | exit 1 |
| 208 | fi |
| 209 | flavor_ref=${flavors[0]} |
| 210 | flavor_ref_alt=$flavor_ref |
Adalberto Medeiros | 63a71a2 | 2013-06-06 08:46:04 -0400 | [diff] [blame] | 211 | |
| 212 | # ensure flavor_ref and flavor_ref_alt have different values |
| 213 | # some resize instance in tempest tests depends on this. |
| 214 | for f in ${flavors[@]:1}; do |
| 215 | if [[ $f -ne $flavor_ref ]]; then |
| 216 | flavor_ref_alt=$f |
| 217 | break |
| 218 | fi |
| 219 | done |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 220 | fi |
| 221 | |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 222 | if [ "$Q_USE_NAMESPACE" != "False" ]; then |
| 223 | tenant_networks_reachable=false |
Attila Fazekas | f9e7739 | 2013-12-03 06:17:16 +0100 | [diff] [blame] | 224 | if ! is_service_enabled n-net; then |
| 225 | ssh_connect_method="floating" |
| 226 | fi |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 227 | else |
| 228 | tenant_networks_reachable=true |
| 229 | fi |
| 230 | |
Attila Fazekas | 386ae8c | 2013-10-21 09:27:18 +0200 | [diff] [blame] | 231 | ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method} |
| 232 | |
Tomoe Sugihara | afbc631 | 2013-11-14 20:02:47 +0000 | [diff] [blame] | 233 | if [ "$Q_L3_ENABLED" = "True" ]; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 234 | public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \ |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 235 | awk '{print $2}') |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 236 | if [ "$Q_USE_NAMESPACE" == "False" ]; then |
| 237 | # If namespaces are disabled, devstack will create a single |
| 238 | # public router that tempest should be configured to use. |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 239 | public_router_id=$(neutron router-list | awk "/ $Q_ROUTER_NAME / \ |
Sean Dague | 101b424 | 2013-10-22 08:47:11 -0400 | [diff] [blame] | 240 | { print \$2 }") |
Maru Newby | 31c94ab | 2012-12-19 03:59:20 +0000 | [diff] [blame] | 241 | fi |
Maru Newby | a5c774e | 2012-12-10 10:40:01 +0000 | [diff] [blame] | 242 | fi |
| 243 | |
Matthew Treinish | 859cc68 | 2013-07-26 15:22:44 -0400 | [diff] [blame] | 244 | # Oslo |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 245 | iniset $TEMPEST_CONFIG DEFAULT lock_path $TEMPEST_STATE_PATH |
Matthew Treinish | 14ccba0 | 2013-07-29 16:15:53 -0400 | [diff] [blame] | 246 | mkdir -p $TEMPEST_STATE_PATH |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 247 | iniset $TEMPEST_CONFIG DEFAULT use_stderr False |
| 248 | iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log |
| 249 | iniset $TEMPEST_CONFIG DEFAULT debug True |
Matthew Treinish | 859cc68 | 2013-07-26 15:22:44 -0400 | [diff] [blame] | 250 | |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 251 | # Timeouts |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 252 | iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT |
| 253 | iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT |
| 254 | iniset $TEMPEST_CONFIG boto build_timeout $BUILD_TIMEOUT |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 255 | iniset $TEMPEST_CONFIG boto http_socket_timeout 5 |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 256 | |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 257 | # Identity |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 258 | 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] | 259 | iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v3/" |
Andrea Frittoli | d46d9dd | 2014-03-05 13:38:19 +0000 | [diff] [blame] | 260 | iniset $TEMPEST_CONFIG identity username $TEMPEST_USERNAME |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 261 | iniset $TEMPEST_CONFIG identity password "$password" |
Andrea Frittoli | d46d9dd | 2014-03-05 13:38:19 +0000 | [diff] [blame] | 262 | iniset $TEMPEST_CONFIG identity tenant_name $TEMPEST_TENANT_NAME |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 263 | iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME |
| 264 | iniset $TEMPEST_CONFIG identity alt_password "$password" |
| 265 | iniset $TEMPEST_CONFIG identity alt_tenant_name $ALT_TENANT_NAME |
Andrea Frittoli | d46d9dd | 2014-03-05 13:38:19 +0000 | [diff] [blame] | 266 | iniset $TEMPEST_CONFIG identity admin_username $ADMIN_USERNAME |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 267 | iniset $TEMPEST_CONFIG identity admin_password "$password" |
Andrea Frittoli | d46d9dd | 2014-03-05 13:38:19 +0000 | [diff] [blame] | 268 | iniset $TEMPEST_CONFIG identity admin_tenant_name $ADMIN_TENANT_NAME |
Harshada Mangesh Kakad | 4912623 | 2014-05-23 09:16:52 +0000 | [diff] [blame] | 269 | iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID |
Andrea Frittoli | 0352325 | 2014-04-08 13:43:56 +0100 | [diff] [blame] | 270 | iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME |
Andrea Frittoli | 07f1d0e | 2014-03-06 23:23:01 +0000 | [diff] [blame] | 271 | iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 272 | |
Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 273 | # Image |
| 274 | # for the gate we want to be able to override this variable so we aren't |
| 275 | # doing an HTTP fetch over the wide internet for this test |
| 276 | if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 277 | iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE |
Sean Dague | c377145 | 2013-06-13 14:23:37 -0400 | [diff] [blame] | 278 | fi |
| 279 | |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 280 | # Compute |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 281 | iniset $TEMPEST_CONFIG compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True} |
| 282 | iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED |
| 283 | iniset $TEMPEST_CONFIG compute network_for_ssh $PRIVATE_NETWORK_NAME |
| 284 | iniset $TEMPEST_CONFIG compute ip_version_for_ssh 4 |
| 285 | iniset $TEMPEST_CONFIG compute ssh_timeout $BUILD_TIMEOUT |
| 286 | iniset $TEMPEST_CONFIG compute image_ref $image_uuid |
| 287 | iniset $TEMPEST_CONFIG compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
| 288 | iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt |
| 289 | iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
| 290 | iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref |
| 291 | iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 292 | iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method |
Attila Fazekas | 97d3d20 | 2013-01-19 19:20:49 +0100 | [diff] [blame] | 293 | |
Sean Dague | de19bf9 | 2014-03-20 16:54:58 -0400 | [diff] [blame] | 294 | # Compute Features |
| 295 | iniset $TEMPEST_CONFIG compute-feature-enabled resize True |
Matthew Treinish | 270f93e | 2014-03-20 21:18:42 +0000 | [diff] [blame] | 296 | iniset $TEMPEST_CONFIG compute-feature-enabled live_migration ${LIVE_MIGRATION_AVAILABLE:-False} |
| 297 | iniset $TEMPEST_CONFIG compute-feature-enabled change_password False |
| 298 | iniset $TEMPEST_CONFIG compute-feature-enabled block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False} |
Salvatore Orlando | 3046bc6 | 2014-08-21 12:11:10 -0700 | [diff] [blame] | 299 | iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions ${COMPUTE_API_EXTENSIONS:-"all"} |
| 300 | iniset $TEMPEST_CONFIG compute-feature-disabled api_extensions ${DISABLE_COMPUTE_API_EXTENSIONS} |
Sean Dague | de19bf9 | 2014-03-20 16:54:58 -0400 | [diff] [blame] | 301 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 302 | # Compute admin |
Sean Dague | e530ba3 | 2014-03-07 05:58:18 -0500 | [diff] [blame] | 303 | iniset $TEMPEST_CONFIG "compute-admin" username $ADMIN_USERNAME |
| 304 | iniset $TEMPEST_CONFIG "compute-admin" password "$password" |
| 305 | iniset $TEMPEST_CONFIG "compute-admin" tenant_name $ADMIN_TENANT_NAME |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 306 | |
armando-migliaccio | 71ef61a | 2014-02-19 22:19:24 -0800 | [diff] [blame] | 307 | # Network |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 308 | iniset $TEMPEST_CONFIG network api_version 2.0 |
| 309 | iniset $TEMPEST_CONFIG network tenant_networks_reachable "$tenant_networks_reachable" |
| 310 | iniset $TEMPEST_CONFIG network public_network_id "$public_network_id" |
| 311 | iniset $TEMPEST_CONFIG network public_router_id "$public_router_id" |
| 312 | iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE" |
Matthew Treinish | ccf60f7 | 2014-03-03 22:48:31 -0500 | [diff] [blame] | 313 | iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED" |
Sean M. Collins | bb2908b | 2014-05-15 10:24:31 -0400 | [diff] [blame] | 314 | iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED" |
Salvatore Orlando | 3046bc6 | 2014-08-21 12:11:10 -0700 | [diff] [blame] | 315 | iniset $TEMPEST_CONFIG network-feature-enabled api_extensions ${NETWORK_API_EXTENSIONS:-"all"} |
| 316 | iniset $TEMPEST_CONFIG network-feature-disabled api_extensions ${DISABLE_NETWORK_API_EXTENSIONS} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 317 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 318 | # boto |
Rob Crittenden | 18d4778 | 2014-03-19 17:47:42 -0400 | [diff] [blame] | 319 | iniset $TEMPEST_CONFIG boto ec2_url "$EC2_SERVICE_PROTOCOL://$SERVICE_HOST:8773/services/Cloud" |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 320 | iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}" |
| 321 | iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH" |
Adalberto Medeiros | 5397153 | 2014-07-10 16:55:49 -0300 | [diff] [blame] | 322 | iniset $TEMPEST_CONFIG boto ari_manifest cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-initrd.manifest.xml |
| 323 | iniset $TEMPEST_CONFIG boto ami_manifest cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-blank.img.manifest.xml |
| 324 | iniset $TEMPEST_CONFIG boto aki_manifest cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-vmlinuz.manifest.xml |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 325 | iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type" |
| 326 | iniset $TEMPEST_CONFIG boto http_socket_timeout 30 |
| 327 | iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros} |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 328 | |
Sean Dague | 669c4fc | 2014-04-03 11:28:01 -0400 | [diff] [blame] | 329 | # Orchestration Tests |
| 330 | if is_service_enabled heat; then |
| 331 | if [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then |
| 332 | iniset $TEMPEST_CONFIG orchestration image_ref $(basename "$HEAT_CFN_IMAGE_URL" ".qcow2") |
| 333 | fi |
Attila Fazekas | 51557a5 | 2014-06-13 16:09:37 +0200 | [diff] [blame] | 334 | # build a specialized heat flavor |
Sean Dague | 669c4fc | 2014-04-03 11:28:01 -0400 | [diff] [blame] | 335 | available_flavors=$(nova flavor-list) |
| 336 | if [[ ! ( $available_flavors =~ 'm1.heat' ) ]]; then |
Attila Fazekas | 51557a5 | 2014-06-13 16:09:37 +0200 | [diff] [blame] | 337 | nova flavor-create m1.heat 451 512 0 1 |
Sean Dague | 669c4fc | 2014-04-03 11:28:01 -0400 | [diff] [blame] | 338 | fi |
| 339 | iniset $TEMPEST_CONFIG orchestration instance_type "m1.heat" |
| 340 | iniset $TEMPEST_CONFIG orchestration build_timeout 900 |
Steve Baker | d5cccad | 2013-07-19 10:34:24 +1200 | [diff] [blame] | 341 | fi |
| 342 | |
William Marshall | 24d866e | 2013-07-02 12:26:31 -0500 | [diff] [blame] | 343 | # Scenario |
Adalberto Medeiros | 5397153 | 2014-07-10 16:55:49 -0300 | [diff] [blame] | 344 | iniset $TEMPEST_CONFIG scenario img_dir "$FILES/images/cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-uec" |
| 345 | iniset $TEMPEST_CONFIG scenario ami_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-blank.img" |
| 346 | iniset $TEMPEST_CONFIG scenario ari_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-initrd" |
| 347 | iniset $TEMPEST_CONFIG scenario aki_img_file "cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-vmlinuz" |
William Marshall | 24d866e | 2013-07-02 12:26:31 -0500 | [diff] [blame] | 348 | |
Joe Gordon | bb8c6d4 | 2013-08-26 17:00:05 -0400 | [diff] [blame] | 349 | # Large Ops Number |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 350 | iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0} |
Joe Gordon | bb8c6d4 | 2013-08-26 17:00:05 -0400 | [diff] [blame] | 351 | |
Vadim Rovachev | 2541d61 | 2014-05-29 18:48:10 +0400 | [diff] [blame] | 352 | # Telemetry |
| 353 | # Ceilometer API optimization happened in juno that allows to run more tests in tempest. |
| 354 | # Once Tempest retires support for icehouse this flag can be removed. |
| 355 | iniset $TEMPEST_CONFIG telemetry too_slow_to_test "False" |
| 356 | |
Salvatore Orlando | 3046bc6 | 2014-08-21 12:11:10 -0700 | [diff] [blame] | 357 | # Object storage |
| 358 | iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis ${OBJECT_STORAGE_API_EXTENSIONS:-"all"} |
| 359 | iniset $TEMPEST_CONFIG object-storage-feature-disabled discoverable_apis ${OBJECT_STORAGE_DISABLE_API_EXTENSIONS} |
| 360 | |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 361 | # Volume |
Salvatore Orlando | 3046bc6 | 2014-08-21 12:11:10 -0700 | [diff] [blame] | 362 | iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions ${VOLUME_API_EXTENSIONS:-"all"} |
| 363 | iniset $TEMPEST_CONFIG volume-feature-disabled api_extensions ${DISABLE_VOLUME_API_EXTENSIONS} |
Giulio Fidente | 3d60f4d | 2014-02-20 16:43:49 +0100 | [diff] [blame] | 364 | if ! is_service_enabled c-bak; then |
| 365 | iniset $TEMPEST_CONFIG volume-feature-enabled backup False |
Giulio Fidente | 3632ab1 | 2013-09-10 02:51:26 +0200 | [diff] [blame] | 366 | fi |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 367 | CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND) |
Ian Wienand | c42ed25 | 2013-06-17 13:23:44 +1000 | [diff] [blame] | 368 | if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then |
Matthew Treinish | db1c384 | 2014-02-04 20:58:00 +0000 | [diff] [blame] | 369 | iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True" |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 370 | iniset $TEMPEST_CONFIG volume backend1_name "LVM_iSCSI" |
| 371 | iniset $TEMPEST_CONFIG volume backend2_name "LVM_iSCSI_2" |
| 372 | fi |
| 373 | |
Eric Harney | 0145648 | 2014-10-14 18:53:53 -0400 | [diff] [blame] | 374 | if [ $TEMPEST_VOLUME_DRIVER != "default" -o \ |
Patrick East | 1c0628f | 2014-10-22 16:22:47 -0700 | [diff] [blame^] | 375 | "$TEMPEST_VOLUME_VENDOR" != "$TEMPEST_DEFAULT_VOLUME_VENDOR" ]; then |
Ed Balduf | 2f23d75 | 2014-07-29 14:42:27 -0600 | [diff] [blame] | 376 | iniset $TEMPEST_CONFIG volume vendor_name "$TEMPEST_VOLUME_VENDOR" |
Eric Harney | 0145648 | 2014-10-14 18:53:53 -0400 | [diff] [blame] | 377 | fi |
| 378 | if [ $TEMPEST_VOLUME_DRIVER != "default" -o \ |
| 379 | $TEMPEST_STORAGE_PROTOCOL != $TEMPEST_DEFAULT_STORAGE_PROTOCOL ]; then |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 380 | iniset $TEMPEST_CONFIG volume storage_protocol $TEMPEST_STORAGE_PROTOCOL |
Giulio Fidente | 97e1bd0 | 2013-06-04 05:33:52 +0200 | [diff] [blame] | 381 | fi |
| 382 | |
Julie Pichon | fea70f8 | 2013-07-29 11:22:08 +0100 | [diff] [blame] | 383 | # Dashboard |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 384 | iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/" |
| 385 | iniset $TEMPEST_CONFIG dashboard login_url "http://$SERVICE_HOST/auth/login/" |
Julie Pichon | fea70f8 | 2013-07-29 11:22:08 +0100 | [diff] [blame] | 386 | |
Ian Wienand | 7fa1902 | 2013-06-25 14:11:48 +1000 | [diff] [blame] | 387 | # cli |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 388 | iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR |
Ian Wienand | 7fa1902 | 2013-06-25 14:11:48 +1000 | [diff] [blame] | 389 | |
Adam Gandelman | 43bd667 | 2014-04-03 11:13:13 -0700 | [diff] [blame] | 390 | # Baremetal |
| 391 | if [ "$VIRT_DRIVER" = "ironic" ] ; then |
| 392 | iniset $TEMPEST_CONFIG baremetal driver_enabled True |
Adam Gandelman | fdfe7a0 | 2014-07-24 10:06:18 -0400 | [diff] [blame] | 393 | iniset $TEMPEST_CONFIG compute-feature-enabled change_password False |
| 394 | iniset $TEMPEST_CONFIG compute-feature-enabled console_output False |
| 395 | iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False |
| 396 | iniset $TEMPEST_CONFIG compute-feature-enabled live_migration False |
| 397 | iniset $TEMPEST_CONFIG compute-feature-enabled pause False |
| 398 | iniset $TEMPEST_CONFIG compute-feature-enabled rescue False |
| 399 | iniset $TEMPEST_CONFIG compute-feature-enabled resize False |
| 400 | iniset $TEMPEST_CONFIG compute-feature-enabled shelve False |
| 401 | iniset $TEMPEST_CONFIG compute-feature-enabled snapshot False |
David Shrewsbury | cf21b71 | 2014-08-13 07:03:58 -0400 | [diff] [blame] | 402 | iniset $TEMPEST_CONFIG compute-feature-enabled suspend False |
Adam Gandelman | 43bd667 | 2014-04-03 11:13:13 -0700 | [diff] [blame] | 403 | fi |
| 404 | |
Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 405 | # service_available |
Dean Troyer | 4237f59 | 2014-01-29 16:22:11 -0600 | [diff] [blame] | 406 | for service in ${TEMPEST_SERVICES//,/ }; do |
Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 407 | if is_service_enabled $service ; then |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 408 | iniset $TEMPEST_CONFIG service_available $service "True" |
Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 409 | else |
john-griffith | dc4dc7f | 2014-01-22 18:09:32 -0700 | [diff] [blame] | 410 | iniset $TEMPEST_CONFIG service_available $service "False" |
Matthew Treinish | b56d81d | 2013-07-23 17:25:39 -0400 | [diff] [blame] | 411 | fi |
| 412 | done |
| 413 | |
Attila Fazekas | 2aa3517 | 2012-12-05 20:03:40 +0100 | [diff] [blame] | 414 | # Restore IFS |
| 415 | IFS=$ifs |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 416 | } |
| 417 | |
Dean Troyer | 42a59c2 | 2014-03-03 14:31:29 -0600 | [diff] [blame] | 418 | # create_tempest_accounts() - Set up common required tempest accounts |
| 419 | |
| 420 | # Project User Roles |
| 421 | # ------------------------------------------------------------------ |
| 422 | # alt_demo alt_demo Member |
| 423 | |
| 424 | # Migrated from keystone_data.sh |
| 425 | function create_tempest_accounts { |
| 426 | if is_service_enabled tempest; then |
| 427 | # Tempest has some tests that validate various authorization checks |
| 428 | # between two regular users in separate tenants |
Bartosz Górski | 0abde39 | 2014-02-28 14:15:19 +0100 | [diff] [blame] | 429 | get_or_create_project alt_demo |
| 430 | get_or_create_user alt_demo "$ADMIN_PASSWORD" alt_demo "alt_demo@example.com" |
| 431 | get_or_add_user_role Member alt_demo alt_demo |
Dean Troyer | 42a59c2 | 2014-03-03 14:31:29 -0600 | [diff] [blame] | 432 | fi |
| 433 | } |
| 434 | |
Matthew Treinish | 3472386 | 2014-09-08 14:01:21 -0400 | [diff] [blame] | 435 | # install_tempest_lib() - Collect source, prepare, and install tempest-lib |
| 436 | function install_tempest_lib { |
| 437 | git_clone $TEMPEST_LIB_REPO $TEMPEST_LIB_DIR $TEMPEST_LIB_BRANCH |
| 438 | setup_develop $TEMPEST_LIB_DIR |
| 439 | } |
| 440 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 441 | # install_tempest() - Collect source and prepare |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 442 | function install_tempest { |
Matthew Treinish | 3472386 | 2014-09-08 14:01:21 -0400 | [diff] [blame] | 443 | install_tempest_lib |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 444 | git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH |
Clark Boylan | 33dc869 | 2014-08-19 22:37:10 -0700 | [diff] [blame] | 445 | pip_install tox |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 446 | } |
| 447 | |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 448 | # init_tempest() - Initialize ec2 images |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 449 | function init_tempest { |
Adalberto Medeiros | 5397153 | 2014-07-10 16:55:49 -0300 | [diff] [blame] | 450 | local base_image_name=cirros-${CIRROS_VERSION}-${CIRROS_ARCH} |
| 451 | # /opt/stack/devstack/files/images/cirros-${CIRROS_VERSION}-${CIRROS_ARCH}-uec |
Attila Fazekas | 3c52922 | 2013-01-21 06:50:33 +0100 | [diff] [blame] | 452 | local image_dir="$FILES/images/${base_image_name}-uec" |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 453 | local kernel="$image_dir/${base_image_name}-vmlinuz" |
| 454 | local ramdisk="$image_dir/${base_image_name}-initrd" |
| 455 | local disk_image="$image_dir/${base_image_name}-blank.img" |
| 456 | # if the cirros uec downloaded and the system is uec capable |
| 457 | 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] | 458 | -a \( "$LIBVIRT_TYPE" != "lxc" -o "$VIRT_DRIVER" != "libvirt" \) ]; then |
| 459 | echo "Prepare aki/ari/ami Images" |
Ian Wienand | 887fb54 | 2014-08-13 14:30:28 +1000 | [diff] [blame] | 460 | mkdir -p $BOTO_MATERIALS_PATH |
Sean Dague | 101b424 | 2013-10-22 08:47:11 -0400 | [diff] [blame] | 461 | ( #new namespace |
| 462 | # tenant:demo ; user: demo |
| 463 | source $TOP_DIR/accrc/demo/demo |
Adalberto Medeiros | 5397153 | 2014-07-10 16:55:49 -0300 | [diff] [blame] | 464 | euca-bundle-image -r ${CIRROS_ARCH} -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH" |
| 465 | euca-bundle-image -r ${CIRROS_ARCH} -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH" |
| 466 | euca-bundle-image -r ${CIRROS_ARCH} -i "$disk_image" -d "$BOTO_MATERIALS_PATH" |
Sean Dague | 101b424 | 2013-10-22 08:47:11 -0400 | [diff] [blame] | 467 | ) 2>&1 </dev/null | cat |
Attila Fazekas | 1d29d8b | 2013-01-07 15:51:32 +0100 | [diff] [blame] | 468 | else |
| 469 | echo "Boto materials are not prepared" |
| 470 | fi |
| 471 | } |
| 472 | |
Sean Dague | d093121 | 2012-10-04 16:06:44 -0400 | [diff] [blame] | 473 | # Restore xtrace |
| 474 | $XTRACE |
Sean Dague | 584d90e | 2013-03-29 14:34:53 -0400 | [diff] [blame] | 475 | |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 476 | # Tell emacs to use shell-script-mode |
| 477 | ## Local variables: |
| 478 | ## mode: shell-script |
| 479 | ## End: |