diff --git a/.zuul.yaml b/.zuul.yaml index 276a927..c089396 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -23,6 +23,7 @@ # As per the Tempest "Stable Branch Support Policy", Tempest will only # support the "Maintained" stable branches, so only jobs for the # current stable branches should be listed here. + - cinder-tempest-plugin-basic-2024-2 - cinder-tempest-plugin-basic-2024-1 - cinder-tempest-plugin-basic-2023-2 - cinder-tempest-plugin-basic-2023-1 @@ -36,6 +37,7 @@ - cinder-tempest-plugin-cbak-ceph experimental: jobs: + - cinder-tempest-plugin-cbak-ceph-2024-2 - cinder-tempest-plugin-cbak-ceph-2024-1 - cinder-tempest-plugin-cbak-ceph-2023-2 - cinder-tempest-plugin-cbak-ceph-2023-1 @@ -110,6 +112,7 @@ vars: configure_swap_size: 8192 tempest_test_regex: '(^tempest\.(api|scenario)|(^cinder_tempest_plugin))' + tempest_test_exclude_list: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/tempest"].src_dir }}/tools/tempest-integrated-gate-storage-exclude-list.txt' tox_envlist: all devstack_localrc: CINDER_LVM_TYPE: thin @@ -144,8 +147,6 @@ # from the 21st century! branches: ^(master|(stable/(202[4-9]|20[3-9]\d|2[1-9]\d\d|[3-9]\d\d\d))\.[12])$ parent: cinder-tempest-plugin-lvm-barbican-base-abstract - vars: - tempest_test_exclude_list: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/tempest"].src_dir }}/tools/tempest-integrated-gate-storage-exclude-list.txt' - job: name: cinder-tempest-plugin-lvm-barbican-base @@ -164,7 +165,6 @@ vars: fetch_subunit_output_additional_dirs: - "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/cinderlib'].src_dir }}" - tempest_test_exclude_list: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/tempest"].src_dir }}/tools/tempest-integrated-gate-storage-exclude-list.txt' - job: name: cinder-tempest-plugin-lvm-barbican-base @@ -189,7 +189,6 @@ vars: fetch_subunit_output_additional_dirs: - "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/cinderlib'].src_dir }}" - tempest_test_exclude_list: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/tempest"].src_dir }}/tools/tempest-integrated-gate-storage-exclude-list.txt' - job: name: cinder-tempest-plugin-lvm-barbican-base @@ -214,7 +213,6 @@ vars: fetch_subunit_output_additional_dirs: - "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/cinderlib'].src_dir }}" - tempest_test_exclude_list: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/tempest"].src_dir }}/tools/tempest-integrated-gate-storage-exclude-list.txt' - job: name: cinder-tempest-plugin-lvm-barbican-base @@ -232,8 +230,6 @@ required-projects: - name: opendev.org/openstack/cinder-tempest-plugin override-checkout: 1.3.0 - vars: - tempest_test_exclude_list: '{{ ansible_user_dir }}/{{ zuul.projects["opendev.org/openstack/tempest"].src_dir }}/tools/tempest-integrated-gate-storage-exclude-list.txt' - job: name: cinder-tempest-plugin-lvm-barbican-base @@ -270,6 +266,12 @@ devstack_localrc: CINDER_QUOTA_VOLUMES: 25 timeout: 10800 + +- job: + name: cinder-tempest-plugin-cbak-ceph-2024-2 + parent: cinder-tempest-plugin-cbak-ceph + nodeset: openstack-single-node-jammy + override-checkout: stable/2024.2 - job: name: cinder-tempest-plugin-cbak-ceph-2024-1 @@ -411,6 +413,12 @@ - ^releasenotes/.*$ - job: + name: cinder-tempest-plugin-basic-2024-2 + parent: cinder-tempest-plugin-basic + nodeset: openstack-single-node-jammy + override-checkout: stable/2024.2 + +- job: name: cinder-tempest-plugin-basic-2024-1 parent: cinder-tempest-plugin-basic nodeset: openstack-single-node-jammy diff --git a/cinder_tempest_plugin/api/volume/admin/test_consistencygroups.py b/cinder_tempest_plugin/api/volume/admin/test_consistencygroups.py index 42c78f1..191ecb2 100644 --- a/cinder_tempest_plugin/api/volume/admin/test_consistencygroups.py +++ b/cinder_tempest_plugin/api/volume/admin/test_consistencygroups.py @@ -20,18 +20,11 @@ from tempest.lib import decorators from cinder_tempest_plugin.api.volume import base -from cinder_tempest_plugin import cinder_clients CONF = config.CONF class ConsistencyGroupsV2Test(base.BaseVolumeAdminTest): - @classmethod - def setup_clients(cls): - super(ConsistencyGroupsV2Test, cls).setup_clients() - - manager = cinder_clients.Manager(cls.os_admin) - cls.consistencygroups_adm_client = manager.consistencygroups_adm_client @classmethod def skip_checks(cls): @@ -41,16 +34,16 @@ "feature disabled") def _delete_consistencygroup(self, cg_id): - self.consistencygroups_adm_client.delete_consistencygroup(cg_id) + self.admin_consistencygroups_client.delete_consistencygroup(cg_id) vols = self.admin_volume_client.list_volumes(detail=True)['volumes'] for vol in vols: if vol['consistencygroup_id'] == cg_id: self.admin_volume_client.wait_for_resource_deletion(vol['id']) - self.consistencygroups_adm_client.wait_for_consistencygroup_deletion( + self.admin_consistencygroups_client.wait_for_consistencygroup_deletion( cg_id) def _delete_cgsnapshot(self, cgsnapshot_id, cg_id): - self.consistencygroups_adm_client.delete_cgsnapshot(cgsnapshot_id) + self.admin_consistencygroups_client.delete_cgsnapshot(cgsnapshot_id) vols = self.admin_volume_client.list_volumes(detail=True)['volumes'] snapshots = self.os_admin.snapshots_v2_client.list_snapshots( detail=True)['snapshots'] @@ -60,7 +53,7 @@ vol['id'] == snap['volume_id']): (self.snapshots_client. wait_for_resource_deletion(snap['id'])) - self.consistencygroups_adm_client.wait_for_cgsnapshot_deletion( + self.admin_consistencygroups_client.wait_for_cgsnapshot_deletion( cgsnapshot_id) @decorators.idempotent_id('3fe776ba-ec1f-4e6c-8d78-4b14c3a7fc44') @@ -73,10 +66,10 @@ # Create CG cg_name = data_utils.rand_name('CG') create_consistencygroup = ( - self.consistencygroups_adm_client.create_consistencygroup) - cg = create_consistencygroup(volume_type['id'], - name=cg_name)['consistencygroup'] - self.consistencygroups_adm_client.wait_for_consistencygroup_status( + self.admin_consistencygroups_client.create_consistencygroup) + cg = create_consistencygroup(volume_type['id'], + name=cg_name)['consistencygroup'] + self.admin_consistencygroups_client.wait_for_consistencygroup_status( cg['id'], 'available') self.assertEqual(cg_name, cg['name']) @@ -92,12 +85,12 @@ volume['id'], 'available') # Get a given CG - cg = self.consistencygroups_adm_client.show_consistencygroup( + cg = self.admin_consistencygroups_client.show_consistencygroup( cg['id'])['consistencygroup'] self.assertEqual(cg_name, cg['name']) # Get all CGs with detail - cgs = self.consistencygroups_adm_client.list_consistencygroups( + cgs = self.admin_consistencygroups_client.list_consistencygroups( detail=True)['consistencygroups'] self.assertIn((cg['name'], cg['id']), [(m['name'], m['id']) for m in cgs]) @@ -117,10 +110,10 @@ # Create CG cg_name = data_utils.rand_name('CG') create_consistencygroup = ( - self.consistencygroups_adm_client.create_consistencygroup) - cg = create_consistencygroup(volume_type['id'], - name=cg_name)['consistencygroup'] - self.consistencygroups_adm_client.wait_for_consistencygroup_status( + self.admin_consistencygroups_client.create_consistencygroup) + cg = create_consistencygroup(volume_type['id'], + name=cg_name)['consistencygroup'] + self.admin_consistencygroups_client.wait_for_consistencygroup_status( cg['id'], 'available') self.assertEqual(cg_name, cg['name']) @@ -137,10 +130,10 @@ # Create cgsnapshot cgsnapshot_name = data_utils.rand_name('cgsnapshot') create_cgsnapshot = ( - self.consistencygroups_adm_client.create_cgsnapshot) + self.admin_consistencygroups_client.create_cgsnapshot) cgsnapshot = create_cgsnapshot(cg['id'], name=cgsnapshot_name)['cgsnapshot'] - self.consistencygroups_adm_client.wait_for_cgsnapshot_status( + self.admin_consistencygroups_client.wait_for_cgsnapshot_status( cgsnapshot['id'], 'available') self.assertEqual(cgsnapshot_name, cgsnapshot['name']) snapshots = self.os_admin.snapshots_v2_client.list_snapshots( @@ -152,12 +145,12 @@ snap['id'], 'available') # Get a given CG snapshot - cgsnapshot = self.consistencygroups_adm_client.show_cgsnapshot( + cgsnapshot = self.admin_consistencygroups_client.show_cgsnapshot( cgsnapshot['id'])['cgsnapshot'] self.assertEqual(cgsnapshot_name, cgsnapshot['name']) # Get all CG snapshots with detail - cgsnapshots = self.consistencygroups_adm_client.list_cgsnapshots( + cgsnapshots = self.admin_consistencygroups_client.list_cgsnapshots( detail=True)['cgsnapshots'] self.assertIn((cgsnapshot['name'], cgsnapshot['id']), [(m['name'], m['id']) for m in cgsnapshots]) @@ -177,10 +170,10 @@ # Create CG cg_name = data_utils.rand_name('CG') create_consistencygroup = ( - self.consistencygroups_adm_client.create_consistencygroup) - cg = create_consistencygroup(volume_type['id'], - name=cg_name)['consistencygroup'] - self.consistencygroups_adm_client.wait_for_consistencygroup_status( + self.admin_consistencygroups_client.create_consistencygroup) + cg = create_consistencygroup(volume_type['id'], + name=cg_name)['consistencygroup'] + self.admin_consistencygroups_client.wait_for_consistencygroup_status( cg['id'], 'available') self.assertEqual(cg_name, cg['name']) @@ -197,10 +190,10 @@ # Create cgsnapshot cgsnapshot_name = data_utils.rand_name('cgsnapshot') create_cgsnapshot = ( - self.consistencygroups_adm_client.create_cgsnapshot) + self.admin_consistencygroups_client.create_cgsnapshot) cgsnapshot = create_cgsnapshot(cg['id'], name=cgsnapshot_name)['cgsnapshot'] - self.consistencygroups_adm_client.wait_for_cgsnapshot_status( + self.admin_consistencygroups_client.wait_for_cgsnapshot_status( cgsnapshot['id'], 'available') self.assertEqual(cgsnapshot_name, cgsnapshot['name']) snapshots = self.snapshots_client.list_snapshots( @@ -213,10 +206,12 @@ # Create CG from CG snapshot cg_name2 = data_utils.rand_name('CG_from_snap') create_consistencygroup2 = ( - self.consistencygroups_adm_client.create_consistencygroup_from_src) + self.admin_consistencygroups_client. + create_consistencygroup_from_src + ) cg2 = create_consistencygroup2(cgsnapshot_id=cgsnapshot['id'], name=cg_name2)['consistencygroup'] - self.consistencygroups_adm_client.wait_for_consistencygroup_status( + self.admin_consistencygroups_client.wait_for_consistencygroup_status( cg2['id'], 'available') self.assertEqual(cg_name2, cg2['name']) vols = self.admin_volume_client.list_volumes( @@ -242,10 +237,10 @@ # Create CG cg_name = data_utils.rand_name('CG') create_consistencygroup = ( - self.consistencygroups_adm_client.create_consistencygroup) - cg = create_consistencygroup(volume_type['id'], - name=cg_name)['consistencygroup'] - self.consistencygroups_adm_client.wait_for_consistencygroup_status( + self.admin_consistencygroups_client.create_consistencygroup) + cg = create_consistencygroup(volume_type['id'], + name=cg_name)['consistencygroup'] + self.admin_consistencygroups_client.wait_for_consistencygroup_status( cg['id'], 'available') self.assertEqual(cg_name, cg['name']) @@ -262,10 +257,12 @@ # Create CG from CG cg_name2 = data_utils.rand_name('CG_from_cg') create_consistencygroup2 = ( - self.consistencygroups_adm_client.create_consistencygroup_from_src) + self.admin_consistencygroups_client. + create_consistencygroup_from_src + ) cg2 = create_consistencygroup2(source_cgid=cg['id'], name=cg_name2)['consistencygroup'] - self.consistencygroups_adm_client.wait_for_consistencygroup_status( + self.admin_consistencygroups_client.wait_for_consistencygroup_status( cg2['id'], 'available') self.assertEqual(cg_name2, cg2['name']) vols = self.admin_volume_client.list_volumes( diff --git a/cinder_tempest_plugin/api/volume/base.py b/cinder_tempest_plugin/api/volume/base.py index c0f53bd..1c64973 100644 --- a/cinder_tempest_plugin/api/volume/base.py +++ b/cinder_tempest_plugin/api/volume/base.py @@ -50,6 +50,9 @@ cls.backups_client = cls.os_primary.backups_client_latest cls.volumes_client = cls.os_primary.volumes_client_latest cls.snapshots_client = cls.os_primary.snapshots_client_latest + cls.volume_revert_client = ( + cls.os_primary.volume_revert_v3.VolumeRevertClient() + ) @classmethod def setup_credentials(cls): @@ -196,6 +199,9 @@ cls.admin_volume_types_client = cls.os_admin.volume_types_client_latest cls.admin_backups_client = cls.os_admin.backups_client_latest cls.admin_volume_client = cls.os_admin.volumes_client_latest + cls.admin_consistencygroups_client = ( + cls.os_admin.consistencygroups_v3.ConsistencyGroupsClient() + ) @classmethod def create_volume_type(cls, name=None, **kwargs): diff --git a/cinder_tempest_plugin/api/volume/test_volume_revert.py b/cinder_tempest_plugin/api/volume/test_volume_revert.py index 2c4d6bd..c585c3c 100644 --- a/cinder_tempest_plugin/api/volume/test_volume_revert.py +++ b/cinder_tempest_plugin/api/volume/test_volume_revert.py @@ -19,7 +19,6 @@ from tempest.lib import exceptions from cinder_tempest_plugin.api.volume import base -from cinder_tempest_plugin import cinder_clients CONF = config.CONF @@ -32,13 +31,6 @@ super(VolumeRevertTests, cls).skip_checks() if not CONF.volume_feature_enabled.volume_revert: raise cls.skipException("Cinder volume revert feature disabled") - - @classmethod - def setup_clients(cls): - super(VolumeRevertTests, cls).setup_clients() - - manager = cinder_clients.Manager(cls.os_primary) - cls.volume_revert_client = manager.volume_revert_client def setUp(self): super(VolumeRevertTests, self).setUp() diff --git a/cinder_tempest_plugin/cinder_clients.py b/cinder_tempest_plugin/cinder_clients.py index f4c7c0e..b27d22c 100644 --- a/cinder_tempest_plugin/cinder_clients.py +++ b/cinder_tempest_plugin/cinder_clients.py @@ -14,27 +14,19 @@ # under the License. from tempest import config - -from cinder_tempest_plugin.services import consistencygroups_client -from cinder_tempest_plugin.services import volume_revert_client +from tempest.lib.services import clients CONF = config.CONF -class Manager(object): - def __init__(self, base_manager): - params = { - 'service': CONF.volume.catalog_type, - 'region': CONF.volume.region or CONF.identity.region, - 'endpoint_type': CONF.volume.endpoint_type, - 'build_interval': CONF.volume.build_interval, - 'build_timeout': CONF.volume.build_timeout - } - params.update(base_manager.default_params) - auth_provider = base_manager.auth_provider +class Clients(clients.ServiceClients): + """Tempest stable service clients and loaded plugins service clients""" - self.consistencygroups_adm_client = ( - consistencygroups_client.ConsistencyGroupsClient(auth_provider, - **params)) - self.volume_revert_client = ( - volume_revert_client.VolumeRevertClient(auth_provider, **params)) + def __init__(self, credentials, service=None): + """Emulate the interface of Tempest's clients.Manager""" + # Identity settings + if CONF.identity.auth_version == 'v2': + identity_uri = CONF.identity.uri + else: + identity_uri = CONF.identity.uri_v3 + super(Clients, self).__init__(credentials, identity_uri) diff --git a/cinder_tempest_plugin/plugin.py b/cinder_tempest_plugin/plugin.py index 5d170e5..79c835c 100644 --- a/cinder_tempest_plugin/plugin.py +++ b/cinder_tempest_plugin/plugin.py @@ -69,3 +69,26 @@ project_config.barbican_service_option)) return opt_lists + + def get_service_clients(self): + volumes_config = config.service_client_config('volume') + + consistencygroups_params = { + 'name': 'consistencygroups_v3', + 'service_version': 'consistencygroups.v3', + 'module_path': 'cinder_tempest_plugin.services.' + 'consistencygroups_client', + 'client_names': ['ConsistencyGroupsClient'], + } + consistencygroups_params.update(volumes_config) + + volumerevert_params = { + 'name': 'volume_revert_v3', + 'service_version': 'volume_revert.v3', + 'module_path': 'cinder_tempest_plugin.services.' + 'volume_revert_client', + 'client_names': ['VolumeRevertClient'], + } + volumerevert_params.update(volumes_config) + + return [consistencygroups_params, volumerevert_params] diff --git a/cinder_tempest_plugin/scenario/test_encrypted_volume_transfer.py b/cinder_tempest_plugin/scenario/test_encrypted_volume_transfer.py index 7232433..bfe33b2 100644 --- a/cinder_tempest_plugin/scenario/test_encrypted_volume_transfer.py +++ b/cinder_tempest_plugin/scenario/test_encrypted_volume_transfer.py @@ -41,6 +41,8 @@ @classmethod def skip_checks(cls): super(TransferEncryptedVolumeTest, cls).skip_checks() + if not CONF.compute_feature_enabled.attach_encrypted_volume: + raise cls.skipException('Encrypted volume attach is not supported') if not CONF.service_available.barbican: raise cls.skipException('Barbican is required') diff --git a/cinder_tempest_plugin/services/__init__.py b/cinder_tempest_plugin/services/__init__.py index e69de29..8be06b7 100644 --- a/cinder_tempest_plugin/services/__init__.py +++ b/cinder_tempest_plugin/services/__init__.py @@ -0,0 +1,22 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from cinder_tempest_plugin.services.consistencygroups_client import \ + ConsistencyGroupsClient +from cinder_tempest_plugin.services.volume_revert_client import \ + VolumeRevertClient + +__all__ = [ + 'ConsistencyGroupsClient', + 'VolumeRevertClient' +]