summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDolph Mathews <dolph.mathews@gmail.com>2013-03-20 20:21:45 -0500
committerDolph Mathews <dolph.mathews@gmail.com>2013-03-20 23:42:16 -0500
commit601d993fb1ca16d2fedf721de5fdb70a6b55a0a8 (patch)
tree599c5d7c878968701eee6005cbb48534c5336e89 /tests
parentaa58233bd8ba174e07076444b0dc5fdb67f5a5e6 (diff)
downloadkeystone-601d993fb1ca16d2fedf721de5fdb70a6b55a0a8.tar.gz
keystone-601d993fb1ca16d2fedf721de5fdb70a6b55a0a8.tar.xz
keystone-601d993fb1ca16d2fedf721de5fdb70a6b55a0a8.zip
Allow trusts to be optional
Change-Id: I76ab6ddac70cccece46bc36d7592d840599c893b
Diffstat (limited to 'tests')
-rw-r--r--tests/test_auth.py1
-rw-r--r--tests/test_v3_auth.py18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_auth.py b/tests/test_auth.py
index bf43c4af..e8c919f4 100644
--- a/tests/test_auth.py
+++ b/tests/test_auth.py
@@ -501,6 +501,7 @@ class AuthWithRemoteUser(AuthTest):
class AuthWithTrust(AuthTest):
def setUp(self):
super(AuthWithTrust, self).setUp()
+ self.opt_in_group('trust', enabled=True)
trust.Manager()
self.trust_controller = trust.controllers.TrustV3()
diff --git a/tests/test_v3_auth.py b/tests/test_v3_auth.py
index e96bd966..993e3a5e 100644
--- a/tests/test_v3_auth.py
+++ b/tests/test_v3_auth.py
@@ -1009,8 +1009,26 @@ class TestAuthXML(TestAuthJSON):
content_type = 'xml'
+class TestTrustOptional(test_v3.RestfulTestCase):
+ def setUp(self, *args, **kwargs):
+ self.opt_in_group('trust', enabled=False)
+ super(TestTrustOptional, self).setUp(*args, **kwargs)
+
+ def test_trusts_404(self):
+ self.get('/trusts', body={'trust': {}}, expected_status=404)
+ self.post('/trusts', body={'trust': {}}, expected_status=404)
+
+ def test_auth_with_scope_in_trust_403(self):
+ auth_data = self.build_authentication_request(
+ user_id=self.user['id'],
+ password=self.user['password'],
+ trust_id=uuid.uuid4().hex)
+ self.post('/auth/tokens', body=auth_data, expected_status=403)
+
+
class TestTrustAuth(TestAuthInfo):
def setUp(self):
+ self.opt_in_group('trust', enabled=True)
super(TestTrustAuth, self).setUp(load_sample_data=True)
# create a trustee to delegate stuff to