From 99fafca3ba6f3fb8d045e8c2b634762ed7bccaf7 Mon Sep 17 00:00:00 2001 From: Morgan Fainberg Date: Fri, 25 Oct 2013 15:05:52 -0700 Subject: Allow caching to be disabled and tests still pass Skip cache specific tests if caching is disabled. Cache should only be disabled to eliminate caching as an issue with tests, but in all cases tests should pass in either configuration. The default is to use caching for all tests. The caching options can be changed for testing purposes in the keystone/tests/test_overrides.conf file. The specific options and sections that support caching can be located in the configuration document in the section covering the caching layer. Change-Id: I7848128aeaf3f578b89ab0b9201c45e00efecf11 --- keystone/tests/test_backend.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'keystone/tests/test_backend.py') diff --git a/keystone/tests/test_backend.py b/keystone/tests/test_backend.py index b741b6871..89b5e88a6 100644 --- a/keystone/tests/test_backend.py +++ b/keystone/tests/test_backend.py @@ -2571,6 +2571,7 @@ class IdentityTests(object): user_projects = self.assignment_api.list_projects_for_user(user1['id']) self.assertEqual(len(user_projects), 3) + @tests.skip_if_cache_disabled('assignment') def test_cache_layer_domain_crud(self): domain = {'id': uuid.uuid4().hex, 'name': uuid.uuid4().hex, 'enabled': True} @@ -2617,6 +2618,7 @@ class IdentityTests(object): self.assignment_api.get_domain, domain_id) + @tests.skip_if_cache_disabled('assignment') def test_cache_layer_project_crud(self): domain = {'id': uuid.uuid4().hex, 'name': uuid.uuid4().hex, 'enabled': True} @@ -2669,6 +2671,7 @@ class IdentityTests(object): self.assignment_api.get_project, project_id) + @tests.skip_if_cache_disabled('assignment') def test_cache_layer_role_crud(self): role = {'id': uuid.uuid4().hex, 'name': uuid.uuid4().hex} role_id = role['id'] @@ -2996,6 +2999,7 @@ class TokenTests(object): self.assertEqual(len(tokens), 1) self.assertIn(token_id, tokens) + @tests.skip_if_cache_disabled('token') def test_revocation_list_cache(self): expire_time = timeutils.utcnow() + datetime.timedelta(minutes=10) token_id = uuid.uuid4().hex -- cgit v1.2.1