tests: updating pysss_nss_idmap error with more detail#8840
Conversation
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com> Reviewed-by: Jakub Vávra <jvavra@redhat.com>
There was a problem hiding this comment.
Code Review
This pull request improves the robustness of the system tests in test_pysss_nss_idmap.py by adding descriptive assertion messages, ensuring client.sssd.config_apply() is actually called, and adding safety checks when retrieving user and group attributes. The feedback highlights a copy-paste error in an assertion message on line 389, where the error message is misleading for an expected empty dictionary result.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| output = run_pysss_nss_idmap(client, "getsidbyuid", group_id) | ||
| assert ast.literal_eval(output.stdout) == {} | ||
| assert ast.literal_eval(output.stdout) == {}, f"'{group.name}' has wrong SID {group_sid}!" |
There was a problem hiding this comment.
The assertion message here is misleading and appears to be a copy-paste error. Since the assertion expects an empty dictionary {} (verifying that no SID is found for a group ID when queried as a UID), the error message should indicate that a SID was unexpectedly found, rather than claiming the group has the 'wrong SID'.\n\nPlease update the message to be consistent with the one used in test_group_by_id (line 233-235).
assert (\n ast.literal_eval(output.stdout) == {}\n ), f"Unexpectedly found SID for group ID '{group_id}' when queried as UID: {output.stdout.strip()}!"|
sssd-2-11 branch isn't supported anymore. |
Reviewed-by: Alexey Tikhonov atikhono@redhat.com
Reviewed-by: Jakub Vávra jvavra@redhat.com
(cherry picked from commit 2ca8395)