This requires HEAT_CREATE_TEST_IMAGE to be set for any images
to be created.
If the file (files/fedora-vm-heat-cfntools-tempest.qcow2) already
exists then disk-image-create will not be called, and the existing
image file will be registered with glance. This is most likely to
happen in the following scenarios:
- a second run of stack.sh
- the image has been pre-built elsewhere (such as during devstack-gate
image building)
Change-Id: I276573a20927e72f2cb68784f655c1ba1913ae8a
| ... | ... |
@@ -197,6 +197,21 @@ function stop_heat() {
|
| 197 | 197 |
done |
| 198 | 198 |
} |
| 199 | 199 |
|
| 200 |
+function disk_image_create {
|
|
| 201 |
+ local elements_path=$1 |
|
| 202 |
+ local elements=$2 |
|
| 203 |
+ local arch=$3 |
|
| 204 |
+ local output=$TOP_DIR/files/$4 |
|
| 205 |
+ if [[ -f "$output.qcow2" ]]; |
|
| 206 |
+ then |
|
| 207 |
+ echo "Image file already exists: $output_file" |
|
| 208 |
+ else |
|
| 209 |
+ ELEMENTS_PATH=$elements_path disk-image-create \ |
|
| 210 |
+ $elements -a $arch -o $output |
|
| 211 |
+ fi |
|
| 212 |
+ # upload with fake URL so that image in $TOP_DIR/files is used |
|
| 213 |
+ upload_image "http://localhost/$output.qcow2" $TOKEN |
|
| 214 |
+} |
|
| 200 | 215 |
|
| 201 | 216 |
# Restore xtrace |
| 202 | 217 |
$XTRACE |
| ... | ... |
@@ -24,6 +24,7 @@ |
| 24 | 24 |
# ``DEFAULT_INSTANCE_TYPE`` |
| 25 | 25 |
# ``DEFAULT_INSTANCE_USER`` |
| 26 | 26 |
# ``CINDER_MULTI_LVM_BACKEND`` |
| 27 |
+# ``HEAT_CREATE_TEST_IMAGE`` |
|
| 27 | 28 |
# ``stack.sh`` calls the entry points in this order: |
| 28 | 29 |
# |
| 29 | 30 |
# install_tempest |
| ... | ... |
@@ -271,6 +272,12 @@ function configure_tempest() {
|
| 271 | 271 |
iniset $TEMPEST_CONF boto http_socket_timeout 30 |
| 272 | 272 |
iniset $TEMPEST_CONF boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
|
| 273 | 273 |
|
| 274 |
+ # Orchestration test image |
|
| 275 |
+ if [ $HEAT_CREATE_TEST_IMAGE == "True" ]; then |
|
| 276 |
+ disk_image_create /usr/share/tripleo-image-elements "vm fedora heat-cfntools" "i386" "fedora-vm-heat-cfntools-tempest" |
|
| 277 |
+ iniset $TEMPEST_CONF orchestration image_ref "fedora-vm-heat-cfntools-tempest" |
|
| 278 |
+ fi |
|
| 279 |
+ |
|
| 274 | 280 |
# Scenario |
| 275 | 281 |
iniset $TEMPEST_CONF scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec" |
| 276 | 282 |
|