diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2021-07-23 12:48:23 +0100 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2021-07-23 12:51:30 +0100 |
| commit | c1209601b4f4b81690a186e51aa819c783367fae (patch) | |
| tree | e95db46512897968331a62a02606914963ac5ba2 /openstackclient/tests/functional/volume/v1 | |
| parent | 4891bb38208fdcd1a2ae60e47b056841e14fbdf7 (diff) | |
| download | python-openstackclient-c1209601b4f4b81690a186e51aa819c783367fae.tar.gz | |
tests: Handle removal of block-storage v2 API
Cinder recently removed their v2 API [1] which is causing the functional
tests to fail. Improve our 'is_service_enabled' test helper to use the
'versions show' command, which queries the service catalog and can give
us information about the service version as well as answer the more
general "is this service available" question. We also resolve a
long-standing TODO in the process.
[1] https://review.opendev.org/c/openstack/cinder/+/792299
Change-Id: I381069357aa008344e15327adf3a863c0c2e1f04
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/functional/volume/v1')
| -rw-r--r-- | openstackclient/tests/functional/volume/v1/common.py | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/openstackclient/tests/functional/volume/v1/common.py b/openstackclient/tests/functional/volume/v1/common.py index 04eb1f48..75587478 100644 --- a/openstackclient/tests/functional/volume/v1/common.py +++ b/openstackclient/tests/functional/volume/v1/common.py @@ -20,25 +20,14 @@ class BaseVolumeTests(volume_base.BaseVolumeTests): @classmethod def setUpClass(cls): - super(BaseVolumeTests, cls).setUpClass() - # TODO(dtroyer): This needs to be updated to specifically check for - # Volume v1 rather than just 'volume', but for now - # that is enough until we get proper version negotiation - cls.haz_volume_v1 = cls.is_service_enabled('volume') + super().setUpClass() + cls.haz_volume_v1 = cls.is_service_enabled('block-storage', '1.0') def setUp(self): - super(BaseVolumeTests, self).setUp() - - # This class requires Volume v1 - # if not self.haz_volume_v1: - # self.skipTest("No Volume v1 service present") - - # TODO(dtroyer): We really want the above to work but right now - # (12Sep2017) DevStack still creates a 'volume' - # service type even though there is no service behind - # it. Until that is fixed we need to just skip the - # volume v1 functional tests in master. - self.skipTest("No Volume v1 service present") + super().setUp() + + if not self.haz_volume_v1: + self.skipTest("No Volume v1 service present") ver_fixture = fixtures.EnvironmentVariable( 'OS_VOLUME_API_VERSION', '1' |
