Avoid setting iso image in tempest config

Tempest use image_ref and image_ref_alt as their base
image to run test against and perform ssh etc. Most of
the iso image require ssh to be enabled explicitly so
avoid setting them as image_ref and image_ref_alt unless
it is explicitly requested.

One example that how setting iso image in tempest can fail
tests- https://review.opendev.org/c/openstack/tempest/+/954404

Needed-By: https://review.opendev.org/c/openstack/whitebox-tempest-plugin/+/955950

Change-Id: Ic385a702758d9d38880ec92cfdce2528766fc95d
Signed-off-by: Ghanshyam Maan <gmaan@ghanshyammann.com>
This commit is contained in:
Ghanshyam Maan
2025-07-26 00:58:51 +00:00
parent aa98842342
commit bfa9e547a9

View File

@@ -105,6 +105,8 @@ TEMPEST_CONCURRENCY=${TEMPEST_CONCURRENCY:-$(nproc)}
TEMPEST_FLAVOR_RAM=${TEMPEST_FLAVOR_RAM:-192}
TEMPEST_FLAVOR_ALT_RAM=${TEMPEST_FLAVOR_ALT_RAM:-256}
TEMPEST_USE_ISO_IMAGE=$(trueorfalse False TEMPEST_USE_ISO_IMAGE)
# Functions
# ---------
@@ -161,12 +163,20 @@ function get_active_images {
# start with a fresh array in case we are called multiple times
img_array=()
while read -r IMAGE_NAME IMAGE_UUID; do
# NOTE(gmaan): Most of the iso image require ssh to be enabled explicitly
# and if we set those iso images in image_ref and image_ref_alt that can
# cause test to fail because many tests using image_ref and image_ref_alt
# to boot server also perform ssh. We skip to set iso image in tempest
# unless it is requested via TEMPEST_USE_ISO_IMAGE.
while read -r IMAGE_NAME IMAGE_UUID DISK_FORMAT; do
if [[ "$DISK_FORMAT" == "iso" ]] && [[ "$TEMPEST_USE_ISO_IMAGE" == False ]]; then
continue
fi
if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
img_id="$IMAGE_UUID"
fi
img_array+=($IMAGE_UUID)
done < <(openstack --os-cloud devstack-admin image list --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
done < <(openstack --os-cloud devstack-admin image list --long --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2,$4 }')
}
function poll_glance_images {