blob: 95b300ce77197226acad66424e238e1350538313 [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
Attila Fazekas2aa35172012-12-05 20:03:40 +010049TEMPEST_CONF_DIR=$TEMPEST_DIR/etc
50TEMPEST_CONF=$TEMPEST_CONF_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
Dean Troyercc6b4432013-04-08 15:38:03 -050061
62# Functions
63# ---------
Sean Dagued0931212012-10-04 16:06:44 -040064
Sean Dagued0931212012-10-04 16:06:44 -040065# configure_tempest() - Set config files, create data dirs, etc
66function configure_tempest() {
Matthew Treinish95fb0d42013-01-28 16:24:14 -050067 setup_develop $TEMPEST_DIR
Attila Fazekas65c08462012-12-07 14:20:51 +010068 local image_lines
69 local images
70 local num_images
71 local image_uuid
72 local image_uuid_alt
Attila Fazekas2aa35172012-12-05 20:03:40 +010073 local errexit
Attila Fazekas65c08462012-12-07 14:20:51 +010074 local password
75 local line
76 local flavors
Clark Boylan3b80bde2013-11-20 17:51:50 -080077 local available_flavors
Attila Fazekas65c08462012-12-07 14:20:51 +010078 local flavors_ref
79 local flavor_lines
Maru Newbya5c774e2012-12-10 10:40:01 +000080 local public_network_id
Maru Newby31c94ab2012-12-19 03:59:20 +000081 local public_router_id
Maru Newbya5c774e2012-12-10 10:40:01 +000082 local tenant_networks_reachable
Attila Fazekas1d29d8b2013-01-07 15:51:32 +010083 local boto_instance_type="m1.tiny"
Attila Fazekas386ae8c2013-10-21 09:27:18 +020084 local ssh_connect_method="fixed"
Attila Fazekas2aa35172012-12-05 20:03:40 +010085
Dean Troyer6d04fd72012-12-21 11:03:37 -060086 # TODO(afazekas):
Sean Dagued0931212012-10-04 16:06:44 -040087 # sudo python setup.py deploy
Attila Fazekas2aa35172012-12-05 20:03:40 +010088
89 # This function exits on an error so that errors don't compound and you see
Joe Gordon46400262013-06-30 04:32:27 -070090 # only the first error that occurred.
Attila Fazekas2aa35172012-12-05 20:03:40 +010091 errexit=$(set +o | grep errexit)
92 set -o errexit
93
Dean Troyer6d04fd72012-12-21 11:03:37 -060094 # Save IFS
Attila Fazekas2aa35172012-12-05 20:03:40 +010095 ifs=$IFS
96
97 # Glance should already contain images to be used in tempest
98 # testing. Here we simply look for images stored in Glance
99 # and set the appropriate variables for use in the tempest config
100 # We ignore ramdisk and kernel images, look for the default image
Attila Fazekas65c08462012-12-07 14:20:51 +0100101 # ``DEFAULT_IMAGE_NAME``. If not found, we set the ``image_uuid`` to the
102 # first image returned and set ``image_uuid_alt`` to the second,
Attila Fazekas2aa35172012-12-05 20:03:40 +0100103 # if there is more than one returned...
104 # ... Also ensure we only take active images, so we don't get snapshots in process
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500105 declare -a images
106
107 while read -r IMAGE_NAME IMAGE_UUID; do
108 if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
109 image_uuid="$IMAGE_UUID"
110 image_uuid_alt="$IMAGE_UUID"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100111 fi
Cody A.W. Somervillec24e23b2012-12-21 02:10:45 -0500112 images+=($IMAGE_UUID)
113 done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
114
115 case "${#images[*]}" in
116 0)
117 echo "Found no valid images to use!"
118 exit 1
119 ;;
120 1)
121 if [ -z "$image_uuid" ]; then
122 image_uuid=${images[0]}
123 image_uuid_alt=${images[0]}
124 fi
125 ;;
126 *)
127 if [ -z "$image_uuid" ]; then
128 image_uuid=${images[0]}
129 image_uuid_alt=${images[1]}
130 fi
131 ;;
132 esac
Attila Fazekas2aa35172012-12-05 20:03:40 +0100133
134 # Create tempest.conf from tempest.conf.sample
135 # copy every time, because the image UUIDS are going to change
136 cp $TEMPEST_CONF.sample $TEMPEST_CONF
137
Attila Fazekas65c08462012-12-07 14:20:51 +0100138 password=${ADMIN_PASSWORD:-secrete}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100139
140 # See files/keystone_data.sh where alt_demo user
141 # and tenant are set up...
142 ALT_USERNAME=${ALT_USERNAME:-alt_demo}
143 ALT_TENANT_NAME=${ALT_TENANT_NAME:-alt_demo}
144
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100145 # If the ``DEFAULT_INSTANCE_TYPE`` not declared, use the new behavior
146 # Tempest creates instane types for himself
147 if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
Clark Boylan3b80bde2013-11-20 17:51:50 -0800148 available_flavors=$(nova flavor-list)
149 if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then
Rafael Folcoba0f1d32013-12-06 17:56:24 -0200150 if is_arch "ppc64"; then
151 # qemu needs at least 128MB of memory to boot on ppc64
152 nova flavor-create m1.nano 42 128 0 1
153 else
154 nova flavor-create m1.nano 42 64 0 1
155 fi
Clark Boylan3b80bde2013-11-20 17:51:50 -0800156 fi
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100157 flavor_ref=42
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100158 boto_instance_type=m1.nano
Clark Boylan3b80bde2013-11-20 17:51:50 -0800159 if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then
Rafael Folcoba0f1d32013-12-06 17:56:24 -0200160 if is_arch "ppc64"; then
161 nova flavor-create m1.micro 84 256 0 1
162 else
163 nova flavor-create m1.micro 84 128 0 1
164 fi
Clark Boylan3b80bde2013-11-20 17:51:50 -0800165 fi
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100166 flavor_ref_alt=84
167 else
168 # Check Nova for existing flavors and, if set, look for the
169 # ``DEFAULT_INSTANCE_TYPE`` and use that.
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100170 boto_instance_type=$DEFAULT_INSTANCE_TYPE
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100171 flavor_lines=`nova flavor-list`
172 IFS=$'\r\n'
173 flavors=""
Dean Troyerceaa38b2012-12-12 17:09:57 -0600174 for line in $flavor_lines; do
175 f=$(echo $line | awk "/ $DEFAULT_INSTANCE_TYPE / { print \$2 }")
176 flavors="$flavors $f"
177 done
Attila Fazekas2aa35172012-12-05 20:03:40 +0100178
Attila Fazekas7bf1dd32013-01-12 17:31:26 +0100179 for line in $flavor_lines; do
180 flavors="$flavors `echo $line | grep -v "^\(|\s*ID\|+--\)" | cut -d' ' -f2`"
181 done
182
183 IFS=" "
184 flavors=($flavors)
185 num_flavors=${#flavors[*]}
186 echo "Found $num_flavors flavors"
187 if [[ $num_flavors -eq 0 ]]; then
188 echo "Found no valid flavors to use!"
189 exit 1
190 fi
191 flavor_ref=${flavors[0]}
192 flavor_ref_alt=$flavor_ref
Adalberto Medeiros63a71a22013-06-06 08:46:04 -0400193
194 # ensure flavor_ref and flavor_ref_alt have different values
195 # some resize instance in tempest tests depends on this.
196 for f in ${flavors[@]:1}; do
197 if [[ $f -ne $flavor_ref ]]; then
198 flavor_ref_alt=$f
199 break
200 fi
201 done
Attila Fazekas2aa35172012-12-05 20:03:40 +0100202 fi
203
Maru Newbya5c774e2012-12-10 10:40:01 +0000204 if [ "$Q_USE_NAMESPACE" != "False" ]; then
205 tenant_networks_reachable=false
Attila Fazekasf9e77392013-12-03 06:17:16 +0100206 if ! is_service_enabled n-net; then
207 ssh_connect_method="floating"
208 fi
Maru Newbya5c774e2012-12-10 10:40:01 +0000209 else
210 tenant_networks_reachable=true
211 fi
212
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200213 ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
214
Tomoe Sugiharaafbc6312013-11-14 20:02:47 +0000215 if [ "$Q_L3_ENABLED" = "True" ]; then
Mark McClainb05c8762013-07-06 23:29:39 -0400216 public_network_id=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \
Maru Newbya5c774e2012-12-10 10:40:01 +0000217 awk '{print $2}')
Maru Newby31c94ab2012-12-19 03:59:20 +0000218 if [ "$Q_USE_NAMESPACE" == "False" ]; then
219 # If namespaces are disabled, devstack will create a single
220 # public router that tempest should be configured to use.
Mark McClainb05c8762013-07-06 23:29:39 -0400221 public_router_id=$(neutron router-list | awk "/ $Q_ROUTER_NAME / \
Sean Dague101b4242013-10-22 08:47:11 -0400222 { print \$2 }")
Maru Newby31c94ab2012-12-19 03:59:20 +0000223 fi
Maru Newbya5c774e2012-12-10 10:40:01 +0000224 fi
225
Matthew Treinish859cc682013-07-26 15:22:44 -0400226 # Oslo
Matthew Treinish14ccba02013-07-29 16:15:53 -0400227 iniset $TEMPEST_CONF DEFAULT lock_path $TEMPEST_STATE_PATH
228 mkdir -p $TEMPEST_STATE_PATH
Matthew Treinish4ee4a012013-07-31 16:05:42 -0400229 iniset $TEMPEST_CONF DEFAULT use_stderr False
230 iniset $TEMPEST_CONF DEFAULT log_file tempest.log
Matthew Treinish385152c2013-08-09 11:13:28 -0400231 iniset $TEMPEST_CONF DEFAULT debug True
Matthew Treinish859cc682013-07-26 15:22:44 -0400232
Attila Fazekas2aa35172012-12-05 20:03:40 +0100233 # Timeouts
234 iniset $TEMPEST_CONF compute build_timeout $BUILD_TIMEOUT
235 iniset $TEMPEST_CONF volume build_timeout $BUILD_TIMEOUT
236 iniset $TEMPEST_CONF boto build_timeout $BUILD_TIMEOUT
237 iniset $TEMPEST_CONF compute build_interval $BUILD_INTERVAL
238 iniset $TEMPEST_CONF volume build_interval $BUILD_INTERVAL
239 iniset $TEMPEST_CONF boto build_interval $BUILD_INTERVAL
240 iniset $TEMPEST_CONF boto http_socket_timeout 5
241
Attila Fazekas97d3d202013-01-19 19:20:49 +0100242 # Identity
243 iniset $TEMPEST_CONF identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
244 iniset $TEMPEST_CONF identity password "$password"
245 iniset $TEMPEST_CONF identity alt_username $ALT_USERNAME
246 iniset $TEMPEST_CONF identity alt_password "$password"
247 iniset $TEMPEST_CONF identity alt_tenant_name $ALT_TENANT_NAME
248 iniset $TEMPEST_CONF identity admin_password "$password"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100249
Sean Daguec3771452013-06-13 14:23:37 -0400250 # Image
251 # for the gate we want to be able to override this variable so we aren't
252 # doing an HTTP fetch over the wide internet for this test
253 if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
254 iniset $TEMPEST_CONF image http_image $TEMPEST_HTTP_IMAGE
255 fi
256
Attila Fazekas97d3d202013-01-19 19:20:49 +0100257 # Compute
Attila Fazekas2aa35172012-12-05 20:03:40 +0100258 iniset $TEMPEST_CONF compute change_password_available False
Sean Dague1c1aef02013-10-01 07:56:21 -0400259 # Note(nati) current tempest don't create network for each tenant
260 # so reuse same tenant for now
261 if is_service_enabled neutron; then
262 TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
263 fi
Nachi Ueno06fac372012-12-26 14:09:43 -0800264 iniset $TEMPEST_CONF compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
Attila Fazekas97d3d202013-01-19 19:20:49 +0100265 iniset $TEMPEST_CONF compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
Akihiro MOTOKI66afb472012-12-21 15:34:13 +0900266 iniset $TEMPEST_CONF compute network_for_ssh $PRIVATE_NETWORK_NAME
Attila Fazekas2aa35172012-12-05 20:03:40 +0100267 iniset $TEMPEST_CONF compute ip_version_for_ssh 4
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100268 iniset $TEMPEST_CONF compute ssh_timeout $BUILD_TIMEOUT
Attila Fazekas65c08462012-12-07 14:20:51 +0100269 iniset $TEMPEST_CONF compute image_ref $image_uuid
Attila Fazekas97d3d202013-01-19 19:20:49 +0100270 iniset $TEMPEST_CONF compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
Attila Fazekas65c08462012-12-07 14:20:51 +0100271 iniset $TEMPEST_CONF compute image_ref_alt $image_uuid_alt
Attila Fazekas97d3d202013-01-19 19:20:49 +0100272 iniset $TEMPEST_CONF compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
Attila Fazekas65c08462012-12-07 14:20:51 +0100273 iniset $TEMPEST_CONF compute flavor_ref $flavor_ref
274 iniset $TEMPEST_CONF compute flavor_ref_alt $flavor_ref_alt
Attila Fazekas2aa35172012-12-05 20:03:40 +0100275 iniset $TEMPEST_CONF compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False}
Akihiro MOTOKI66afb472012-12-21 15:34:13 +0900276 iniset $TEMPEST_CONF compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
Attila Fazekas386ae8c2013-10-21 09:27:18 +0200277 iniset $TEMPEST_CONF compute ssh_connect_method $ssh_connect_method
Attila Fazekas97d3d202013-01-19 19:20:49 +0100278
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200279 # Compute admin
Attila Fazekas97d3d202013-01-19 19:20:49 +0100280 iniset $TEMPEST_CONF "compute-admin" password "$password" # DEPRECATED
Attila Fazekas2aa35172012-12-05 20:03:40 +0100281
Attila Fazekas2aa35172012-12-05 20:03:40 +0100282 iniset $TEMPEST_CONF network api_version 2.0
Maru Newbya5c774e2012-12-10 10:40:01 +0000283 iniset $TEMPEST_CONF network tenant_networks_reachable "$tenant_networks_reachable"
284 iniset $TEMPEST_CONF network public_network_id "$public_network_id"
Maru Newby31c94ab2012-12-19 03:59:20 +0000285 iniset $TEMPEST_CONF network public_router_id "$public_router_id"
Ben Nemece4b85592013-12-20 19:51:04 +0000286 iniset $TEMPEST_CONF network default_network "$FIXED_RANGE"
Attila Fazekas2aa35172012-12-05 20:03:40 +0100287
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200288 # boto
Attila Fazekas2aa35172012-12-05 20:03:40 +0100289 iniset $TEMPEST_CONF boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
290 iniset $TEMPEST_CONF boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100291 iniset $TEMPEST_CONF boto s3_materials_path "$BOTO_MATERIALS_PATH"
292 iniset $TEMPEST_CONF boto instance_type "$boto_instance_type"
293 iniset $TEMPEST_CONF boto http_socket_timeout 30
Attila Fazekas97d3d202013-01-19 19:20:49 +0100294 iniset $TEMPEST_CONF boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
Attila Fazekas2aa35172012-12-05 20:03:40 +0100295
Steve Bakerd5cccad2013-07-19 10:34:24 +1200296 # Orchestration test image
Steve Baker0c5a0422013-12-04 17:01:01 +1300297 if [[ ! -z "$HEAT_FETCHED_TEST_IMAGE" ]]; then
298 iniset $TEMPEST_CONF orchestration image_ref "$HEAT_FETCHED_TEST_IMAGE"
299 elif [[ "$HEAT_CREATE_TEST_IMAGE" = "True" ]]; then
Steve Bakerd5cccad2013-07-19 10:34:24 +1200300 disk_image_create /usr/share/tripleo-image-elements "vm fedora heat-cfntools" "i386" "fedora-vm-heat-cfntools-tempest"
301 iniset $TEMPEST_CONF orchestration image_ref "fedora-vm-heat-cfntools-tempest"
302 fi
303
William Marshall24d866e2013-07-02 12:26:31 -0500304 # Scenario
305 iniset $TEMPEST_CONF scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec"
306
Joe Gordonbb8c6d42013-08-26 17:00:05 -0400307 # Large Ops Number
308 iniset $TEMPEST_CONF scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
309
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200310 # Volume
Giulio Fidente3632ab12013-09-10 02:51:26 +0200311 if is_service_enabled c-bak; then
312 iniset $TEMPEST_CONF volume volume_backup_enabled "True"
313 fi
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200314 CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
Ian Wienandc42ed252013-06-17 13:23:44 +1000315 if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
Giulio Fidente97e1bd02013-06-04 05:33:52 +0200316 iniset $TEMPEST_CONF volume multi_backend_enabled "True"
317 iniset $TEMPEST_CONF volume backend1_name "LVM_iSCSI"
318 iniset $TEMPEST_CONF volume backend2_name "LVM_iSCSI_2"
319 fi
320
Julie Pichonfea70f82013-07-29 11:22:08 +0100321 # Dashboard
322 iniset $TEMPEST_CONF dashboard dashboard_url "http://$SERVICE_HOST/"
323 iniset $TEMPEST_CONF dashboard login_url "http://$SERVICE_HOST/auth/login/"
324
Ian Wienand7fa19022013-06-25 14:11:48 +1000325 # cli
326 iniset $TEMPEST_CONF cli cli_dir $NOVA_BIN_DIR
327
armando-migliaccio1692bda2013-12-13 10:15:34 -0800328 # Networking
329 iniset $TEMPEST_CONF network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
330
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400331 # service_available
Sergey Lukjanov75cb61b2013-11-20 00:19:59 +0400332 for service in nova cinder glance neutron swift heat horizon ceilometer ironic savanna; do
Matthew Treinishb56d81d2013-07-23 17:25:39 -0400333 if is_service_enabled $service ; then
334 iniset $TEMPEST_CONF service_available $service "True"
335 else
336 iniset $TEMPEST_CONF service_available $service "False"
337 fi
338 done
339
Attila Fazekas2aa35172012-12-05 20:03:40 +0100340 echo "Created tempest configuration file:"
341 cat $TEMPEST_CONF
342
343 # Restore IFS
344 IFS=$ifs
345 #Restore errexit
346 $errexit
Sean Dagued0931212012-10-04 16:06:44 -0400347}
348
Sean Dagued0931212012-10-04 16:06:44 -0400349# install_tempest() - Collect source and prepare
350function install_tempest() {
351 git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
Sean Dagued0931212012-10-04 16:06:44 -0400352}
353
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100354# init_tempest() - Initialize ec2 images
355function init_tempest() {
Scott Mosercde655a2013-02-20 12:33:39 -0500356 local base_image_name=cirros-0.3.1-x86_64
357 # /opt/stack/devstack/files/images/cirros-0.3.1-x86_64-uec
Attila Fazekas3c529222013-01-21 06:50:33 +0100358 local image_dir="$FILES/images/${base_image_name}-uec"
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100359 local kernel="$image_dir/${base_image_name}-vmlinuz"
360 local ramdisk="$image_dir/${base_image_name}-initrd"
361 local disk_image="$image_dir/${base_image_name}-blank.img"
362 # if the cirros uec downloaded and the system is uec capable
363 if [ -f "$kernel" -a -f "$ramdisk" -a -f "$disk_image" -a "$VIRT_DRIVER" != "openvz" \
Sean Dague101b4242013-10-22 08:47:11 -0400364 -a \( "$LIBVIRT_TYPE" != "lxc" -o "$VIRT_DRIVER" != "libvirt" \) ]; then
365 echo "Prepare aki/ari/ami Images"
366 ( #new namespace
367 # tenant:demo ; user: demo
368 source $TOP_DIR/accrc/demo/demo
369 euca-bundle-image -i "$kernel" --kernel true -d "$BOTO_MATERIALS_PATH"
370 euca-bundle-image -i "$ramdisk" --ramdisk true -d "$BOTO_MATERIALS_PATH"
371 euca-bundle-image -i "$disk_image" -d "$BOTO_MATERIALS_PATH"
372 ) 2>&1 </dev/null | cat
Attila Fazekas1d29d8b2013-01-07 15:51:32 +0100373 else
374 echo "Boto materials are not prepared"
375 fi
376}
377
Sean Dagued0931212012-10-04 16:06:44 -0400378# Restore xtrace
379$XTRACE
Sean Dague584d90e2013-03-29 14:34:53 -0400380
Adam Spiers6a5aa7c2013-10-24 11:27:02 +0100381# Tell emacs to use shell-script-mode
382## Local variables:
383## mode: shell-script
384## End: