Run AuthTokenTests against fernet and uuid

Previously, AuthTokenTests inherited the test structure and ran the tests with
the default keystone configuration. This commit breaks AuthTokenTests to
inherit from `object` and sets up FernetAuthTokenTests and UUIDAuthTokenTests
to setup configuration appropriately and run the tests.

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: I9acacfe7db4997add5505a9ee1972139af11979e
Partial-Bug: 1561054
This commit is contained in:
Lance Bragstad 2016-07-18 17:05:10 +00:00
parent 7646e2181b
commit 72e6196d54
1 changed files with 10 additions and 4 deletions

View File

@ -389,7 +389,7 @@ class AccessTokenCRUDTests(OAuthFlowTests):
self.assertValidListLinks(resp.result['links'])
class AuthTokenTests(OAuthFlowTests):
class AuthTokenTests(object):
def test_keystone_token_is_valid(self):
self.test_oauth_flow()
@ -611,7 +611,7 @@ class AuthTokenTests(OAuthFlowTests):
expected_status=http_client.FORBIDDEN)
class FernetAuthTokenTests(AuthTokenTests):
class FernetAuthTokenTests(AuthTokenTests, OAuthFlowTests):
def config_overrides(self):
super(FernetAuthTokenTests, self).config_overrides()
@ -619,8 +619,14 @@ class FernetAuthTokenTests(AuthTokenTests):
self.useFixture(ksfixtures.KeyRepository(self.config_fixture))
def test_delete_keystone_tokens_by_consumer_id(self):
# NOTE(lbragstad): Fernet tokens are never persisted in the backend.
pass
self.skipTest('Fernet tokens are never persisted in the backend.')
class UUIDAuthTokenTests(AuthTokenTests, OAuthFlowTests):
def config_overrides(self):
super(UUIDAuthTokenTests, self).config_overrides()
self.config_fixture.config(group='token', provider='uuid')
class MaliciousOAuth1Tests(OAuth1Tests):