Skip to content

[autobackport: sssd-2-13] Tests: Update LdapOperations to fail on bind immediately#8750

Merged
spoore1 merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr8740-to-sssd-2-13
Jun 8, 2026
Merged

[autobackport: sssd-2-13] Tests: Update LdapOperations to fail on bind immediately#8750
spoore1 merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr8740-to-sssd-2-13

Conversation

@sssd-bot

Copy link
Copy Markdown
Contributor

This is an automatic backport of PR#8740 Tests: Update LdapOperations to fail on bind immediately to branch sssd-2-13, created by @jakub-vavra-cz.

Please make sure this backport is correct.

Note

The commits were cherry-picked without conflicts.

You can push changes to this pull request

git remote add sssd-bot [email protected]:sssd-bot/sssd.git
git fetch sssd-bot refs/heads/SSSD-sssd-backport-pr8740-to-sssd-2-13
git checkout SSSD-sssd-backport-pr8740-to-sssd-2-13
git push sssd-bot SSSD-sssd-backport-pr8740-to-sssd-2-13 --force

Original commits
9df13ca - Tests: Update LdapOperations to fail on bind immediately

Backported commits

  • cfbb9d7 - Tests: Update LdapOperations to fail on bind immediately

Original Pull Request Body

Summary

  • fail fast in LdapOperations.__init__ when LDAP bind fails, raising LdapException instead of keeping a tuple in self.conn
  • initialize LDAP using self.uri so optional custom port values are honored
  • avoid later misleading runtime errors such as 'tuple' object has no attribute 'modify_s' and surface the real bind problem early

@sssd-bot
sssd-bot requested a review from spoore1 May 29, 2026 12:46

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the LDAP initialization to use the correct URI (including the port) and adds error handling for LDAP bind failures. The feedback suggests using a local variable to check the bind result instead of reassigning it directly to self.conn, which avoids redundant self-assignment and maintains type consistency.

Comment thread src/tests/multihost/sssd/testlib/common/utils.py

@spoore1 spoore1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. test failures unrelated as they are system tests and this change is for older multihost tests. Also tests are passing with this change:

tests/test_passkey.py::test_passkey__su_user (ldap) �[31mFAILED�[0m�[31m               [ 46%]�[0m
tests/test_passkey.py::test_passkey__su_user_with_failed_pin (ldap) �[31mFAILED�[0m�[31m [ 48%]�[0m
tests/test_passkey.py::test_passkey__su_user_with_incorrect_mapping (ldap) �[31mFAILED�[0m�[31m [ 51%]�[0m
tests/test_passkey.py::test_passkey__su_user_when_server_is_not_resolvable (ldap) �[31mFAILED�[0m�[31m [ 53%]�[0m
tests/test_passkey.py::test_passkey__su_user_when_offline (ldap) �[31mFAILED�[0m�[31m  [ 56%]�[0m
tests/test_passkey.py::test_passkey__lookup_user_from_cache (ldap) �[31mFAILED�[0m�[31m [ 58%]�[0m
tests/test_passkey.py::test_passkey__su_user_with_multiple_keys (ldap) �[31mFAILED�[0m�[31m [ 61%]�[0m
tests/test_passkey.py::test_passkey__su_user_same_key_for_other_users (ldap) �[31mFAILED�[0m�[31m [ 64%]�[0m
tests/test_passkey.py::test_passkey__check_passkey_mapping_token_as_ssh_key_only (ldap) �[31mFAILED�[0m�[31m [ 66%]�[0m
tests/test_passkey.py::test_passkey__su_user_when_add_with_ssh_key_and_mapping (ldap) �[31mFAILED�[0m�[31m [ 69%]�[0m
tests/test_passkey.py::test_passkey__su_fips_fido_key (ldap) �[31mFAILED�[0m�[31m      [ 71%]�[0m
tests/test_passkey.py::test_passkey__su_user (samba) �[32mPASSED�[0m�[31m              [ 74%]�[0m
tests/test_passkey.py::test_passkey__su_user_with_failed_pin (samba) �[32mPASSED�[0m�[31m [ 76%]�[0m

@spoore1 spoore1 added Accepted Tests no-backport This should go to target branch only. labels Jun 8, 2026
Co-authored-by: Cursor <[email protected]>
Reviewed-by: Scott Poore <[email protected]>
(cherry picked from commit 9df13ca)
@sssd-bot

sssd-bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

The pull request was accepted by @spoore1 with the following PR CI status:


🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-44-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 testing-farm:fedora-43-x86_64:upstream (success)
🟢 testing-farm:fedora-44-x86_64:centos-stream-10 (success)
🟢 testing-farm:fedora-44-x86_64:upstream (success)
🔴 testing-farm:fedora-rawhide-x86_64:upstream (failure)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@sssd-bot
sssd-bot force-pushed the SSSD-sssd-backport-pr8740-to-sssd-2-13 branch from cfbb9d7 to 12b40a7 Compare June 8, 2026 21:49
@spoore1
spoore1 merged commit e08f1bd into SSSD:sssd-2-13 Jun 8, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accepted no-backport This should go to target branch only. Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants