Skip to content

tests: updating pysss_nss_idmap error with more detail#8840

Closed
danlavu wants to merge 1 commit into
SSSD:sssd-2-11from
danlavu:tests-manual-cherry-pick-mypy
Closed

tests: updating pysss_nss_idmap error with more detail#8840
danlavu wants to merge 1 commit into
SSSD:sssd-2-11from
danlavu:tests-manual-cherry-pick-mypy

Conversation

@danlavu

@danlavu danlavu commented Jun 19, 2026

Copy link
Copy Markdown

Reviewed-by: Alexey Tikhonov atikhono@redhat.com
Reviewed-by: Jakub Vávra jvavra@redhat.com
(cherry picked from commit 2ca8395)

Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Jakub Vávra <jvavra@redhat.com>

@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 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}!"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

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()}!"

@alexey-tikhonov

Copy link
Copy Markdown
Member

sssd-2-11 branch isn't supported anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants