← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1362344] [NEW] Tests for Trusts don't actually test the roles provided in the trust reference

 

Public bug reported:

The tests for Trusts leverage the test_v3.py module and are housed in
test_v3_auth.py. These tests use the new_trust_ref() provided in
test_v3.py to build new trust references [1]. The new_trust_ref method
is suppose to go through and build a list of role ids that can be used
in the request. In the trust, implementation, the controller expects
that you pass in roles by 'id' or by 'name' [2]. The trust['roles']
list/dict that is returned from new_trust_ref isn't actually tested here
since the new_trust_ref() method doesn't build the list of roles with
'name': <name of role> or 'id': <id of role> expectations that the
implementation expects [3].

I discovered this by removing the new_ref() call in new_trust_ref()
since a trust doesn't share any common attributes like 'name',
'description' and so on [4].

Once you remove the call to new_ref, and the del ref['id'] calls, the
test_v3_auth.py unit tests start failing because of this exception [4].


Here is an example of the test failures: http://paste.openstack.org/show/101240/


[1] https://github.com/openstack/keystone/blob/f4f0bdf092edf7ba6e74019f5524629fd2ad85ce/keystone/tests/test_v3.py#L340-L371
[2] https://github.com/openstack/keystone/blob/f4f0bdf092edf7ba6e74019f5524629fd2ad85ce/keystone/trust/controllers.py#L101-L118
[3] https://github.com/openstack/keystone/blob/f4f0bdf092edf7ba6e74019f5524629fd2ad85ce/keystone/trust/controllers.py#L105-L108
[4] https://github.com/openstack/keystone/blob/f4f0bdf092edf7ba6e74019f5524629fd2ad85ce/keystone/trust/controllers.py#L115-L117

** Affects: keystone
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1362344

Title:
  Tests for Trusts don't actually test the roles provided in the trust
  reference

Status in OpenStack Identity (Keystone):
  New

Bug description:
  The tests for Trusts leverage the test_v3.py module and are housed in
  test_v3_auth.py. These tests use the new_trust_ref() provided in
  test_v3.py to build new trust references [1]. The new_trust_ref method
  is suppose to go through and build a list of role ids that can be used
  in the request. In the trust, implementation, the controller expects
  that you pass in roles by 'id' or by 'name' [2]. The trust['roles']
  list/dict that is returned from new_trust_ref isn't actually tested
  here since the new_trust_ref() method doesn't build the list of roles
  with 'name': <name of role> or 'id': <id of role> expectations that
  the implementation expects [3].

  I discovered this by removing the new_ref() call in new_trust_ref()
  since a trust doesn't share any common attributes like 'name',
  'description' and so on [4].

  Once you remove the call to new_ref, and the del ref['id'] calls, the
  test_v3_auth.py unit tests start failing because of this exception
  [4].

  
  Here is an example of the test failures: http://paste.openstack.org/show/101240/


  [1] https://github.com/openstack/keystone/blob/f4f0bdf092edf7ba6e74019f5524629fd2ad85ce/keystone/tests/test_v3.py#L340-L371
  [2] https://github.com/openstack/keystone/blob/f4f0bdf092edf7ba6e74019f5524629fd2ad85ce/keystone/trust/controllers.py#L101-L118
  [3] https://github.com/openstack/keystone/blob/f4f0bdf092edf7ba6e74019f5524629fd2ad85ce/keystone/trust/controllers.py#L105-L108
  [4] https://github.com/openstack/keystone/blob/f4f0bdf092edf7ba6e74019f5524629fd2ad85ce/keystone/trust/controllers.py#L115-L117

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1362344/+subscriptions


Follow ups

References