Allow V2TestCase to be tested against fernet and uuid

This helps make our switch to fernet as the default token provider easier.

This is an effort to break https://review.openstack.org/#/c/258650 into
smaller, more reviewable pieces.

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

Change-Id: I67121265cf06eb11586c90c37c6439bcdb28acf0
Partial-Bug: 1561054
This commit is contained in:
Lance Bragstad 2016-07-21 21:42:25 +00:00
parent b77c5b789f
commit 0b600cedf6
1 changed files with 26 additions and 2 deletions

View File

@ -990,7 +990,7 @@ class RestfulTestCase(rest.RestfulTestCase):
self.role_admin['id'])
class V2TestCase(RestfulTestCase, CoreApiTests, LegacyV2UsernameTests):
class V2TestCase(object):
def config_overrides(self):
super(V2TestCase, self).config_overrides()
@ -1399,7 +1399,31 @@ class V2TestCase(RestfulTestCase, CoreApiTests, LegacyV2UsernameTests):
expected_status=http_client.OK)
class RevokeApiTestCase(V2TestCase):
class V2TestCaseUUID(V2TestCase, RestfulTestCase, CoreApiTests,
LegacyV2UsernameTests):
def config_overrides(self):
super(V2TestCaseUUID, self).config_overrides()
self.config_fixture.config(group='token', provider='uuid')
class V2TestCaseFernet(V2TestCase, RestfulTestCase, CoreApiTests,
LegacyV2UsernameTests):
def config_overrides(self):
super(V2TestCaseFernet, self).config_overrides()
self.config_fixture.config(group='token', provider='fernet')
self.useFixture(ksfixtures.KeyRepository(self.config_fixture))
def test_fetch_revocation_list_md5(self):
self.skipTest('Revocation lists do not support Fernet')
def test_fetch_revocation_list_sha256(self):
self.skipTest('Revocation lists do not support Fernet')
class RevokeApiTestCase(V2TestCase, RestfulTestCase, CoreApiTests,
LegacyV2UsernameTests):
def config_overrides(self):
super(RevokeApiTestCase, self).config_overrides()
self.config_fixture.config(