Skip to content

Commit

Permalink
Tests: Enabling proxy_fast_alias shows "ldb_modify failed: [Invalid a…
Browse files Browse the repository at this point in the history
…ttribute syntax]" for id lookups.

Enabling proxy_fast_alias shows "ldb_modify failed: [Invalid attribute syntax]" for id lookups.
  • Loading branch information
aborah-sudo committed Aug 11, 2023
1 parent 2f08f87 commit e312c70
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions src/tests/system/tests/test_proxy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""
Proxy Provider tests.
:requirement: Ldap Provider - nss-pam-ldapd
"""


from __future__ import annotations

import pytest
from sssd_test_framework.roles.client import Client
from sssd_test_framework.roles.ldap import LDAP
from sssd_test_framework.topology import KnownTopology


@pytest.mark.topology(KnownTopology.LDAP)
def test_example(client: Client, ldap: LDAP):
"""
:title: Enabling proxy_fast_alias shows "ldb_modify failed:
[Invalid attribute syntax]" for id lookups.
:setup:
1. Setup sssd for proxy provider. And enable proxy_fast_alias.
2. Enable proxy_fast_alias.
3. Setup nslcd services.
4. Add Ou and User.
:steps:
1. id lookup a user.
2. Check logs for "ldb_modify failed".
:expectedresults:
1. id look up should success.
2. Errors should not be seen on enabling proxy_fast_alias.
:customerscenario: True
"""
client.sssd.import_domain("test", ldap)
client.sssd.restart()
client.sssd.config["domain/test"] = {
"id_provider": "proxy",
"debug_level": "0xFFF0",
"proxy_lib_name": "ldap",
"proxy_pam_target": "sssdproxyldap",
"proxy_fast_alias": "true",
}
client.fs.write(
"/etc/pam.d/sssdproxyldap",
"""
auth required pam_ldap.so
account required pam_ldap.so
password required pam_ldap.so
session required pam_ldap.so
""",
)
client.fs.write(
"/etc/nslcd.conf",
f"uid nslcd\ngid ldap\nuri " f"ldap://{ldap.host.hostname}\nbase " f"{ldap.ldap.naming_context}\n",
dedent=False,
)
client.host.ssh.run("systemctl restart nslcd")
client.sssd.restart()
ou_users = ldap.ou("users").add()
user = ldap.user("user-1", basedn=ou_users).add(uid=10001, gid=10001, password="Secret123")
result = client.tools.id(user.name)
assert result.user.name == user.name
log = client.fs.read(client.sssd.logs.domain())
assert "ldb_modify failed: [Invalid attribute syntax]" not in log

0 comments on commit e312c70

Please sign in to comment.