Remove Glance v1 APIs tests code

Glance v1 APIs were removed in Rocky and tempest master
does not support the Rocky release. If glance v1 APIs
needs to be tested for older release then older Tempest
can be used.

Tempest is removing the Glance v1 APIs tests, config option,
and its service clients and this change is needed for that.

Needed-By: https://review.opendev.org/c/openstack/tempest/+/890592
Change-Id: I3f285c025bdf0c3b08b51efd157de77dcfd057c6
This commit is contained in:
Ghanshyam Mann 2023-08-06 11:51:13 -07:00
parent 01ab036562
commit 768d009b91

View File

@ -15,12 +15,10 @@
# under the License. # under the License.
from tempest.common import compute from tempest.common import compute
from tempest.common import image as common_image
from tempest.common import waiters from tempest.common import waiters
from tempest import config from tempest import config
from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions as lib_exc
import tempest.test import tempest.test
CONF = config.CONF CONF = config.CONF
@ -44,16 +42,7 @@ class ScenarioTest(tempest.test.BaseTestCase):
cls.flavors_client = cls.os_primary.flavors_client cls.flavors_client = cls.os_primary.flavors_client
cls.compute_floating_ips_client = ( cls.compute_floating_ips_client = (
cls.os_primary.compute_floating_ips_client) cls.os_primary.compute_floating_ips_client)
if CONF.service_available.glance: cls.image_client = cls.os_primary.image_client_v2
# Check if glance v1 is available to determine which client to use.
if CONF.image_feature_enabled.api_v1:
cls.image_client = cls.os_primary.image_client
elif CONF.image_feature_enabled.api_v2:
cls.image_client = cls.os_primary.image_client_v2
else:
raise lib_exc.InvalidConfiguration(
'Either api_v1 or api_v2 must be True in '
'[image-feature-enabled].')
# Compute image client # Compute image client
cls.compute_images_client = cls.os_primary.compute_images_client cls.compute_images_client = cls.os_primary.compute_images_client
cls.keypairs_client = cls.os_primary.keypairs_client cls.keypairs_client = cls.os_primary.keypairs_client
@ -211,11 +200,7 @@ class ScenarioTest(tempest.test.BaseTestCase):
clients = self.os_primary clients = self.os_primary
if imageRef: if imageRef:
if CONF.image_feature_enabled.api_v1: image = self.image_client.show_image(imageRef)
resp = self.image_client.check_image(imageRef)
image = common_image.get_image_meta_from_headers(resp)
else:
image = self.image_client.show_image(imageRef)
min_disk = image.get('min_disk') min_disk = image.get('min_disk')
size = max(size, min_disk) size = max(size, min_disk)