Codebase list cinder-tempest-plugin / 6f0b4fc
Allow to run with API v3 (remove deprecated options) Remove the usage of api_version and let the library code use catalog_type instead. CONF.volume_feature_enabled.{api_v2,api_v3} have been deprecated since rocky. See also: - https://review.opendev.org/#/c/698754/ - https://review.opendev.org/#/c/698757/ and other reviews. Change-Id: Ic91f38ebff96df7d38a2d8cd2447e454c385c46c Luigi Toscano 6 years ago
1 changed file(s) with 3 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
1919 from tempest.lib.common import api_version_utils
2020 from tempest.lib.common.utils import data_utils
2121 from tempest.lib.common.utils import test_utils
22 from tempest.lib import exceptions
2322 from tempest import test
2423
2524 CONF = config.CONF
2928 test.BaseTestCase):
3029 """Base test case class for all Cinder API tests."""
3130
32 _api_version = 2
3331 credentials = ['primary']
3432
3533 @classmethod
3937 if not CONF.service_available.cinder:
4038 skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
4139 raise cls.skipException(skip_msg)
42 if cls._api_version == 2:
43 if not CONF.volume_feature_enabled.api_v2:
44 msg = "Volume API v2 is disabled"
45 raise cls.skipException(msg)
46 elif cls._api_version == 3:
47 if not CONF.volume_feature_enabled.api_v3:
48 msg = "Volume API v3 is disabled"
49 raise cls.skipException(msg)
50 else:
51 msg = ("Invalid Cinder API version (%s)" % cls._api_version)
52 raise exceptions.InvalidConfiguration(msg)
5340
5441 api_version_utils.check_skip_with_microversion(
5542 cls.min_microversion, cls.max_microversion,
5845 @classmethod
5946 def setup_clients(cls):
6047 super(BaseVolumeTest, cls).setup_clients()
61 if cls._api_version == 3:
62 cls.backups_client = cls.os_primary.backups_v3_client
63 cls.volumes_client = cls.os_primary.volumes_v3_client
64 else:
65 cls.backups_client = cls.os_primary.backups_v2_client
66 cls.volumes_client = cls.os_primary.volumes_v2_client
67
68 cls.snapshots_client = cls.os_primary.snapshots_v2_client
48 cls.backups_client = cls.os_primary.backups_client_latest
49 cls.volumes_client = cls.os_primary.volumes_client_latest
50 cls.snapshots_client = cls.os_primary.snapshots_client_latest
6951
7052 @classmethod
7153 def setup_credentials(cls):