Reset ntp_client cached token in override_role context
As bug [0] shows we have incorrect behaviour with client, when its
allowed to perform forbidden action beacause of cached token.
This patchset expands RbacUtilsMixin with `get_auth_providers` so
we can define additional auth_providers on testcase level.
Using it we reset cached auth data for neutron-tempest-plugin
client in *PluginRbacTest tests.
[0] https://storyboard.openstack.org/#!/story/2003296
Change-Id: Ie444f1e0be1c9a5ff7fc8a968269b73f510685e3
Story: 2003296
Task: 24245
diff --git a/patrole_tempest_plugin/tests/unit/fixtures.py b/patrole_tempest_plugin/tests/unit/fixtures.py
index 4e3387e..1c47985 100644
--- a/patrole_tempest_plugin/tests/unit/fixtures.py
+++ b/patrole_tempest_plugin/tests/unit/fixtures.py
@@ -77,7 +77,9 @@
}
self.mock_test_obj = mock.Mock(
__name__='patrole_unit_test', spec=test.BaseTestCase,
- os_primary=mock.Mock(), **test_obj_kwargs)
+ os_primary=mock.Mock(),
+ get_auth_providers=mock.Mock(return_value=[mock.Mock()]),
+ **test_obj_kwargs)
# Mock out functionality that can't be used by unit tests. Mocking out
# time.sleep is a test optimization.