glance/playbooks/post-check-metadata-injection.yaml
Rajat Dhasmana d47803613d Handle case for multiple cirros images
The change[1] configures multiple images for the devstack-tempest
job and all the jobs deriving from it. This causes problem with
the current post-check-metadata-injection.yaml playbook since
we only expect one cirros image and perform steps accordingly.
This change modifies the playbook to handle multiple cirros
images.
Failure in the glance-multistore-cinder-import job can be
seen here[2].

[1] https://review.opendev.org/c/openstack/tempest/+/831018
[2] https://zuul.opendev.org/t/openstack/build/68a4d3ec6ce04c87b21d73a333f5b5cd/log/job-output.txt#23161

Change-Id: I70b4a970d7e16174f715c54bdae9467cc321c13e
2023-06-14 09:24:03 +00:00

25 lines
964 B
YAML

# This playbook is for OpenDev infra consumption only.
- hosts: controller
tasks:
- name: Run glance validation script
shell:
executable: /bin/bash
cmd: |
source /opt/stack/devstack/openrc
set -xe
cirrosimg=$(glance image-list | grep cirros | cut -d" " -f 2)
# There could be more than one cirros image so traverse through the list
for image in $cirrosimg
do
echo "Dumping the cirros image for debugging..."
glance image-show $image
echo "Checking that the cirros image was decorated with metdata on import..."
glance image-list --property-filter 'glance_devstack_test=doyouseeme?' | grep $image
echo "Checking that the cirros image was converted to raw on import..."
glance image-show $image | egrep -e 'disk_format.*raw'
done
environment: '{{ zuul | zuul_legacy_vars }}'