[freeipa PR#2756][opened] Add test case for configure_openldap_conf
by tiran
URL: https://github.com/freeipa/freeipa/pull/2756
Author: tiran
Title: #2756: Add test case for configure_openldap_conf
Action: opened
PR body:
"""
New test case is failing with:
```
======================================================================= test session starts ========================================================================
platform linux -- Python 3.7.2, pytest-3.6.4, py-1.5.4, pluggy-0.6.0 -- /usr/bin/python3
cachedir: ipatests/.pytest_cache
rootdir: /home/heimes/redhat/freeipa/ipatests, inifile:
plugins: sourceorder-0.5, multihost-3.0
collected 1 item
ipatests/test_ipaclient/test_ldapconf.py::test_configure_openldap_conf FAILED [100%]
============================================================================= FAILURES =============================================================================
___________________________________________________________________ test_configure_openldap_conf ___________________________________________________________________
def test_configure_openldap_conf():
text, settings = ldap_conf("")
assert '# File modified by ipa-client-install' in text
assert settings == {
'BASE': ['cn=ipa,cn=example'],
'URI': ['ldaps://ldap.ipa.example'],
'TLS_CACERT': ['/etc/ipa/ca.crt'],
'SASL_MECH': ['GSSAPI']
}
text, settings = ldap_conf(LDAP_CONF)
assert '# File modified by ipa-client-install' in text
> assert settings == {
'BASE': ['dc=example,dc=com'],
'URI': ['ldaps://ldap.ipa.example'],
'SASL_NOCANON': ['on'],
'TLS_CACERT': ['/etc/ipa/ca.crt'],
'SASL_MECH': ['GSSAPI']
}
E AssertionError: assert {'BASE': ['dc...ca.crt'], ...} == {'BASE': ['dc=...ca.crt'], ...}
E Omitting 4 identical items, use -vv to show
E Differing items:
E {'URI': ['ldap://ldap.example.com ldap://ldap-master.example.com:666', 'ldaps://ldap.ipa.example']} != {'URI': ['ldaps://ldap.ipa.example']}
E Full diff:
E {'BASE': ['dc=example,dc=com'],
E 'SASL_MECH': ['GSSAPI'],
E 'SASL_NOCANON': ['on'],...
E
E ...Full output truncated (7 lines hidden), use '-vv' to show
ipatests/test_ipaclient/test_ldapconf.py:67: AssertionError
```
"""
To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2756/head:pr2756
git checkout pr2756
5 years