From c3493dd6c697d7aae6831111f24b30ca22901cf6 Mon Sep 17 00:00:00 2001 From: aborah Date: Fri, 11 Aug 2023 10:09:40 +0530 Subject: [PATCH] Tests: Enabling proxy_fast_alias shows "ldb_modify failed: [Invalid attribute syntax]" for id lookups. Enabling proxy_fast_alias shows "ldb_modify failed: [Invalid attribute syntax]" for id lookups. --- src/tests/system/tests/test_proxy.py | 64 ++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/tests/system/tests/test_proxy.py diff --git a/src/tests/system/tests/test_proxy.py b/src/tests/system/tests/test_proxy.py new file mode 100644 index 00000000000..71e22d71c7e --- /dev/null +++ b/src/tests/system/tests/test_proxy.py @@ -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)