blob: bcc49aa5d14e6a5d8e2b7160de0d392242597ccb [file] [log] [blame]
Jay Pipesf38eaac2012-06-21 13:37:35 -04001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 OpenStack, LLC
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
Sean Dague1937d092013-05-17 16:36:38 -040018import testtools
19from testtools.matchers._basic import Contains
20
21from tempest.api.identity import base
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070022from tempest.common.utils.data_utils import rand_name
Matthew Treinisha83a16e2012-12-07 13:44:02 -050023from tempest import exceptions
Chris Yeoh01cb2792013-02-09 22:25:37 +103024from tempest.test import attr
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070025
26
Attila Fazekas0d0c6162013-02-24 09:14:23 +010027class UsersTestJSON(base.BaseIdentityAdminTest):
28 _interface = 'json'
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070029
30 alt_user = rand_name('test_user_')
31 alt_password = rand_name('pass_')
32 alt_email = alt_user + '@testmail.tm'
33 alt_tenant = rand_name('test_tenant_')
34 alt_description = rand_name('desc_')
35
Giulio Fidenteba3985a2013-05-29 01:46:36 +020036 @attr(type='smoke')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070037 def test_create_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050038 # Create a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070039 self.data.setup_test_tenant()
40 resp, user = self.client.create_user(self.alt_user, self.alt_password,
Zhongyue Luo79d8d362012-09-25 13:49:27 +080041 self.data.tenant['id'],
42 self.alt_email)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070043 self.data.users.append(user)
44 self.assertEqual('200', resp['status'])
45 self.assertEqual(self.alt_user, user['name'])
46
Giampaolo Lauriaea294952013-05-15 08:52:04 -040047 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070048 def test_create_user_by_unauthorized_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050049 # Non-admin should not be authorized to create a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070050 self.data.setup_test_tenant()
51 self.assertRaises(exceptions.Unauthorized,
52 self.non_admin_client.create_user, self.alt_user,
53 self.alt_password, self.data.tenant['id'],
54 self.alt_email)
55
Giampaolo Lauriaea294952013-05-15 08:52:04 -040056 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070057 def test_create_user_with_empty_name(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050058 # User with an empty name should not be created
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070059 self.data.setup_test_tenant()
60 self.assertRaises(exceptions.BadRequest, self.client.create_user, '',
61 self.alt_password, self.data.tenant['id'],
62 self.alt_email)
63
Giampaolo Lauriaea294952013-05-15 08:52:04 -040064 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070065 def test_create_user_with_name_length_over_64(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050066 # Length of user name filed should be restricted to 64 characters
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070067 self.data.setup_test_tenant()
68 self.assertRaises(exceptions.BadRequest, self.client.create_user,
Zhongyue Luo79d8d362012-09-25 13:49:27 +080069 'a' * 65, self.alt_password,
70 self.data.tenant['id'], self.alt_email)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070071
Giampaolo Lauriaea294952013-05-15 08:52:04 -040072 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070073 def test_create_user_with_duplicate_name(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050074 # Duplicate user should not be created
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070075 self.data.setup_test_user()
76 self.assertRaises(exceptions.Duplicate, self.client.create_user,
77 self.data.test_user, self.data.test_password,
78 self.data.tenant['id'], self.data.test_email)
79
Matthew Treinish770e5a42013-03-22 15:35:16 -040080 @testtools.skip("Until Bug #999084 is fixed")
Giampaolo Lauriae9c77022013-05-22 01:23:58 -040081 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070082 def test_create_user_with_empty_password(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050083 # User with an empty password should not be created
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070084 self.data.setup_test_tenant()
85 self.assertRaises(exceptions.BadRequest, self.client.create_user,
86 self.alt_user, '', self.data.tenant['id'],
87 self.alt_email)
88
Matthew Treinish770e5a42013-03-22 15:35:16 -040089 @testtools.skip("Until Bug #999084 is fixed")
Giampaolo Lauriae9c77022013-05-22 01:23:58 -040090 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070091 def test_create_user_with_long_password(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050092 # User having password exceeding max length should not be created
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070093 self.data.setup_test_tenant()
94 self.assertRaises(exceptions.BadRequest, self.client.create_user,
David Kranz28e35c52012-07-10 10:14:38 -040095 self.alt_user, 'a' * 65, self.data.tenant['id'],
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070096 self.alt_email)
97
Matthew Treinish770e5a42013-03-22 15:35:16 -040098 @testtools.skip("Until Bug #999084 is fixed")
Giampaolo Lauriae9c77022013-05-22 01:23:58 -040099 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700100 def test_create_user_with_invalid_email_format(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500101 # Email format should be validated while creating a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700102 self.data.setup_test_tenant()
103 self.assertRaises(exceptions.BadRequest, self.client.create_user,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800104 self.alt_user, '', self.data.tenant['id'], '12345')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700105
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400106 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700107 def test_create_user_for_non_existant_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500108 # Attempt to create a user in a non-existent tenant should fail
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700109 self.assertRaises(exceptions.NotFound, self.client.create_user,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800110 self.alt_user, self.alt_password, '49ffgg99999',
111 self.alt_email)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700112
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400113 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700114 def test_create_user_request_without_a_token(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500115 # Request to create a user without a valid token should fail
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700116 self.data.setup_test_tenant()
117 # Get the token of the current client
118 token = self.client.get_auth()
119 # Delete the token from database
120 self.client.delete_token(token)
121 self.assertRaises(exceptions.Unauthorized, self.client.create_user,
Zhongyue Luoe0884a32012-09-25 17:24:17 +0800122 self.alt_user, self.alt_password,
123 self.data.tenant['id'], self.alt_email)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700124
125 # Unset the token to allow further tests to generate a new token
126 self.client.clear_auth()
127
Giulio Fidenteba3985a2013-05-29 01:46:36 +0200128 @attr(type='smoke')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700129 def test_delete_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500130 # Delete a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700131 self.data.setup_test_tenant()
132 resp, user = self.client.create_user('user_1234', self.alt_password,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800133 self.data.tenant['id'],
134 self.alt_email)
Chris Yeoh7ed62072013-02-22 11:08:14 +1030135 self.assertEquals('200', resp['status'])
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700136 resp, body = self.client.delete_user(user['id'])
137 self.assertEquals('204', resp['status'])
138
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400139 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700140 def test_delete_users_by_unauthorized_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500141 # Non admin user should not be authorized to delete a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700142 self.data.setup_test_user()
143 self.assertRaises(exceptions.Unauthorized,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800144 self.non_admin_client.delete_user,
145 self.data.user['id'])
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700146
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400147 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700148 def test_delete_non_existant_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500149 # Attempt to delete a non-existent user should fail
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700150 self.assertRaises(exceptions.NotFound, self.client.delete_user,
151 'junk12345123')
152
Giulio Fidenteba3985a2013-05-29 01:46:36 +0200153 @attr(type='smoke')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700154 def test_user_authentication(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500155 # Valid user's token is authenticated
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700156 self.data.setup_test_user()
157 # Get a token
158 self.token_client.auth(self.data.test_user, self.data.test_password,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800159 self.data.test_tenant)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700160 # Re-auth
161 resp, body = self.token_client.auth(self.data.test_user,
162 self.data.test_password,
163 self.data.test_tenant)
164 self.assertEqual('200', resp['status'])
165
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400166 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700167 def test_authentication_for_disabled_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500168 # Disabled user's token should not get authenticated
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700169 self.data.setup_test_user()
170 self.disable_user(self.data.test_user)
171 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
172 self.data.test_user,
173 self.data.test_password,
174 self.data.test_tenant)
175
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400176 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700177 def test_authentication_when_tenant_is_disabled(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500178 # User's token for a disabled tenant should not be authenticated
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700179 self.data.setup_test_user()
180 self.disable_tenant(self.data.test_tenant)
181 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800182 self.data.test_user,
183 self.data.test_password,
184 self.data.test_tenant)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700185
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400186 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700187 def test_authentication_with_invalid_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500188 # User's token for an invalid tenant should not be authenticated
Giampaolo Lauria2a9653e2013-01-15 14:11:45 -0500189 self.data.setup_test_user()
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700190 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800191 self.data.test_user,
192 self.data.test_password,
193 'junktenant1234')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700194
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400195 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700196 def test_authentication_with_invalid_username(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500197 # Non-existent user's token should not get authenticated
ivan-zhufa2adf92013-01-13 00:18:25 +0800198 self.data.setup_test_user()
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700199 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800200 'junkuser123', self.data.test_password,
201 self.data.test_tenant)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700202
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400203 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700204 def test_authentication_with_invalid_password(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500205 # User's token with invalid password should not be authenticated
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700206 self.data.setup_test_user()
207 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
208 self.data.test_user, 'junkpass1234',
209 self.data.test_tenant)
210
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400211 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700212 def test_authentication_request_without_token(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500213 # Request for token authentication with a valid token in header
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700214 self.data.setup_test_user()
215 self.token_client.auth(self.data.test_user, self.data.test_password,
216 self.data.test_tenant)
217 # Get the token of the current client
218 token = self.client.get_auth()
219 # Delete the token from database
220 self.client.delete_token(token)
221 # Re-auth
222 resp, body = self.token_client.auth(self.data.test_user,
223 self.data.test_password,
224 self.data.test_tenant)
225 self.assertEqual('200', resp['status'])
226 self.client.clear_auth()
227
Giulio Fidenteba3985a2013-05-29 01:46:36 +0200228 @attr(type='smoke')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700229 def test_get_users(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500230 # Get a list of users and find the test user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700231 self.data.setup_test_user()
232 resp, users = self.client.get_users()
ivan-zhu1feeb382013-01-24 10:14:39 +0800233 self.assertThat([u['name'] for u in users],
234 Contains(self.data.test_user),
235 "Could not find %s" % self.data.test_user)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700236
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400237 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700238 def test_get_users_by_unauthorized_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500239 # Non admin user should not be authorized to get user list
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700240 self.data.setup_test_user()
241 self.assertRaises(exceptions.Unauthorized,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800242 self.non_admin_client.get_users)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700243
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400244 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700245 def test_get_users_request_without_token(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500246 # Request to get list of users without a valid token should fail
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700247 token = self.client.get_auth()
248 self.client.delete_token(token)
249 self.assertRaises(exceptions.Unauthorized, self.client.get_users)
250 self.client.clear_auth()
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530251
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400252 @attr(type='gate')
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530253 def test_list_users_for_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500254 # Return a list of all users for a tenant
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530255 self.data.setup_test_tenant()
256 user_ids = list()
257 fetched_user_ids = list()
258 resp, user1 = self.client.create_user('tenant_user1', 'password1',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800259 self.data.tenant['id'],
260 'user1@123')
Chris Yeoh7ed62072013-02-22 11:08:14 +1030261 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530262 user_ids.append(user1['id'])
263 self.data.users.append(user1)
264 resp, user2 = self.client.create_user('tenant_user2', 'password2',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800265 self.data.tenant['id'],
266 'user2@123')
Chris Yeoh7ed62072013-02-22 11:08:14 +1030267 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530268 user_ids.append(user2['id'])
269 self.data.users.append(user2)
270 #List of users for the respective tenant ID
271 resp, body = self.client.list_users_for_tenant(self.data.tenant['id'])
Chris Yeoh7ed62072013-02-22 11:08:14 +1030272 self.assertTrue(resp['status'] in ('200', '203'))
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530273 for i in body:
274 fetched_user_ids.append(i['id'])
275 #verifying the user Id in the list
276 missing_users =\
277 [user for user in user_ids if user not in fetched_user_ids]
278 self.assertEqual(0, len(missing_users),
Zhongyue Luoe0884a32012-09-25 17:24:17 +0800279 "Failed to find user %s in fetched list" %
280 ', '.join(m_user for m_user in missing_users))
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530281
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400282 @attr(type='gate')
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530283 def test_list_users_with_roles_for_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500284 # Return list of users on tenant when roles are assigned to users
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530285 self.data.setup_test_user()
286 self.data.setup_test_role()
287 user = self.get_user_by_name(self.data.test_user)
288 tenant = self.get_tenant_by_name(self.data.test_tenant)
289 role = self.get_role_by_name(self.data.test_role)
290 #Assigning roles to two users
291 user_ids = list()
292 fetched_user_ids = list()
293 user_ids.append(user['id'])
Chris Yeoh7ed62072013-02-22 11:08:14 +1030294 resp, role = self.client.assign_user_role(tenant['id'], user['id'],
295 role['id'])
296 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530297 resp, second_user = self.client.create_user('second_user', 'password1',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800298 self.data.tenant['id'],
299 'user1@123')
Chris Yeoh7ed62072013-02-22 11:08:14 +1030300 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530301 user_ids.append(second_user['id'])
302 self.data.users.append(second_user)
Chris Yeoh7ed62072013-02-22 11:08:14 +1030303 resp, role = self.client.assign_user_role(tenant['id'],
304 second_user['id'],
305 role['id'])
306 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530307 #List of users with roles for the respective tenant ID
308 resp, body = self.client.list_users_for_tenant(self.data.tenant['id'])
Chris Yeoh7ed62072013-02-22 11:08:14 +1030309 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530310 for i in body:
311 fetched_user_ids.append(i['id'])
312 #verifying the user Id in the list
Monty Taylorb2ca5ca2013-04-28 18:00:21 -0700313 missing_users = [missing_user for missing_user in user_ids
314 if missing_user not in fetched_user_ids]
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530315 self.assertEqual(0, len(missing_users),
Zhongyue Luoe0884a32012-09-25 17:24:17 +0800316 "Failed to find user %s in fetched list" %
317 ', '.join(m_user for m_user in missing_users))
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530318
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400319 @attr(type='gate')
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530320 def test_list_users_with_invalid_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500321 # Should not be able to return a list of all
322 # users for a nonexistant tenant
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530323 #Assign invalid tenant ids
324 invalid_id = list()
325 invalid_id.append(rand_name('999'))
326 invalid_id.append('alpha')
327 invalid_id.append(rand_name("dddd@#%%^$"))
328 invalid_id.append('!@#()$%^&*?<>{}[]')
329 #List the users with invalid tenant id
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530330 for invalid in invalid_id:
donald-ngoc17be892013-03-28 15:48:37 -0700331 self.assertRaises(exceptions.NotFound,
332 self.client.list_users_for_tenant, invalid)
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800333
334
Attila Fazekas0d0c6162013-02-24 09:14:23 +0100335class UsersTestXML(UsersTestJSON):
336 _interface = 'xml'