blob: d2227feed93d129df59bb26adc7a87dbdd07a41a [file] [log] [blame]
Sean Dagued0931212012-10-04 16:06:44 -04001# lib/tempest
Dean Troyer6d04fd72012-12-21 11:03:37 -06002# Install and configure Tempest
Sean Dagued0931212012-10-04 16:06:44 -04003
4# Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +01005#
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 Sugiharaafbc6312013-11-14 20:02:47 +000018# - ``Q_L3_ENABLED``
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010019# - ``VIRT_DRIVER``
20# - ``LIBVIRT_TYPE``
21# - ``KEYSTONE_SERVICE_PROTOCOL``, ``KEYSTONE_SERVICE_HOST`` from lib/keystone
22#
Attila Fazekas2aa35172012-12-05 20:03:40 +010023# Optional Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010024#
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 Dagued0931212012-10-04 16:06:44 -040033# ``stack.sh`` calls the entry points in this order:
34#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010035# - install_tempest
36# - configure_tempest
37# - init_tempest
Sean Dagued0931212012-10-04 16:06:44 -040038
39# Save trace setting
40XTRACE=$(set +o | grep xtrace)
41set +o xtrace
42
Dean Troyer6d04fd72012-12-21 11:03:37 -060043
Sean Dagued0931212012-10-04 16:06:44 -040044# Defaults
45# --------
46
Sean Dagued0931212012-10-04 16:06:44 -040047# Set up default directories
48TEMPEST_DIR=$DEST/tempest
john-griffithdc4dc7f2014-01-22 18:09:32 -070049TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
50TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
Matthew Treinish14ccba02013-07-29 16:15:53 -040051TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
Attila Fazekas2aa35172012-12-05 20:03:40 +010052
Dean Troyer6d04fd72012-12-21 11:03:37 -060053NOVA_SOURCE_DIR=$DEST/nova
54
Attila Fazekasbae02332013-05-09 09:24:49 +020055BUILD_INTERVAL=1
Attila Fazekas8111ef02013-10-18 16:21:26 +020056BUILD_TIMEOUT=196
Sean Dagued0931212012-10-04 16:06:44 -040057
Dean Troyer6d04fd72012-12-21 11:03:37 -060058
Scott Mosercde655a2013-02-20 12:33:39 -050059BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1"
Attila Fazekas1d29d8b2013-01-07 15:51:32 +010060
john-griffithdc4dc7f2014-01-22 18:09:32 -070061# Cinder/Volume variables
62TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
63TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-"Open Source"}
64TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-iSCSI}
Dean Troyercc6b4432013-04-08 15:38:03 -050065
armando-migliaccio71ef61a2014-02-19 22:19:24 -080066# Neutron/Network variables
67IPV6_ENABLED=$(trueorfalse True $IPV6_ENABLED)
68
Dean Troyercc6b4432013-04-08 15:38:03 -050069# Functions
70# ---------
Sean Dagued0931212012-10-04 16:06:44 -040071
Sean Dagued0931212012-10-04 16:06:44 -040072# configure_tempest() - Set config files, create data dirs, etc
73function configure_tempest() {
Matthew Treinish95fb0d42013-01-28 16:24:14 -050074 setup_develop $TEMPEST_DIR
Attila Fazekas65c08462012-12-07 14:20:51 +010075 local image_lines
76 local images
77 local num_images
78 local image_uuid
79 local image_uuid_alt
Attila Fazekas2aa35172012-12-05 20:03:40 +010080 local errexit
Attila Fazekas65c08462012-12-07 14:20:51 +010081 local password
82 local line
83 local flavors
Clark Boylan3b80bde2013-11-20 17:51:50 -080084 local available_flavors
Attila Fazekas65c08462012-12-07 14:20:51 +010085 local flavors_ref
86 local flavor_lines
Maru Newbya5c774e2012-12-10 10:40:01 +000087 local public_network_id
Maru Newby31c94ab2012-12-19 03:59:20 +000088 local public_router_id
Maru Newbya5c774e2012-12-10 10:40:01 +000089 local tenant_networks_reachable
Attila Fazekas1d29d8b2013-01-07 15:51:32 +010090 local boto_instance_type="m1.tiny"
Attila Fazekas386ae8c2013-10-21 09:27:18 +020091 local ssh_connect_method="fixed"
Attila Fazekas2aa35172012-12-05 20:03:40 +010092
john-griffithdc4dc7f2014-01-22 18:09:32 -070093 if [[ ! -d $TEMPEST_CONFIG_DIR ]]; then
94 sudo mkdir -p $TEMPEST_CONFIG_DIR
95 fi
96 sudo chown $STACK_USER $TEMPEST_CONFIG_DIR
97
Dean Troyer6d04fd72012-12-21 11:03:37 -060098 # TODO(afazekas):
Sean Dagued0931212012-10-04 16:06:44 -040099 # sudo python setup.py deploy
Attila Fazekas2aa35172012-12-05 20:03:40 +0100100
101 # This function exits on an error so that errors don't compound and you see
Joe Gordon46400262013-06-30 04:32:27 -0700102 # only the first error that occurred.
Attila Fazekas2aa35172012-12-05 20:03:40 +0100103 errexit=$(set +o | grep errexit)
104 set -o errexit
105
Dean Troyer6d04fd72012-12-21 11:03:37 -0600106 # Save IFS
Attila Fazekas2aa35172012-12-05 20:03:40 +0100107 ifs=$IFS
108
109 # Glance should already contain images to be used in tempest
110 # testing. Here we simply look for images stored in Glance
111 # and set the appropriate variables for use in the tempest config
112 # We ignore ramdisk and kernel images, look for the default image
Attila Fazekas65c08462012-12-07 14:20:51 +0100113 # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the
114 # first image returned and set ``image_uuid_alt`` to the second,
Attila Fazekas2aa35172012-12-05 20:03:40 +0100115 # if there is more than one returned...
116 # ... Also ensure we only take active images, so we don't get snapshots in process
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500117 declare -a images
118
119 while read -r IMAGE_NAME IMAGE_UUID; do
120 if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
121 image_uuid="$IMAGE_UUID"
122 image_uuid_alt="$IMAGE_UUID"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100123 fi
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500124 images+=($IMAGE_UUID)
125 done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
126
127 case "${#images[*]}" in
128 0)
129 echo "Found no valid images to use!"
130 exit 1
131 ;;
132 1)
133 if [ -z "$image_uuid" ]; then
134 image_uuid=${images[0]}
135 image_uuid_alt=${images[0]}
136 fi
137 ;;
138 *)
139 if [ -z "$image_uuid" ]; then
140 image_uuid=${images[0]}
141 image_uuid_alt=${images[1]}
142 fi
143 ;;
144 esac
Attila Fazekas2aa35172012-12-05 20:03:40 +0100145
146 # Create tempest.conf from tempest.conf.sample
147 # copy every time, because the image UUIDS are going to change
john-griffithdc4dc7f2014-01-22 18:09:32 -0700148 sudo cp $TEMPEST_DIR/etc/tempest.conf.sample $TEMPEST_CONFIG
149 sudo chmod 644 $TEMPEST_CONFIG
Attila Fazekas2aa35172012-12-05 20:03:40 +0100150
Attila Fazekas65c08462012-12-07 14:20:51 +0100151 password=${ADMIN_PASSWORD:-secrete}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100152
153 # See files/keystone_data.sh where alt_demo user
154 # and tenant are set up...
155 ALT_USERNAME=${ALT_USERNAME:-alt_demo}
156 ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo}
157
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100158 # If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior
159 # Tempest creates instane types for himself
160 if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
Clark Boylan3b80bde2013-11-20 17:51:50 -0800161 available_flavors=$(nova flavor-list)
162 if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then
Rafael Folcoba0f1d32013-12-06 17:56:24 -0200163 if is_arch "ppc64"; then
164 # qemu needs at least 128MB of memory to boot on ppc64
165 nova flavor-create m1.nano 42 128 0 1
166 else
167 nova flavor-create m1.nano 42 64 0 1
168 fi
Clark Boylan3b80bde2013-11-20 17:51:50 -0800169 fi
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100170 flavor_ref=42
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100171 boto_instance_type=m1.nano
Clark Boylan3b80bde2013-11-20 17:51:50 -0800172 if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then
Rafael Folcoba0f1d32013-12-06 17:56:24 -0200173 if is_arch "ppc64"; then
174 nova flavor-create m1.micro 84 256 0 1
175 else
176 nova flavor-create m1.micro 84 128 0 1
177 fi
Clark Boylan3b80bde2013-11-20 17:51:50 -0800178 fi
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100179 flavor_ref_alt=84
180 else
181 # Check Nova for existing flavors and, if set, look for the
182 # ``DEFAULT_INSTANCE_TYPE`` and use that.
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100183 boto_instance_type=$DEFAULT_INSTANCE_TYPE
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100184 flavor_lines=`nova flavor-list`
185 IFS=$'\r\n'
186 flavors=""
Dean Troyerceaa38b2012-12-12 17:09:57 -0600187 for line in $flavor_lines; do
188 f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }")
189 flavors="$flavors $f"
190 done
Attila Fazekas2aa35172012-12-05 20:03:40 +0100191
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100192 for line in $flavor_lines; do
193 flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`"
194 done
195
196 IFS=" "
197 flavors=($flavors)
198 num_flavors=${#flavors[*]}
199 echo "Found $num_flavors flavors"
200 if [[ $num_flavors -eq 0 ]]; then
201 echo "Found no valid flavors to use!"
202 exit 1
203 fi
204 flavor_ref=${flavors[0]}
205 flavor_ref_alt=$flavor_ref
Adalberto Medeiros63a71a22013-06-06 08:46:04 -0400206
207 # ensure flavor_ref and flavor_ref_alt have different values
208 # some resize instance in tempest tests depends on this.
209 for f in ${flavors[@]:1}; do
210 if [[ $f -ne $flavor_ref ]]; then
211 flavor_ref_alt=$f
212 break
213 fi
214 done
Attila Fazekas2aa35172012-12-05 20:03:40 +0100215 fi
216
Maru Newbya5c774e2012-12-10 10:40:01 +0000217 if [ "$Q_USE_NAMESPACE" != "False" ]; then
218 tenant_networks_reachable=false
Attila Fazekasf9e77392013-12-03 06:17:16 +0100219 if ! is_service_enabled n-net; then
220 ssh_connect_method="floating"
221 fi
Maru Newbya5c774e2012-12-10 10:40:01 +0000222 else
223 tenant_networks_reachable=true
224 fi
225
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200226 ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
227
Tomoe Sugiharaafbc6312013-11-14 20:02:47 +0000228 if [ "$Q_L3_ENABLED" = "True" ]; then
Mark McClainb05c8762013-07-06 23:29:39 -0400229 public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \
Maru Newbya5c774e2012-12-10 10:40:01 +0000230 awk '{print $2}')
Maru Newby31c94ab2012-12-19 03:59:20 +0000231 if [ "$Q_USE_NAMESPACE" == "False" ]; then
232 # If namespaces are disabled, devstack will create a single
233 # public router that tempest should be configured to use.
Mark McClainb05c8762013-07-06 23:29:39 -0400234 public_router_id=$(neutron router-list | awk "/ $Q_ROUTER_NAME / \
Sean Dague101b4242013-10-22 08:47:11 -0400235 { print \$2 }")
Maru Newby31c94ab2012-12-19 03:59:20 +0000236 fi
Maru Newbya5c774e2012-12-10 10:40:01 +0000237 fi
238
Matthew Treinish859cc682013-07-26 15:22:44 -0400239 # Oslo
john-griffithdc4dc7f2014-01-22 18:09:32 -0700240 iniset $TEMPEST_CONFIG DEFAULT lock_path $TEMPEST_STATE_PATH
Matthew Treinish14ccba02013-07-29 16:15:53 -0400241 mkdir -p $TEMPEST_STATE_PATH
john-griffithdc4dc7f2014-01-22 18:09:32 -0700242 iniset $TEMPEST_CONFIG DEFAULT use_stderr False
243 iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log
244 iniset $TEMPEST_CONFIG DEFAULT debug True
Matthew Treinish859cc682013-07-26 15:22:44 -0400245
Attila Fazekas2aa35172012-12-05 20:03:40 +0100246 # Timeouts
john-griffithdc4dc7f2014-01-22 18:09:32 -0700247 iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT
248 iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT
249 iniset $TEMPEST_CONFIG boto build_timeout $BUILD_TIMEOUT
250 iniset $TEMPEST_CONFIG compute build_interval $BUILD_INTERVAL
251 iniset $TEMPEST_CONFIG volume build_interval $BUILD_INTERVAL
252 iniset $TEMPEST_CONFIG boto build_interval $BUILD_INTERVAL
253 iniset $TEMPEST_CONFIG boto http_socket_timeout 5
Attila Fazekas2aa35172012-12-05 20:03:40 +0100254
Attila Fazekas97d3d202013-01-19 19:20:49 +0100255 # Identity
john-griffithdc4dc7f2014-01-22 18:09:32 -0700256 iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
Matthew Treinish6c9430e2014-02-06 17:06:00 +0000257 iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v3/"
john-griffithdc4dc7f2014-01-22 18:09:32 -0700258 iniset $TEMPEST_CONFIG identity password "$password"
259 iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME
260 iniset $TEMPEST_CONFIG identity alt_password "$password"
261 iniset $TEMPEST_CONFIG identity alt_tenant_name $ALT_TENANT_NAME
262 iniset $TEMPEST_CONFIG identity admin_password "$password"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100263
Sean Daguec3771452013-06-13 14:23:37 -0400264 # Image
265 # for the gate we want to be able to override this variable so we aren't
266 # doing an HTTP fetch over the wide internet for this test
267 if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700268 iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
Sean Daguec3771452013-06-13 14:23:37 -0400269 fi
270
Attila Fazekas97d3d202013-01-19 19:20:49 +0100271 # Compute
john-griffithdc4dc7f2014-01-22 18:09:32 -0700272 iniset $TEMPEST_CONFIG compute change_password_available False
john-griffithdc4dc7f2014-01-22 18:09:32 -0700273 iniset $TEMPEST_CONFIG compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
274 iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
275 iniset $TEMPEST_CONFIG compute network_for_ssh $PRIVATE_NETWORK_NAME
276 iniset $TEMPEST_CONFIG compute ip_version_for_ssh 4
277 iniset $TEMPEST_CONFIG compute ssh_timeout $BUILD_TIMEOUT
278 iniset $TEMPEST_CONFIG compute image_ref $image_uuid
279 iniset $TEMPEST_CONFIG compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
280 iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt
281 iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
282 iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref
283 iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt
284 iniset $TEMPEST_CONFIG compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False}
285 iniset $TEMPEST_CONFIG compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
286 iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method
Attila Fazekas97d3d202013-01-19 19:20:49 +0100287
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200288 # Compute admin
john-griffithdc4dc7f2014-01-22 18:09:32 -0700289 iniset $TEMPEST_CONFIG "compute-admin" password "$password" # DEPRECATED
Attila Fazekas2aa35172012-12-05 20:03:40 +0100290
armando-migliaccio71ef61a2014-02-19 22:19:24 -0800291 # Network
john-griffithdc4dc7f2014-01-22 18:09:32 -0700292 iniset $TEMPEST_CONFIG network api_version 2.0
293 iniset $TEMPEST_CONFIG network tenant_networks_reachable "$tenant_networks_reachable"
294 iniset $TEMPEST_CONFIG network public_network_id "$public_network_id"
295 iniset $TEMPEST_CONFIG network public_router_id "$public_router_id"
296 iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE"
armando-migliaccio71ef61a2014-02-19 22:19:24 -0800297 iniset $TEMPEST_CONFIG network ipv6_enabled "$IPV6_ENABLED"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100298
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200299 # boto
john-griffithdc4dc7f2014-01-22 18:09:32 -0700300 iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
301 iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
302 iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH"
303 iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type"
304 iniset $TEMPEST_CONFIG boto http_socket_timeout 30
305 iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100306
Steve Bakerd5cccad2013-07-19 10:34:24 +1200307 # Orchestration test image
Steve Baker0c5a0422013-12-04 17:01:01 +1300308 if [[ ! -z "$HEAT_FETCHED_TEST_IMAGE" ]]; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700309 iniset $TEMPEST_CONFIG orchestration image_ref "$HEAT_FETCHED_TEST_IMAGE"
Steve Baker0c5a0422013-12-04 17:01:01 +1300310 elif [[ "$HEAT_CREATE_TEST_IMAGE" = "True" ]]; then
Steve Bakerd5cccad2013-07-19 10:34:24 +1200311 disk_image_create /usr/share/tripleo-image-elements "vm fedora heat-cfntools" "i386" "fedora-vm-heat-cfntools-tempest"
john-griffithdc4dc7f2014-01-22 18:09:32 -0700312 iniset $TEMPEST_CONFIG orchestration image_ref "fedora-vm-heat-cfntools-tempest"
Steve Bakerd5cccad2013-07-19 10:34:24 +1200313 fi
314
William Marshall24d866e2013-07-02 12:26:31 -0500315 # Scenario
john-griffithdc4dc7f2014-01-22 18:09:32 -0700316 iniset $TEMPEST_CONFIG scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec"
William Marshall24d866e2013-07-02 12:26:31 -0500317
Joe Gordonbb8c6d42013-08-26 17:00:05 -0400318 # Large Ops Number
john-griffithdc4dc7f2014-01-22 18:09:32 -0700319 iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
Joe Gordonbb8c6d42013-08-26 17:00:05 -0400320
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200321 # Volume
Giulio Fidente3d60f4d2014-02-20 16:43:49 +0100322 if ! is_service_enabled c-bak; then
323 iniset $TEMPEST_CONFIG volume-feature-enabled backup False
Giulio Fidente3632ab12013-09-10 02:51:26 +0200324 fi
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200325 CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
Ian Wienandc42ed252013-06-17 13:23:44 +1000326 if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
Matthew Treinishdb1c3842014-02-04 20:58:00 +0000327 iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
john-griffithdc4dc7f2014-01-22 18:09:32 -0700328 iniset $TEMPEST_CONFIG volume backend1_name "LVM_iSCSI"
329 iniset $TEMPEST_CONFIG volume backend2_name "LVM_iSCSI_2"
330 fi
331
332 if [ $TEMPEST_VOLUME_DRIVER != "default" ]; then
333 iniset $TEMPEST_CONFIG volume vendor_name $TEMPEST_VOLUME_VENDOR
334 iniset $TEMPEST_CONFIG volume storage_protocol $TEMPEST_STORAGE_PROTOCOL
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200335 fi
336
Julie Pichonfea70f82013-07-29 11:22:08 +0100337 # Dashboard
john-griffithdc4dc7f2014-01-22 18:09:32 -0700338 iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/"
339 iniset $TEMPEST_CONFIG dashboard login_url "http://$SERVICE_HOST/auth/login/"
Julie Pichonfea70f82013-07-29 11:22:08 +0100340
Ian Wienand7fa19022013-06-25 14:11:48 +1000341 # cli
john-griffithdc4dc7f2014-01-22 18:09:32 -0700342 iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR
Ian Wienand7fa19022013-06-25 14:11:48 +1000343
armando-migliaccio1692bda2013-12-13 10:15:34 -0800344 # Networking
john-griffithdc4dc7f2014-01-22 18:09:32 -0700345 iniset $TEMPEST_CONFIG network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
armando-migliaccio1692bda2013-12-13 10:15:34 -0800346
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400347 # service_available
Dean Troyer4237f592014-01-29 16:22:11 -0600348 for service in ${TEMPEST_SERVICES//,/ }; do
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400349 if is_service_enabled $service ; then
john-griffithdc4dc7f2014-01-22 18:09:32 -0700350 iniset $TEMPEST_CONFIG service_available $service "True"
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400351 else
john-griffithdc4dc7f2014-01-22 18:09:32 -0700352 iniset $TEMPEST_CONFIG service_available $service "False"
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400353 fi
354 done
355
Attila Fazekas2aa35172012-12-05 20:03:40 +0100356 # Restore IFS
357 IFS=$ifs
358 #Restore errexit
359 $errexit
Sean Dagued0931212012-10-04 16:06:44 -0400360}
361
Sean Dagued0931212012-10-04 16:06:44 -0400362# install_tempest() - Collect source and prepare
363function install_tempest() {
364 git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
Sean Dagued0931212012-10-04 16:06:44 -0400365}
366
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100367# init_tempest() - Initialize ec2 images
368function init_tempest() {
Scott Mosercde655a2013-02-20 12:33:39 -0500369 local base_image_name=cirros-0.3.1-x86_64
370 # /opt/stack/devstack/files/images/cirros-0.3.1-x86_64-uec
Attila Fazekas3c529222013-01-21 06:50:33 +0100371 local image_dir="$FILES/images/${base_image_name}-uec"
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100372 local kernel="$image_dir/${base_image_name}-vmlinuz"
373 local ramdisk="$image_dir/${base_image_name}-initrd"
374 local disk_image="$image_dir/${base_image_name}-blank.img"
375 # if the cirros uec downloaded and the system is uec capable
376 if [ -f "$kernel" -a -f "$ramdisk" -a -f "$disk_image" -a "$VIRT_DRIVER" != "openvz" \
Sean Dague101b4242013-10-22 08:47:11 -0400377 -a \( "$LIBVIRT_TYPE" != "lxc" -o "$VIRT_DRIVER" != "libvirt" \) ]; then
378 echo "Prepare aki/ari/ami Images"
379 ( #new namespace
380 # tenant:demo ; user: demo
381 source $TOP_DIR/accrc/demo/demo
382 euca-bundle-image -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH"
383 euca-bundle-image -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH"
384 euca-bundle-image -i "$disk_image" -d "$BOTO_MATERIALS_PATH"
385 ) 2>&1 </dev/null | cat
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100386 else
387 echo "Boto materials are not prepared"
388 fi
389}
390
Sean Dagued0931212012-10-04 16:06:44 -0400391# Restore xtrace
392$XTRACE
Sean Dague584d90e2013-03-29 14:34:53 -0400393
Adam Spiers6a5aa7c2013-10-24 11:27:02 +0100394# Tell emacs to use shell-script-mode
395## Local variables:
396## mode: shell-script
397## End: