[autobackport: sssd-2-13] Tests: Update LdapOperations to fail on bind immediately#8750
Conversation
There was a problem hiding this comment.
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.
spoore1
left a comment
There was a problem hiding this comment.
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
Co-authored-by: Cursor <[email protected]> Reviewed-by: Scott Poore <[email protected]> (cherry picked from commit 9df13ca)
|
The pull request was accepted by @spoore1 with the following PR CI status: 🟢 rpm-build:centos-stream-10-x86_64:upstream (success) There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging. |
cfbb9d7 to
12b40a7
Compare
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
Original commits
9df13ca - Tests: Update LdapOperations to fail on bind immediately
Backported commits
Original Pull Request Body
Summary
LdapOperations.__init__when LDAP bind fails, raisingLdapExceptioninstead of keeping a tuple inself.connself.uriso optional custom port values are honored'tuple' object has no attribute 'modify_s'and surface the real bind problem early