-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Enabling proxy_fast_alias shows "ldb_modify failed: [Invalid a…
…ttribute syntax]" for id lookups. Enabling proxy_fast_alias shows "ldb_modify failed: [Invalid attribute syntax]" for id lookups.
- Loading branch information
1 parent
2f08f87
commit c3493dd
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()).splitlines() | ||
assert "ldb_modify failed: [Invalid attribute syntax]" not in str(log) |