blob: e638a086e5c926f17355a4c5c320c684620fca4e [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
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070018from tempest.common.utils.data_utils import rand_name
Matthew Treinisha83a16e2012-12-07 13:44:02 -050019from tempest import exceptions
Chris Yeoh01cb2792013-02-09 22:25:37 +103020from tempest.test import attr
Vincent Hou6b8a7b72012-08-25 01:24:33 +080021from tempest.tests.identity import base
ivan-zhu1feeb382013-01-24 10:14:39 +080022import testtools
23from testtools.matchers._basic import Contains
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070024
25
Attila Fazekas0d0c6162013-02-24 09:14:23 +010026class UsersTestJSON(base.BaseIdentityAdminTest):
27 _interface = 'json'
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070028
29 alt_user = rand_name('test_user_')
30 alt_password = rand_name('pass_')
31 alt_email = alt_user + '@testmail.tm'
32 alt_tenant = rand_name('test_tenant_')
33 alt_description = rand_name('desc_')
34
Giampaolo Lauriaea294952013-05-15 08:52:04 -040035 @attr(type=['smoke', 'gate'])
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070036 def test_create_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050037 # Create a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070038 self.data.setup_test_tenant()
39 resp, user = self.client.create_user(self.alt_user, self.alt_password,
Zhongyue Luo79d8d362012-09-25 13:49:27 +080040 self.data.tenant['id'],
41 self.alt_email)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070042 self.data.users.append(user)
43 self.assertEqual('200', resp['status'])
44 self.assertEqual(self.alt_user, user['name'])
45
Giampaolo Lauriaea294952013-05-15 08:52:04 -040046 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070047 def test_create_user_by_unauthorized_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050048 # Non-admin should not be authorized to create a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070049 self.data.setup_test_tenant()
50 self.assertRaises(exceptions.Unauthorized,
51 self.non_admin_client.create_user, self.alt_user,
52 self.alt_password, self.data.tenant['id'],
53 self.alt_email)
54
Giampaolo Lauriaea294952013-05-15 08:52:04 -040055 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070056 def test_create_user_with_empty_name(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050057 # User with an empty name should not be created
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070058 self.data.setup_test_tenant()
59 self.assertRaises(exceptions.BadRequest, self.client.create_user, '',
60 self.alt_password, self.data.tenant['id'],
61 self.alt_email)
62
Giampaolo Lauriaea294952013-05-15 08:52:04 -040063 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070064 def test_create_user_with_name_length_over_64(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050065 # Length of user name filed should be restricted to 64 characters
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070066 self.data.setup_test_tenant()
67 self.assertRaises(exceptions.BadRequest, self.client.create_user,
Zhongyue Luo79d8d362012-09-25 13:49:27 +080068 'a' * 65, self.alt_password,
69 self.data.tenant['id'], self.alt_email)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070070
Giampaolo Lauriaea294952013-05-15 08:52:04 -040071 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070072 def test_create_user_with_duplicate_name(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050073 # Duplicate user should not be created
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070074 self.data.setup_test_user()
75 self.assertRaises(exceptions.Duplicate, self.client.create_user,
76 self.data.test_user, self.data.test_password,
77 self.data.tenant['id'], self.data.test_email)
78
Giampaolo Lauriaea294952013-05-15 08:52:04 -040079 @attr(type='gate')
Matthew Treinish770e5a42013-03-22 15:35:16 -040080 @testtools.skip("Until Bug #999084 is fixed")
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070081 def test_create_user_with_empty_password(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050082 # User with an empty password should not be created
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070083 self.data.setup_test_tenant()
84 self.assertRaises(exceptions.BadRequest, self.client.create_user,
85 self.alt_user, '', self.data.tenant['id'],
86 self.alt_email)
87
Giampaolo Lauriaea294952013-05-15 08:52:04 -040088 @attr(type='gate')
Matthew Treinish770e5a42013-03-22 15:35:16 -040089 @testtools.skip("Until Bug #999084 is fixed")
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070090 def test_create_user_with_long_password(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -050091 # User having password exceeding max length should not be created
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070092 self.data.setup_test_tenant()
93 self.assertRaises(exceptions.BadRequest, self.client.create_user,
David Kranz28e35c52012-07-10 10:14:38 -040094 self.alt_user, 'a' * 65, self.data.tenant['id'],
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070095 self.alt_email)
96
Giampaolo Lauriaea294952013-05-15 08:52:04 -040097 @attr(type='gate')
Matthew Treinish770e5a42013-03-22 15:35:16 -040098 @testtools.skip("Until Bug #999084 is fixed")
Rohit Karajgi6b1e1542012-05-14 05:55:54 -070099 def test_create_user_with_invalid_email_format(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500100 # Email format should be validated while creating a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700101 self.data.setup_test_tenant()
102 self.assertRaises(exceptions.BadRequest, self.client.create_user,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800103 self.alt_user, '', self.data.tenant['id'], '12345')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700104
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400105 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700106 def test_create_user_for_non_existant_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500107 # Attempt to create a user in a non-existent tenant should fail
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700108 self.assertRaises(exceptions.NotFound, self.client.create_user,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800109 self.alt_user, self.alt_password, '49ffgg99999',
110 self.alt_email)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700111
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400112 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700113 def test_create_user_request_without_a_token(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500114 # Request to create a user without a valid token should fail
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700115 self.data.setup_test_tenant()
116 # Get the token of the current client
117 token = self.client.get_auth()
118 # Delete the token from database
119 self.client.delete_token(token)
120 self.assertRaises(exceptions.Unauthorized, self.client.create_user,
Zhongyue Luoe0884a32012-09-25 17:24:17 +0800121 self.alt_user, self.alt_password,
122 self.data.tenant['id'], self.alt_email)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700123
124 # Unset the token to allow further tests to generate a new token
125 self.client.clear_auth()
126
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400127 @attr(type=['smoke', 'gate'])
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700128 def test_delete_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500129 # Delete a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700130 self.data.setup_test_tenant()
131 resp, user = self.client.create_user('user_1234', self.alt_password,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800132 self.data.tenant['id'],
133 self.alt_email)
Chris Yeoh7ed62072013-02-22 11:08:14 +1030134 self.assertEquals('200', resp['status'])
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700135 resp, body = self.client.delete_user(user['id'])
136 self.assertEquals('204', resp['status'])
137
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400138 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700139 def test_delete_users_by_unauthorized_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500140 # Non admin user should not be authorized to delete a user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700141 self.data.setup_test_user()
142 self.assertRaises(exceptions.Unauthorized,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800143 self.non_admin_client.delete_user,
144 self.data.user['id'])
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700145
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400146 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700147 def test_delete_non_existant_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500148 # Attempt to delete a non-existent user should fail
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700149 self.assertRaises(exceptions.NotFound, self.client.delete_user,
150 'junk12345123')
151
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400152 @attr(type=['smoke', 'gate'])
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700153 def test_user_authentication(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500154 # Valid user's token is authenticated
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700155 self.data.setup_test_user()
156 # Get a token
157 self.token_client.auth(self.data.test_user, self.data.test_password,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800158 self.data.test_tenant)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700159 # Re-auth
160 resp, body = self.token_client.auth(self.data.test_user,
161 self.data.test_password,
162 self.data.test_tenant)
163 self.assertEqual('200', resp['status'])
164
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400165 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700166 def test_authentication_for_disabled_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500167 # Disabled user's token should not get authenticated
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700168 self.data.setup_test_user()
169 self.disable_user(self.data.test_user)
170 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
171 self.data.test_user,
172 self.data.test_password,
173 self.data.test_tenant)
174
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400175 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700176 def test_authentication_when_tenant_is_disabled(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500177 # User's token for a disabled tenant should not be authenticated
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700178 self.data.setup_test_user()
179 self.disable_tenant(self.data.test_tenant)
180 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800181 self.data.test_user,
182 self.data.test_password,
183 self.data.test_tenant)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700184
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400185 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700186 def test_authentication_with_invalid_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500187 # User's token for an invalid tenant should not be authenticated
Giampaolo Lauria2a9653e2013-01-15 14:11:45 -0500188 self.data.setup_test_user()
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700189 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800190 self.data.test_user,
191 self.data.test_password,
192 'junktenant1234')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700193
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400194 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700195 def test_authentication_with_invalid_username(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500196 # Non-existent user's token should not get authenticated
ivan-zhufa2adf92013-01-13 00:18:25 +0800197 self.data.setup_test_user()
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700198 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800199 'junkuser123', self.data.test_password,
200 self.data.test_tenant)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700201
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400202 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700203 def test_authentication_with_invalid_password(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500204 # User's token with invalid password should not be authenticated
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700205 self.data.setup_test_user()
206 self.assertRaises(exceptions.Unauthorized, self.token_client.auth,
207 self.data.test_user, 'junkpass1234',
208 self.data.test_tenant)
209
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400210 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700211 def test_authentication_request_without_token(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500212 # Request for token authentication with a valid token in header
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700213 self.data.setup_test_user()
214 self.token_client.auth(self.data.test_user, self.data.test_password,
215 self.data.test_tenant)
216 # Get the token of the current client
217 token = self.client.get_auth()
218 # Delete the token from database
219 self.client.delete_token(token)
220 # Re-auth
221 resp, body = self.token_client.auth(self.data.test_user,
222 self.data.test_password,
223 self.data.test_tenant)
224 self.assertEqual('200', resp['status'])
225 self.client.clear_auth()
226
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400227 @attr(type=['smoke', 'gate'])
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700228 def test_get_users(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500229 # Get a list of users and find the test user
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700230 self.data.setup_test_user()
231 resp, users = self.client.get_users()
ivan-zhu1feeb382013-01-24 10:14:39 +0800232 self.assertThat([u['name'] for u in users],
233 Contains(self.data.test_user),
234 "Could not find %s" % self.data.test_user)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700235
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400236 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700237 def test_get_users_by_unauthorized_user(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500238 # Non admin user should not be authorized to get user list
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700239 self.data.setup_test_user()
240 self.assertRaises(exceptions.Unauthorized,
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800241 self.non_admin_client.get_users)
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700242
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400243 @attr(type='gate')
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700244 def test_get_users_request_without_token(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500245 # Request to get list of users without a valid token should fail
Rohit Karajgi6b1e1542012-05-14 05:55:54 -0700246 token = self.client.get_auth()
247 self.client.delete_token(token)
248 self.assertRaises(exceptions.Unauthorized, self.client.get_users)
249 self.client.clear_auth()
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530250
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400251 @attr(type='gate')
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530252 def test_list_users_for_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500253 # Return a list of all users for a tenant
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530254 self.data.setup_test_tenant()
255 user_ids = list()
256 fetched_user_ids = list()
257 resp, user1 = self.client.create_user('tenant_user1', 'password1',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800258 self.data.tenant['id'],
259 'user1@123')
Chris Yeoh7ed62072013-02-22 11:08:14 +1030260 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530261 user_ids.append(user1['id'])
262 self.data.users.append(user1)
263 resp, user2 = self.client.create_user('tenant_user2', 'password2',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800264 self.data.tenant['id'],
265 'user2@123')
Chris Yeoh7ed62072013-02-22 11:08:14 +1030266 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530267 user_ids.append(user2['id'])
268 self.data.users.append(user2)
269 #List of users for the respective tenant ID
270 resp, body = self.client.list_users_for_tenant(self.data.tenant['id'])
Chris Yeoh7ed62072013-02-22 11:08:14 +1030271 self.assertTrue(resp['status'] in ('200', '203'))
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530272 for i in body:
273 fetched_user_ids.append(i['id'])
274 #verifying the user Id in the list
275 missing_users =\
276 [user for user in user_ids if user not in fetched_user_ids]
277 self.assertEqual(0, len(missing_users),
Zhongyue Luoe0884a32012-09-25 17:24:17 +0800278 "Failed to find user %s in fetched list" %
279 ', '.join(m_user for m_user in missing_users))
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530280
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400281 @attr(type='gate')
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530282 def test_list_users_with_roles_for_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500283 # Return list of users on tenant when roles are assigned to users
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530284 self.data.setup_test_user()
285 self.data.setup_test_role()
286 user = self.get_user_by_name(self.data.test_user)
287 tenant = self.get_tenant_by_name(self.data.test_tenant)
288 role = self.get_role_by_name(self.data.test_role)
289 #Assigning roles to two users
290 user_ids = list()
291 fetched_user_ids = list()
292 user_ids.append(user['id'])
Chris Yeoh7ed62072013-02-22 11:08:14 +1030293 resp, role = self.client.assign_user_role(tenant['id'], user['id'],
294 role['id'])
295 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530296 resp, second_user = self.client.create_user('second_user', 'password1',
Zhongyue Luo79d8d362012-09-25 13:49:27 +0800297 self.data.tenant['id'],
298 'user1@123')
Chris Yeoh7ed62072013-02-22 11:08:14 +1030299 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530300 user_ids.append(second_user['id'])
301 self.data.users.append(second_user)
Chris Yeoh7ed62072013-02-22 11:08:14 +1030302 resp, role = self.client.assign_user_role(tenant['id'],
303 second_user['id'],
304 role['id'])
305 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530306 #List of users with roles for the respective tenant ID
307 resp, body = self.client.list_users_for_tenant(self.data.tenant['id'])
Chris Yeoh7ed62072013-02-22 11:08:14 +1030308 self.assertEquals('200', resp['status'])
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530309 for i in body:
310 fetched_user_ids.append(i['id'])
311 #verifying the user Id in the list
Monty Taylorb2ca5ca2013-04-28 18:00:21 -0700312 missing_users = [missing_user for missing_user in user_ids
313 if missing_user not in fetched_user_ids]
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530314 self.assertEqual(0, len(missing_users),
Zhongyue Luoe0884a32012-09-25 17:24:17 +0800315 "Failed to find user %s in fetched list" %
316 ', '.join(m_user for m_user in missing_users))
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530317
Giampaolo Lauriaea294952013-05-15 08:52:04 -0400318 @attr(type='gate')
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530319 def test_list_users_with_invalid_tenant(self):
Sean Dague46c4a2b2013-01-03 17:54:17 -0500320 # Should not be able to return a list of all
321 # users for a nonexistant tenant
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530322 #Assign invalid tenant ids
323 invalid_id = list()
324 invalid_id.append(rand_name('999'))
325 invalid_id.append('alpha')
326 invalid_id.append(rand_name("dddd@#%%^$"))
327 invalid_id.append('!@#()$%^&*?<>{}[]')
328 #List the users with invalid tenant id
rajalakshmi-ganesanefc8bd72012-05-30 17:52:11 +0530329 for invalid in invalid_id:
donald-ngoc17be892013-03-28 15:48:37 -0700330 self.assertRaises(exceptions.NotFound,
331 self.client.list_users_for_tenant, invalid)
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800332
333
Attila Fazekas0d0c6162013-02-24 09:14:23 +0100334class UsersTestXML(UsersTestJSON):
335 _interface = 'xml'