From 1470ddcee820d95f2ed5f3f5ecdded20e3a01fa5 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Wed, 23 Aug 2023 22:23:16 -0700 Subject: [PATCH] Use service role also in test_assisted_volume_snapshots Assisted volume snapshots API is service-to-service API and nova is changing its default permission to 'service' role - https://review.opendev.org/c/openstack/nova/+/892635 To pass test on new defaults as well as old defaults testing jobs, we need to use service role also in the Tempest creds. Once nova change is merged then we can use only service role to access this API. Needed-By: https://review.opendev.org/c/openstack/nova/+/892635 Change-Id: I2c4368b8e2378842919fd16fa6f07505605f283a --- .../api/compute/admin/test_assisted_volume_snapshots.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tempest/api/compute/admin/test_assisted_volume_snapshots.py b/tempest/api/compute/admin/test_assisted_volume_snapshots.py index 5e30444b31..b7be796ad6 100644 --- a/tempest/api/compute/admin/test_assisted_volume_snapshots.py +++ b/tempest/api/compute/admin/test_assisted_volume_snapshots.py @@ -26,6 +26,13 @@ class VolumesAssistedSnapshotsTest(base.BaseV2ComputeAdminTest): create_default_network = True + # TODO(gmann): Remove the admin access to service user + # once nova change the default of this API to service + # role. To merge the nova changing the policy default + # we need to use token with admin as well as service + # role and later we can use only service token. + credentials = ['primary', 'admin', ['service_user', 'admin', 'service']] + @classmethod def skip_checks(cls): super(VolumesAssistedSnapshotsTest, cls).skip_checks() @@ -37,7 +44,7 @@ class VolumesAssistedSnapshotsTest(base.BaseV2ComputeAdminTest): def setup_clients(cls): super(VolumesAssistedSnapshotsTest, cls).setup_clients() cls.assisted_v_client = ( - cls.os_admin.assisted_volume_snapshots_client) + cls.os_service_user.assisted_volume_snapshots_client) cls.volumes_client = cls.os_admin.volumes_client_latest cls.servers_client = cls.os_admin.servers_client