From 3246f65d9de427b2e146d99d4044aea9bf0a0dff Mon Sep 17 00:00:00 2001 From: Soniya Vyas Date: Thu, 2 Dec 2021 18:43:49 +0530 Subject: [PATCH] Add multistore image option This is an attempt to populate tempestconf with multistore feature enabled if and only if multiple stores are available. In Rocky and Stein, Glance has added the ability to configure multiple stores as an EXPERIMENTAL feature. This feature is fully supported from the Train cycle. Please refer [1] for more information [1] https://specs.openstack.org/openstack/cinder-specs/specs/ussuri/support-glance-multiple-backend.html Here are two test-projects exercising the results of this change 1. With multi-store enabled https://review.rdoproject.org/r/c/testproject/+/37159 2. With multi-store not enabled https://review.rdoproject.org/r/c/testproject/+/37160 Signed-off-by: Soniya Vyas Change-Id: I45f9dce14b60e9385600c57ee56b50aba3a4476f --- config_tempest/services/image.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config_tempest/services/image.py b/config_tempest/services/image.py index e7888e62..c58ea175 100644 --- a/config_tempest/services/image.py +++ b/config_tempest/services/image.py @@ -56,6 +56,10 @@ class ImageService(VersionedService): self.convert = convert def set_default_tempest_options(self, conf): + # set 'image-feature-enabled' only if multiple stores available + num_stores = self._get_number_of_stores() + if num_stores: + conf.set('image-feature-enabled', 'import_image', 'True') # When cirros is the image, set validation.image_ssh_user to cirros. # The option is heavily used in CI and it's also usefull for refstack, # because we don't have to specify overrides. @@ -77,6 +81,17 @@ class ImageService(VersionedService): # default value conf.set('image', 'http_image', C.DEFAULT_IMAGE) + def _get_number_of_stores(self): + stores = None + try: + stores = self.client.info_stores()['stores'] + except Exception: + C.LOG.info('Can not retrieve stores, either multiple stores are' + 'not configured or user are not allowed access' + 'stores information') + return 0 + return len(stores) + def get_supported_versions(self): return ['v1', 'v2']