Skip to content

Commit

Permalink
Add glance-simplestreams-sync set_latest_property config functest
Browse files Browse the repository at this point in the history
When creating Openstack VMs the user has to specify the image it wants
to use. sstream-mirror-glance adds a date to the image name, so they
always have to recheck which is the current latest image.

This commit tests the usage of the `set_latest_property` configuration.

When --set-latest-property is given sstream-mirror-glance will set the
recently synced image with the `latest=true` property and then remove
the `latest` property from all the os_version/architecture matching
images.

Closes-bug: LP #1933130
  • Loading branch information
guimaluf committed Aug 5, 2022
1 parent 4697ce4 commit d571d81
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions zaza/openstack/charm_tests/glance_simplestreams_sync/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,25 @@ def _check_local_product_streams(expected_images):
_check_local_product_streams(expected_images)

logging.debug("Local product stream successful")


class GlanceSimpleStreamsSyncWithPropertiesTest(GlanceSimpleStreamsSyncTest):

@classmethod
def setUpClass(cls):
"""Run class setup for running glance simple streams sync tests."""
super(GlanceSimpleStreamsSyncWithPropertiesTest, cls).setUpClass()
zaza_model.set_application_config('glance-simplestreams-sync',
{'set_latest_property': 'true'})
zaza_model.wait_for_application_states()

# TODO(guimalufb) test if the latest property gets removed from old images
def test_200_check_image_latest_property(self):
"""Verify that a property inclusion has been done"""
logging.debug("Checking image latest property")

filter_properties = {'filters': {'latest': 'true'}}
images = self.glance_client.images.list(**filter_properties)
self.assertTrue(len(list(images)) > 0,
"'latest=true' property not found in glance images"
" list")

0 comments on commit d571d81

Please sign in to comment.