Skip to content

Conversation

@danlavu
Copy link

@danlavu danlavu commented Nov 22, 2025

No description provided.

Copy link

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

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 adds a new system test for subid configuration in IPA. My review focuses on the new test case, where I've found several copy-paste errors in the assertions that would cause the test to fail or report incorrect information. I've provided suggestions to fix the incorrect function calls and assertion messages.

@danlavu danlavu force-pushed the tests-subid branch 2 times, most recently from d731c99 to 64194c5 Compare November 22, 2025 06:54
@danlavu
Copy link
Author

danlavu commented Nov 22, 2025

This requires two other PRs.

Copy link
Contributor

@jakub-vavra-cz jakub-vavra-cz left a comment

Choose a reason for hiding this comment

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

LGTM

), f"Subordinate UID start range {uid.range_start} does not match: {subid.uid_start}!"
assert (
subid.uid_size == uid.range_size
), f"Subordinate UID start range {uid.range_size} does not match: {subid.uid_size}!"
Copy link
Member

Choose a reason for hiding this comment

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

Copy-paste error.

Copy link
Author

Choose a reason for hiding this comment

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

It's correct, but I think it's from the confusing variable names and attributes.

subid from ipa has four attributes

  • subid.uid_size
  • subid.uid_range
  • subid.gid_size
  • subid.gid_range

tools.getsubids, returns two

  • range_size
  • range_start

subid.uid_size == object.range_size
subid.uid_start == object.range_start

subid.gid_size == group_object.range_size
subid.gid_start == group_object.range_start

The variables have been changed, let me know if it's still confusing.

Copy link
Member

Choose a reason for hiding this comment

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

The text itself - "Subordinate UID start range" - was a copy&paste error.

Copy link
Member

Choose a reason for hiding this comment

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

Text says "UID start range" but prints "{uid.range_size}".

Copy link
Author

Choose a reason for hiding this comment

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

My mistake, fixed.

), f"Subordinate GID start range {gid.range_start} does not match: {subid.gid_start}!"
assert (
subid.gid_size == gid.range_size
), f"Subordinate GID start range {gid.range_size} does not match: {subid.gid_size}!"
Copy link
Member

Choose a reason for hiding this comment

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

Copy-paste error.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@danlavu danlavu force-pushed the tests-subid branch 2 times, most recently from d09a147 to 2724d2c Compare December 1, 2025 19:07
@alexey-tikhonov
Copy link
Member

@danlavu, mypy fails:

tests/test_ipa.py:671: error: Item "None" of "SubIDEntry | None" has no attribute "range_start"  [union-attr]
tests/test_ipa.py:673: error: Item "None" of "SubIDEntry | None" has no attribute "range_size"  [union-attr]
tests/test_ipa.py:674: error: Item "None" of "SubIDEntry | None" has no attribute "range_size"  [union-attr]
tests/test_ipa.py:679: error: Item "None" of "SubIDEntry | None" has no attribute "range_start"  [union-attr]
tests/test_ipa.py:680: error: Item "None" of "SubIDEntry | None" has no attribute "range_start"  [union-attr]
tests/test_ipa.py:682: error: Item "None" of "SubIDEntry | None" has no attribute "range_size"  [union-attr]
tests/test_ipa.py:683: error: Item "None" of "SubIDEntry | None" has no attribute "range_size"  [union-attr]
Found 8 errors in 1 file (checked 33 source files)

@alexey-tikhonov
Copy link
Member

Note:

tests/test_ipa.py::test_ipa__subids_configured (ipa) PASSED              [ 22%]

@alexey-tikhonov
Copy link
Member

@jakub-vavra-cz, are you fine with the latest version?

@alexey-tikhonov
Copy link
Member

I set 'Blocked' until patch "do not add this commit" removed.

@alexey-tikhonov
Copy link
Member

SSSD/sssd-test-framework#221 was merged.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants