I removed all the skips for fixed bugs from the keystone tests but the following two stil fail. I am not sure of the spec for these things and when I tried to do what I thought was a similar thing in keystone-client I got a different json sent than what tempest is doing. The keystone API docs manual is missing a lot.
======================================================================
ERROR: Attempt to delete a non existent role from a user should fail
----------------------------------------------------------------------
Traceback (most recent call last):
File "/cygdrive/c/source/tempest/tempest/tests/identity/admin/test_roles.py", line 202, in test_remove_user_role_non_existant_role
user['id'], 'junk-user-role-123')
File "/usr/lib/python2.6/site-packages/unittest2-0.5.1-py2.6.egg/unittest2/case.py", line 475, in assertRaises
callableObj(*args, **kwargs)
File "/cygdrive/c/source/tempest/tempest/services/identity/json/admin_client.py", line 80, in remove_user_role
resp, body = self.delete('users/%s/roleRefs/%s' % (user_id, role_id))
File "/cygdrive/c/source/tempest/tempest/common/rest_client.py", line 160, in delete
return self.request('DELETE', url)
File "/cygdrive/c/source/tempest/tempest/common/rest_client.py", line 229, in request
raise exceptions.IdentityError(message)
IdentityError: Got identity error
Details: Got identity error
Details: An unexpected error prevented the server from fulfilling your request. 'NoneType' object has no attribute '__getitem__'
-------------------- >> begin captured logging << --------------------
tempest.common.rest_client: ERROR: Request URL: http://172.18.0.146:35357/v2.0/users/90fe1a60a82944b6aef11e1cd84ecb33/roleRefs/junk-user-role-123
tempest.common.rest_client: ERROR: Request Body: None
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Tue, 10 Jul 2012 14:05:30 GMT', 'content-type': 'application/json', 'content-length': '192', 'status': '500', 'vary': 'X-Auth-Token'}
tempest.common.rest_client: ERROR: Response Body: {u'error': {u'message': u"An unexpected error prevented the server from fulfilling your request. 'NoneType' object has no attribute '__getitem__'", u'code': 500, u'title': u'Internal Server Error'}}
--------------------- >> end captured logging << ---------------------
======================================================================
ERROR: Attempt to remove a role from a non existent user should fail
----------------------------------------------------------------------
Traceback (most recent call last):
File "/cygdrive/c/source/tempest/tempest/tests/identity/admin/test_roles.py", line 194, in test_remove_user_role_non_existant_user
'junk-user-id-123', role['id'])
File "/usr/lib/python2.6/site-packages/unittest2-0.5.1-py2.6.egg/unittest2/case.py", line 475, in assertRaises
callableObj(*args, **kwargs)
File "/cygdrive/c/source/tempest/tempest/services/identity/json/admin_client.py", line 80, in remove_user_role
resp, body = self.delete('users/%s/roleRefs/%s' % (user_id, role_id))
File "/cygdrive/c/source/tempest/tempest/common/rest_client.py", line 160, in delete
return self.request('DELETE', url)
File "/cygdrive/c/source/tempest/tempest/common/rest_client.py", line 229, in request
raise exceptions.IdentityError(message)
IdentityError: Got identity error
Details: Got identity error
Details: An unexpected error prevented the server from fulfilling your request. 'NoneType' object has no attribute '__getitem__'
-------------------- >> begin captured logging << --------------------
tempest.common.rest_client: ERROR: Request URL: http://172.18.0.146:35357/v2.0/users/junk-user-id-123/roleRefs/88de4e0ddda04df5a430a981cffdd64b
tempest.common.rest_client: ERROR: Request Body: None
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Tue, 10 Jul 2012 14:05:30 GMT', 'content-type': 'application/json', 'content-length': '192', 'status': '500', 'vary': 'X-Auth-Token'}
tempest.common.rest_client: ERROR: Response Body: {u'error': {u'message': u"An unexpected error prevented the server from fulfilling your request. 'NoneType' object has no attribute '__getitem__'", u'code': 500, u'title': u'Internal Server Error'}}
--------------------- >> end captured logging << ---------------------
Hi David,
I used the information from "http:// docs.rackspace. com/openstack- extensions/ auth/OS- KSADM-admin- devguide/ content/ DELETE_ deleteRoleFromU serOnTenant_ v2.0_tenants_ _tenantId_ _users_ _userId_ _roles_ OS-KSADM_ _roleId_ _Admin_ API_Service_ Developer_ Operations- d1e1357. html" to write tests initially.
It is same as the URI's sent via keystone client...
rajalakshmi_ ganesan@ ubuntu: ~/tempest_ april1/ tempest/ tempest/ tests/identity/ admin$ keystone --debug user-role-add --user-id a5d7d2a826f54ec 881970251f53c4c 2f --role-id e99fe38860154d0 9a0ade1ac031c9b 0f --tenant-id 9f391448c51d4ac 5bd12b937de085a bdconnect: (15.184.83.251, 5000)031c9b0f --tenant-id 9f391448c51d4ac 5bd12b937de085s end: 'POST /v2.0/tokens HTTP/1.1\r\nHost: 15.184. 83.251: 5000\r\ nContent- Length: 102\r\ncontent- type: application/ json\r\ naccept- encoding: gzip, deflate\ r\nuser- agent: python- keystoneclient\ r\n\r\n{ "auth": {"tenantName": "admin", "passwordCreden tials": {"username": "admin", "password": "iforgot"}}}' 9f391448c51d4ac 5bd12b937de085a bd/users/ a5d7d2a826f54ec 881970251f53c4c 2f/roles/ OS-KSADM/ e99fe38860154d0 9a0ade1ac031c9b 0f HTTP/1.1\r\nHost: 15.184. 83.251: 35357\r\ nContent- Length: 4\r\nx-auth-token: 1322d76081e3455 c9d498a6b771998 cb\r\ncontent- type: application/ json\r\ naccept- encoding: gzip, deflate\ r\nuser- agent: python- keystoneclient\ r\n\r\nnull'
reply: 'HTTP/1.1 200 OK\r\n'
header: Vary: X-Auth-Token
header: Content-Type: application/json
header: Content-Length: 2562
header: Date: Wed, 01 Aug 2012 06:20:01 GMT
connect: (15.184.83.251, 35357)
send: u'PUT /v2.0/tenants/
reply: 'HTTP/1.1 200 OK\r\n'
header: Vary: X-Auth-Token
header: Content-Type: application/json
header: Content-Length: 75
header: Date: Wed, 01 Aug 2012 06:20:02 GMT
Hence planing to change the URI's in tempest...Raised a bug for this Bug #1031639