Some user role tests fail

Bug #1022990 reported by David Kranz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
New
Undecided
Unassigned

Bug Description

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 << ---------------------

Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) wrote :

Hi David,

 I used the information from "http://docs.rackspace.com/openstack-extensions/auth/OS-KSADM-admin-devguide/content/DELETE_deleteRoleFromUserOnTenant_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 a5d7d2a826f54ec881970251f53c4c2f --role-id e99fe38860154d09a0ade1ac031c9b0f --tenant-id 9f391448c51d4ac5bd12b937de085abdconnect: (15.184.83.251, 5000)031c9b0f --tenant-id 9f391448c51d4ac5bd12b937de085send: '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", "passwordCredentials": {"username": "admin", "password": "iforgot"}}}'
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/9f391448c51d4ac5bd12b937de085abd/users/a5d7d2a826f54ec881970251f53c4c2f/roles/OS-KSADM/e99fe38860154d09a0ade1ac031c9b0f HTTP/1.1\r\nHost: 15.184.83.251:35357\r\nContent-Length: 4\r\nx-auth-token: 1322d76081e3455c9d498a6b771998cb\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: 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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.