summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladyslav Drok <vdrok@mirantis.com>2016-06-14 20:16:55 +0300
committerDmitry Tantsur <divius.inside@gmail.com>2016-09-22 18:46:40 +0000
commit7b0c2777ab333340cef5ced9fc3d141fc67e961d (patch)
tree7287196ffe9e42b7bc77541bdf0c028b1b9e74ff
parent0f85f0b7a3b06204153289a230fa8ace8b946635 (diff)
downloadironic-7b0c2777ab333340cef5ced9fc3d141fc67e961d.tar.gz
Change the logic of selecting image for tests
Right now devstack sets DEFAULT_IMAGE_NAME depending on the driver in stackrc. UUID of the image with this name is then written to tempest config during tempest configuration stage and is used to determine which image will be used during nova boot. As ironic python agent now supports both whole disk and partition images, we should change this logic, and the user should be able to request which image should be used in tests. This commit adds IRONIC_TEMPEST_WHOLE_DISK_IMAGE and IRONIC_IMAGE_NAME variables to provide this possibility. If IRONIC_TEMPEST_WHOLE_DISK_IMAGE is not set, we try to infer the image type by the size of the ephemeral partition requested, if it is 0, we consider the image to be whole disk. Change-Id: Ic718a6b37c09ae564ecc3913cf31234316f1da63 (cherry picked from commit e434225f9bec6f078f5514c82c9406131122a49e)
-rw-r--r--devstack/lib/ironic17
1 files changed, 17 insertions, 0 deletions
diff --git a/devstack/lib/ironic b/devstack/lib/ironic
index 71534f204..18237fbf7 100644
--- a/devstack/lib/ironic
+++ b/devstack/lib/ironic
@@ -151,6 +151,18 @@ IRONIC_DEPLOY_RAMDISK=${IRONIC_DEPLOY_RAMDISK:-}
IRONIC_DEPLOY_KERNEL=${IRONIC_DEPLOY_KERNEL:-}
IRONIC_DEPLOY_ISO=${IRONIC_DEPLOY_ISO:-}
+# These parameters describe which image will be used to provision a node in
+# tempest tests
+if [[ -z "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" && "$IRONIC_VM_EPHEMERAL_DISK" == 0 ]]; then
+ IRONIC_TEMPEST_WHOLE_DISK_IMAGE=True
+fi
+IRONIC_TEMPEST_WHOLE_DISK_IMAGE=$(trueorfalse False IRONIC_TEMPEST_WHOLE_DISK_IMAGE)
+if [[ "$IRONIC_TEMPEST_WHOLE_DISK_IMAGE" == "True" ]]; then
+ IRONIC_IMAGE_NAME=${IRONIC_IMAGE_NAME:-cirros-${CIRROS_VERSION}-x86_64-disk}
+else
+ IRONIC_IMAGE_NAME=${IRONIC_IMAGE_NAME:-cirros-${CIRROS_VERSION}-x86_64-uec}
+fi
+
# NOTE(jroll) this needs to be updated when stable branches are cut
IPA_DOWNLOAD_BRANCH=${IPA_DOWNLOAD_BRANCH:-master}
IPA_DOWNLOAD_BRANCH=$(echo $IPA_DOWNLOAD_BRANCH | tr / -)
@@ -1495,6 +1507,11 @@ function ironic_configure_tempest {
if [[ -n "${IRONIC_PROVISION_NETWORK_NAME}" ]]; then
iniset $TEMPEST_CONFIG baremetal use_provision_network True
fi
+
+ local image_uuid
+ image_uuid=$(openstack image show $IRONIC_IMAGE_NAME -f value -c id)
+ iniset $TEMPEST_CONFIG compute image_ref $image_uuid
+ iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid
}
# Restore xtrace + pipefail