← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1347262] [NEW] Ldap Live test failures

 

Public bug reported:

In keystone master, when live ldap test are executed against local
openldap instance, 7 tests are failing.

3 tests fail with following error.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mock.py", line 1201, in patched
    return func(*args, **keywargs)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/test_backend_ldap.py", line 1156, in test_chase_referrals_off
    user_api.get_connection(user=None, password=None)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 965, in get_connection
    conn.simple_bind_s(user, password)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 638, in simple_bind_s
    serverctrls, clientctrls)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/fakeldap.py", line 246, in simple_bind_s
    attrs = self.db[self.key(who)]
AttributeError: 'FakeLdap' object has no attribute 'db'

The tests which are failing with above error are

LiveLDAPIdentity.test_chase_referrals_off
LiveLDAPIdentity.test_chase_referrals_on
LiveLDAPIdentity.test_debug_level_set

Reason: In FakeLdap, the livetest creds are different from
backend_ldap.conf and does not match at
https://github.com/openstack/keystone/blob/master/keystone/tests/fakeldap.py#L242


1 test fails with following error

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mock.py", line 1201, in patched
    return func(*args, **keywargs)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/test_backend_ldap.py", line 1288, in test_user_mixed_case_attribute
    user['email'])
KeyError: 'email'

Test failed:
LiveLDAPIdentity.test_user_mixed_case_attribute

Reason: CONF.ldap.user_mail_attribute is different in live test. Its
mail and not email as in backend_ldap.conf so test code needs to be
changed to handle both scenarios.

2 tests fails with following error

Traceback (most recent call last):
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/test_backend_ldap.py", line 695, in test_user_id_comma
    user = self.identity_api.driver.create_user(user_id, user)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/backends/ldap.py", line 94, in create_user
    user_ref = self.user.create(user)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/backends/ldap.py", line 230, in create
    values = super(UserApi, self).create(values)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 1390, in create
    ref = super(EnabledEmuMixIn, self).create(values)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 1085, in create
    conn.add_s(self._id_to_dn(values['id']), attrs)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 656, in add_s
    return self.conn.add_s(dn_utf8, ldap_attrs_utf8)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 551, in add_s
    return self.conn.add_s(dn, modlist)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 194, in add_s
    return self.result(msgid,all=1,timeout=self.timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 422, in result
    res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 426, in result2
    res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 432, in result3
    ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 96, in _ldap_call
    result = func(*args,**kwargs)
UNDEFINED_TYPE: {'info': 'domain_id: AttributeDescription contains inappropriate characters', 'desc': 'Undefined attribute type'}

Test failed:
LiveLDAPIdentity.test_user_id_comma
LiveLDAPIdentity.test_user_id_comma_grants

Reason: Related test code creates user using driver instead of using identity api which filters domain_id from response.
Possible solution: Line 695 , 714, 749 in https://review.openstack.org/#/c/95300/19/keystone/tests/test_backend_ldap.py,cm


1 test fails with following error:

Traceback (most recent call last):
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/test_backend_ldap.py", line 1267, in test_user_extra_attribute_mapping_description_is_returned
    user = self.identity_api.create_user(user)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/notifications.py", line 75, in wrapper
    result = f(*args, **kwargs)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/core.py", line 182, in wrapper
    return f(self, *args, **kwargs)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/core.py", line 193, in wrapper
    return f(self, *args, **kwargs)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/core.py", line 528, in create_user
    ref = driver.create_user(user['id'], user)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/backends/ldap.py", line 94, in create_user
    user_ref = self.user.create(user)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/backends/ldap.py", line 230, in create
    values = super(UserApi, self).create(values)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 1390, in create
    ref = super(EnabledEmuMixIn, self).create(values)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 1085, in create
    conn.add_s(self._id_to_dn(values['id']), attrs)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 656, in add_s
    return self.conn.add_s(dn_utf8, ldap_attrs_utf8)
  File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 551, in add_s
    return self.conn.add_s(dn, modlist)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 194, in add_s
    return self.result(msgid,all=1,timeout=self.timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 422, in result
    res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 426, in result2
    res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 432, in result3
    ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 96, in _ldap_call
    result = func(*args,**kwargs)
TYPE_OR_VALUE_EXISTS: {'info': "attribute 'description' provided more than once", 'desc': 'Type or value exists'}

Test failed:
LiveLDAPIdentity.test_user_extra_attribute_mapping_description_is_returned

Reason: The issue is description attribute is sent twice in add_s call and the line which needs to be modified is
https://github.com/openstack/keystone/blob/master/keystone/common/ldap/core.py#L1073

Possible solution: Line 1350 in
https://review.openstack.org/#/c/95300/19/keystone/common/ldap/core.py,cm

** Affects: keystone
     Importance: Undecided
     Assignee: Arun Kant (arunkant-uws)
         Status: New

** Changed in: keystone
     Assignee: (unassigned) => Arun Kant (arunkant-uws)

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

Title:
  Ldap Live test failures

Status in OpenStack Identity (Keystone):
  New

Bug description:
  In keystone master, when live ldap test are executed against local
  openldap instance, 7 tests are failing.

  3 tests fail with following error.

  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/mock.py", line 1201, in patched
      return func(*args, **keywargs)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/test_backend_ldap.py", line 1156, in test_chase_referrals_off
      user_api.get_connection(user=None, password=None)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 965, in get_connection
      conn.simple_bind_s(user, password)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 638, in simple_bind_s
      serverctrls, clientctrls)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/fakeldap.py", line 246, in simple_bind_s
      attrs = self.db[self.key(who)]
  AttributeError: 'FakeLdap' object has no attribute 'db'

  The tests which are failing with above error are

  LiveLDAPIdentity.test_chase_referrals_off
  LiveLDAPIdentity.test_chase_referrals_on
  LiveLDAPIdentity.test_debug_level_set

  Reason: In FakeLdap, the livetest creds are different from
  backend_ldap.conf and does not match at
  https://github.com/openstack/keystone/blob/master/keystone/tests/fakeldap.py#L242

  
  1 test fails with following error

  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/mock.py", line 1201, in patched
      return func(*args, **keywargs)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/test_backend_ldap.py", line 1288, in test_user_mixed_case_attribute
      user['email'])
  KeyError: 'email'

  Test failed:
  LiveLDAPIdentity.test_user_mixed_case_attribute

  Reason: CONF.ldap.user_mail_attribute is different in live test. Its
  mail and not email as in backend_ldap.conf so test code needs to be
  changed to handle both scenarios.

  2 tests fails with following error

  Traceback (most recent call last):
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/test_backend_ldap.py", line 695, in test_user_id_comma
      user = self.identity_api.driver.create_user(user_id, user)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/backends/ldap.py", line 94, in create_user
      user_ref = self.user.create(user)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/backends/ldap.py", line 230, in create
      values = super(UserApi, self).create(values)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 1390, in create
      ref = super(EnabledEmuMixIn, self).create(values)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 1085, in create
      conn.add_s(self._id_to_dn(values['id']), attrs)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 656, in add_s
      return self.conn.add_s(dn_utf8, ldap_attrs_utf8)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 551, in add_s
      return self.conn.add_s(dn, modlist)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 194, in add_s
      return self.result(msgid,all=1,timeout=self.timeout)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 422, in result
      res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 426, in result2
      res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 432, in result3
      ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 96, in _ldap_call
      result = func(*args,**kwargs)
  UNDEFINED_TYPE: {'info': 'domain_id: AttributeDescription contains inappropriate characters', 'desc': 'Undefined attribute type'}

  Test failed:
  LiveLDAPIdentity.test_user_id_comma
  LiveLDAPIdentity.test_user_id_comma_grants

  Reason: Related test code creates user using driver instead of using identity api which filters domain_id from response.
  Possible solution: Line 695 , 714, 749 in https://review.openstack.org/#/c/95300/19/keystone/tests/test_backend_ldap.py,cm

  
  1 test fails with following error:

  Traceback (most recent call last):
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/tests/test_backend_ldap.py", line 1267, in test_user_extra_attribute_mapping_description_is_returned
      user = self.identity_api.create_user(user)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/notifications.py", line 75, in wrapper
      result = f(*args, **kwargs)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/core.py", line 182, in wrapper
      return f(self, *args, **kwargs)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/core.py", line 193, in wrapper
      return f(self, *args, **kwargs)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/core.py", line 528, in create_user
      ref = driver.create_user(user['id'], user)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/backends/ldap.py", line 94, in create_user
      user_ref = self.user.create(user)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/identity/backends/ldap.py", line 230, in create
      values = super(UserApi, self).create(values)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 1390, in create
      ref = super(EnabledEmuMixIn, self).create(values)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 1085, in create
      conn.add_s(self._id_to_dn(values['id']), attrs)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 656, in add_s
      return self.conn.add_s(dn_utf8, ldap_attrs_utf8)
    File "/home/arunkant-uws/myFolder/myWork/openstack/keystone/keystone/common/ldap/core.py", line 551, in add_s
      return self.conn.add_s(dn, modlist)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 194, in add_s
      return self.result(msgid,all=1,timeout=self.timeout)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 422, in result
      res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 426, in result2
      res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 432, in result3
      ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout)
    File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 96, in _ldap_call
      result = func(*args,**kwargs)
  TYPE_OR_VALUE_EXISTS: {'info': "attribute 'description' provided more than once", 'desc': 'Type or value exists'}

  Test failed:
  LiveLDAPIdentity.test_user_extra_attribute_mapping_description_is_returned

  Reason: The issue is description attribute is sent twice in add_s call and the line which needs to be modified is
  https://github.com/openstack/keystone/blob/master/keystone/common/ldap/core.py#L1073

  Possible solution: Line 1350 in
  https://review.openstack.org/#/c/95300/19/keystone/common/ldap/core.py,cm

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


Follow ups

References