From 88b0a4bbd1353933614270b90477901a18d6ce7b Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Tue, 17 Jan 2012 21:48:31 -0800 Subject: [PATCH] more failing ec2 tests --- tests/test_keystoneclient.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/test_keystoneclient.py b/tests/test_keystoneclient.py index caab57efb5..217bb2a77c 100644 --- a/tests/test_keystoneclient.py +++ b/tests/test_keystoneclient.py @@ -263,13 +263,37 @@ class KcMasterTestCase(CompatTestCase): creds = client.ec2.list(self.user_foo['id']) self.assertEquals(creds, []) - def test_ec2_credentials_scoping(self): + def test_ec2_credentials_scoping_list(self): from keystoneclient import exceptions as client_exceptions boo = self.get_client('BOO') self.assertRaises(client_exceptions.Unauthorized, boo.ec2.list, self.user_foo['id']) + def test_ec2_credentials_scoping_get(self): + from keystoneclient import exceptions as client_exceptions + + foo = self.get_client() + cred = foo.ec2.create(self.user_foo['id'], self.tenant_bar['id']) + + boo = self.get_client('BOO') + self.assertRaises(client_exceptions.Unauthorized, boo.ec2.get, + self.user_foo['id'], cred.access) + + foo.ec2.delete(self.user_foo['id'], cred.access) + + def test_ec2_credentials_scoping_delete(self): + from keystoneclient import exceptions as client_exceptions + + foo = self.get_client() + cred = foo.ec2.create(self.user_foo['id'], self.tenant_bar['id']) + + boo = self.get_client('BOO') + self.assertRaises(client_exceptions.Unauthorized, boo.ec2.delete, + self.user_foo['id'], cred.access) + + foo.ec2.delete(self.user_foo['id'], cred.access) + def test_service_create_and_delete(self): from keystoneclient import exceptions as client_exceptions