diff --git a/lower-constraints.txt b/lower-constraints.txt index c0da9ce4..a9fa87ac 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -66,7 +66,7 @@ six==1.11.0 snowballstemmer==1.2.1 stestr==2.0.0 stevedore==1.20.0 -tempest==17.1.0 +tempest==30.0.0 testrepository==0.0.20 testtools==2.3.0 traceback2==1.4.0 diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py index 95048bd7..9abd00e5 100644 --- a/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py +++ b/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py @@ -616,6 +616,11 @@ class MiscPolicyActionsNetworkRbacTest(rbac_base.BaseV2ComputeRbacTest): raise cls.skipException( '%s skipped as Neutron is required' % cls.__name__) + @classmethod + def setup_clients(cls): + super(MiscPolicyActionsNetworkRbacTest, cls).setup_clients() + cls.servers_admin_client = cls.os_admin.servers_client + @classmethod def setup_credentials(cls): cls.prepare_instance_network() @@ -659,16 +664,29 @@ class MiscPolicyActionsNetworkRbacTest(rbac_base.BaseV2ComputeRbacTest): # be deleted cls.addClassResourceCleanup(_cleanup_ports, cls.network['id']) + def _delete_and_wait_for_interface_detach( + self, server_id, port_id): + req_id = self.interfaces_client.delete_interface( + server_id, port_id + ).response['x-openstack-request-id'] + waiters.wait_for_interface_detach( + self.servers_admin_client, server_id, port_id, req_id) + + def _delete_and_wait_for_interface_detach_ignore_timeout( + self, server_id, port_id): + try: + self._delete_and_wait_for_interface_detach( + server_id, port_id) + except lib_exc.TimeoutException: + pass + def _attach_interface_to_server(self): network_id = self.network['id'] interface = self.interfaces_client.create_interface( self.server['id'], net_id=network_id)['interfaceAttachment'] - self.addCleanup( - waiters.wait_for_interface_detach, self.interfaces_client, - self.server['id'], interface['port_id']) self.addCleanup( test_utils.call_and_ignore_notfound_exc, - self.interfaces_client.delete_interface, + self._delete_and_wait_for_interface_detach_ignore_timeout, self.server['id'], interface['port_id']) waiters.wait_for_interface_status( self.interfaces_client, self.server['id'], @@ -714,12 +732,9 @@ class MiscPolicyActionsNetworkRbacTest(rbac_base.BaseV2ComputeRbacTest): with self.override_role(): interface = self.interfaces_client.create_interface( self.server['id'], net_id=network_id)['interfaceAttachment'] - self.addCleanup( - waiters.wait_for_interface_detach, self.interfaces_client, - self.server['id'], interface['port_id']) self.addCleanup( test_utils.call_and_ignore_notfound_exc, - self.interfaces_client.delete_interface, + self._delete_and_wait_for_interface_detach_ignore_timeout, self.server['id'], interface['port_id']) waiters.wait_for_interface_status( self.interfaces_client, self.server['id'], @@ -737,10 +752,15 @@ class MiscPolicyActionsNetworkRbacTest(rbac_base.BaseV2ComputeRbacTest): interface = self._attach_interface_to_server() with self.override_role(): - self.interfaces_client.delete_interface(self.server['id'], - interface['port_id']) - waiters.wait_for_interface_detach( - self.interfaces_client, self.server['id'], interface['port_id']) + req_id = self.interfaces_client.delete_interface( + self.server['id'], interface['port_id']) + try: + # interface may be not found - we need to ignore that + waiters.wait_for_interface_detach( + self.servers_admin_client, self.server['id'], + interface['port_id'], req_id) + except lib_exc.NotFound: + pass @decorators.idempotent_id('6886d360-0d86-4760-b1a3-882d81fbebcc') @utils.requires_ext(extension='os-ips', service='compute') @@ -784,10 +804,7 @@ class MiscPolicyActionsNetworkRbacTest(rbac_base.BaseV2ComputeRbacTest): self.server['id'])['interfaceAttachment'] network_id = interface['net_id'] self.addCleanup( - waiters.wait_for_interface_detach, self.interfaces_client, - self.server['id'], interface['port_id']) - self.addCleanup( - self.interfaces_client.delete_interface, + self._delete_and_wait_for_interface_detach, self.server['id'], interface['port_id']) with self.override_role(): diff --git a/patrole_tempest_plugin/tests/api/volume/test_group_snapshots_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_group_snapshots_rbac.py index f83f35b1..0b265e8a 100644 --- a/patrole_tempest_plugin/tests/api/volume/test_group_snapshots_rbac.py +++ b/patrole_tempest_plugin/tests/api/volume/test_group_snapshots_rbac.py @@ -61,8 +61,8 @@ class BaseGroupSnapshotsRbacTest(rbac_base.BaseVolumeRbacTest): class GroupSnaphotsV314RbacTest(BaseGroupSnapshotsRbacTest): _api_version = 3 - min_microversion = '3.14' - max_microversion = 'latest' + volume_min_microversion = '3.14' + volume_max_microversion = 'latest' @classmethod def skip_checks(cls): @@ -158,8 +158,8 @@ class GroupSnaphotsV314RbacTest(BaseGroupSnapshotsRbacTest): class GroupSnaphotsV319RbacTest(BaseGroupSnapshotsRbacTest): _api_version = 3 - min_microversion = '3.19' - max_microversion = 'latest' + volume_min_microversion = '3.19' + volume_max_microversion = 'latest' @classmethod def skip_checks(cls): diff --git a/patrole_tempest_plugin/tests/api/volume/test_group_type_specs.py b/patrole_tempest_plugin/tests/api/volume/test_group_type_specs.py index 2d0ef696..3b93d093 100644 --- a/patrole_tempest_plugin/tests/api/volume/test_group_type_specs.py +++ b/patrole_tempest_plugin/tests/api/volume/test_group_type_specs.py @@ -38,8 +38,8 @@ else: class GroupTypeSpecsRbacTest(rbac_base.BaseVolumeRbacTest): _api_version = 3 - min_microversion = '3.11' - max_microversion = 'latest' + volume_min_microversion = '3.11' + volume_max_microversion = 'latest' @decorators.idempotent_id('b2859734-00ad-4a22-88ee-541698e90d12') @rbac_rule_validation.action( diff --git a/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py index 99754106..f0123844 100644 --- a/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py +++ b/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py @@ -69,8 +69,8 @@ class BaseGroupRbacTest(rbac_base.BaseVolumeRbacTest): class GroupsV3RbacTest(BaseGroupRbacTest): - min_microversion = '3.13' - max_microversion = 'latest' + volume_min_microversion = '3.13' + volume_max_microversion = 'latest' @decorators.idempotent_id('43235328-66ae-424f-bc7f-f709c0ca268c') @rbac_rule_validation.action( @@ -152,8 +152,8 @@ class GroupsV3RbacTest(BaseGroupRbacTest): class GroupV320RbacTest(BaseGroupRbacTest): _api_version = 3 - min_microversion = '3.20' - max_microversion = 'latest' + volume_min_microversion = '3.20' + volume_max_microversion = 'latest' @decorators.idempotent_id('b849c1d4-3215-4f9d-b1e6-0aeb4b2b65ac') @rbac_rule_validation.action( @@ -172,8 +172,8 @@ class GroupV320RbacTest(BaseGroupRbacTest): class GroupTypesV3RbacTest(rbac_base.BaseVolumeRbacTest): - min_microversion = '3.11' - max_microversion = 'latest' + volume_min_microversion = '3.11' + volume_max_microversion = 'latest' @decorators.idempotent_id('2820f12c-4681-4c7f-b28d-e6925637dff6') @rbac_rule_validation.action( diff --git a/patrole_tempest_plugin/tests/api/volume/test_user_messages_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_user_messages_rbac.py index f0dfe099..3feb2dfc 100644 --- a/patrole_tempest_plugin/tests/api/volume/test_user_messages_rbac.py +++ b/patrole_tempest_plugin/tests/api/volume/test_user_messages_rbac.py @@ -25,8 +25,8 @@ CONF = config.CONF class MessagesV3RbacTest(rbac_base.BaseVolumeRbacTest): - min_microversion = '3.3' - max_microversion = 'latest' + volume_min_microversion = '3.3' + volume_max_microversion = 'latest' @classmethod def setup_clients(cls): diff --git a/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py index 9205b586..e3311eae 100644 --- a/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py +++ b/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py @@ -220,8 +220,8 @@ class VolumesActionsV3RbacTest(rbac_base.BaseVolumeRbacTest): class VolumesActionsV310RbacTest(rbac_base.BaseVolumeRbacTest): _api_version = 3 - min_microversion = '3.10' - max_microversion = 'latest' + volume_min_microversion = '3.10' + volume_max_microversion = 'latest' @classmethod def setup_clients(cls): @@ -283,8 +283,8 @@ class VolumesActionsV310RbacTest(rbac_base.BaseVolumeRbacTest): class VolumesActionsV312RbacTest(rbac_base.BaseVolumeRbacTest): _api_version = 3 - min_microversion = '3.12' - max_microversion = 'latest' + volume_min_microversion = '3.12' + volume_max_microversion = 'latest' @decorators.idempotent_id('a654833d-4811-4acd-93ef-5ac4a34c75bc') @rbac_rule_validation.action(service="cinder", rules=["volume:get_all"]) diff --git a/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py index 0e807e86..073b26ce 100644 --- a/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py +++ b/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py @@ -183,8 +183,8 @@ class VolumesBackupsV318RbacTest(rbac_base.BaseVolumeRbacTest): _api_version = 3 # The minimum microversion for showing 'os-backup-project-attr:project_id' # is 3.18. - min_microversion = '3.18' - max_microversion = 'latest' + volume_min_microversion = '3.18' + volume_max_microversion = 'latest' @classmethod def skip_checks(cls): @@ -226,8 +226,8 @@ class VolumesBackupsV318RbacTest(rbac_base.BaseVolumeRbacTest): class VolumesBackupsV39RbacTest(rbac_base.BaseVolumeRbacTest): _api_version = 3 - min_microversion = '3.9' - max_microversion = 'latest' + volume_min_microversion = '3.9' + volume_max_microversion = 'latest' @classmethod def skip_checks(cls): diff --git a/requirements.txt b/requirements.txt index cc13aa9a..5a4858db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,5 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0 oslo.policy>=1.30.0 # Apache-2.0 -tempest>=17.1.0 # Apache-2.0 +tempest>=30.0.0 # Apache-2.0 stevedore>=1.20.0 # Apache-2.0