Keystone admin v3 list user and group tests fail when using domain-specific identity drivers

Bug #1614758 reported by Adam Wayne on 2016-08-18
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
tempest
Medium
Xiao Gong

Bug Description

The tests for list users and groups in the Keystone v3 admin tests fail when Keystone is configured to use domain-specific identity drivers. The list controller methods use V3Controller._get_domain_id_for_list_request. It will first look at the current request's querystring, or revert to the current token_ref's domain. If a scoped token is not used, the method will throw an Unauthorized error.

  Traceback (most recent call last):
    File "tempest/api/identity/admin/v3/test_groups.py", line 165, in test_list_groups
      body = self.groups_client.list_groups()['groups']
    File "tempest/services/identity/v3/json/groups_client.py", line 57, in list_groups
      resp, body = self.get(url)
    File "tempest/lib/common/rest_client.py", line 288, in get
      return self.request('GET', url, extra_headers, headers)
    File "tempest/lib/common/rest_client.py", line 667, in request
      resp, resp_body)
    File "tempest/lib/common/rest_client.py", line 755, in _error_checker
      raise exceptions.Unauthorized(resp_body, resp=resp)
  tempest.lib.exceptions.Unauthorized: Unauthorized
  Details: {u'message': u'The request you have made requires authentication. (Disable debug mode to suppress these details.)', u'code': 401, u'title': u'Unauthorized'}

The admin tests create a new domain and, since the admin tests do not provide a domain_id query value, it will use the token_ref's domain which will not return the users created during the test in the new domain.

  Traceback (most recent call last):
    File "tempest/api/identity/admin/v3/test_groups.py", line 169, in test_list_groups
      self.assertEqual([], missing_groups)
    File "/home/stack/.rally/tempest/for-deployment-add322d1-6dd5-494a-9190-e9a32c75e79f/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 411, in assertEqual
      self.assertThat(observed, matcher, message)
    File "/home/stack/.rally/tempest/for-deployment-add322d1-6dd5-494a-9190-e9a32c75e79f/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
      raise mismatch_error
  testtools.matchers._impl.MismatchError: !=:
  reference = []
  actual = [u'481a4e838bc04a32a51c35bb5cf99617',
   u'0874131fb1054c39a135ac10f8b9b83d',
   u'f9e1c64f17e840c895bc892deec56ef0']

This issue is not present without domain-specific drivers because _get_domain_id_for_list_request has a short circuit when they are disabled.

  if not CONF.identity.domain_specific_drivers_enabled:
    # We don't need to specify a domain ID in this case
    return

Adam Wayne (awayne-5) on 2016-08-18
Changed in tempest:
assignee: nobody → Adam Wayne (awayne-5)
status: New → In Progress
Changed in tempest:
importance: Undecided → Medium

Fix proposed to branch: master
Review: https://review.openstack.org/456793

Changed in tempest:
assignee: Adam Wayne (awayne-5) → Xiao Gong (gongxiao)
Ken'ichi Ohmichi (oomichi) wrote :

https://review.openstack.org/#/c/456793/ has been already merged, so we can close this bug now.

Changed in tempest:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers