Don't run TokenCacheInvalidation with Fernet

Since the TokenCacheInvalidation tests are specific to token formats that
require persistent storage, it doesn't make sense to run them with Fernet
configured. This commit updated the classes the inherit TokenCacheInvalidation
to test all token formats except the Fernet format.

This fix was originally a part of https://review.openstack.org/#/c/258650 but
this is an attempt to break 258650 into smaller, more reviewable, pieces.

Co-Authored-By: Raildo Mascena <raildo@lsd.ufcg.edu.br>
Co-Authored-By: Adam Young <ayound@redhat.com>

Change-Id: Iaaf0f29fa1d55b0028729b69704167957a6c5f8c
Partial-Bug: 1561054
This commit is contained in:
Lance Bragstad 2016-07-18 21:22:49 +00:00
parent 12966b8851
commit e8cd48fa48
1 changed files with 41 additions and 2 deletions

View File

@ -813,11 +813,50 @@ class SqlImpliedRoles(SqlTests, assignment_tests.ImpliedRoleTests):
pass
class SqlTokenCacheInvalidation(SqlTests, token_tests.TokenCacheInvalidation):
class SqlTokenCacheInvalidationWithUUID(SqlTests,
token_tests.TokenCacheInvalidation):
def setUp(self):
super(SqlTokenCacheInvalidation, self).setUp()
super(SqlTokenCacheInvalidationWithUUID, self).setUp()
self._create_test_data()
def config_overrides(self):
super(SqlTokenCacheInvalidationWithUUID, self).config_overrides()
# NOTE(lbragstad): The TokenCacheInvalidation tests are coded to work
# against a persistent token backend. Only run these with token
# providers that issue persistent tokens.
self.config_fixture.config(group='token', provider='uuid')
class SqlTokenCacheInvalidationWithPKI(SqlTests,
token_tests.TokenCacheInvalidation):
def setUp(self):
super(SqlTokenCacheInvalidationWithPKI, self).setUp()
self._create_test_data()
def config_overrides(self):
super(SqlTokenCacheInvalidationWithPKI, self).config_overrides()
# NOTE(lbragstad): The TokenCacheInvalidation tests are coded to work
# against a persistent token backend. Only run these with token
# providers that issue persistent tokens.
self.config_fixture.config(group='token', provider='pki')
class SqlTokenCacheInvalidationWithPKIZ(SqlTests,
token_tests.TokenCacheInvalidation):
def setUp(self):
super(SqlTokenCacheInvalidationWithPKIZ, self).setUp()
self._create_test_data()
def config_overrides(self):
super(SqlTokenCacheInvalidationWithPKIZ, self).config_overrides()
# NOTE(lbragstad): The TokenCacheInvalidation tests are coded to work
# against a persistent token backend. Only run these with token
# providers that issue persistent tokens.
self.config_fixture.config(group='token', provider='pkiz')
# NOTE(lbragstad): The Fernet token provider doesn't persist tokens in a
# backend, so running the TokenCacheInvalidation tests here doesn't make sense.
class SqlFilterTests(SqlTests, identity_tests.FilterTests):