Skip to content

adding subid test#8225

Merged
danlavu merged 1 commit into
SSSD:masterfrom
danlavu:tests-subid
Dec 10, 2025
Merged

adding subid test#8225
danlavu merged 1 commit into
SSSD:masterfrom
danlavu:tests-subid

Conversation

@danlavu

@danlavu danlavu commented Nov 22, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@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 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.

Comment thread src/tests/system/tests/test_ipa.py Outdated
Comment thread src/tests/system/tests/test_ipa.py Outdated
Comment thread src/tests/system/tests/test_ipa.py Outdated
@danlavu
danlavu force-pushed the tests-subid branch 2 times, most recently from d731c99 to 64194c5 Compare November 22, 2025 06:54
@danlavu

danlavu commented Nov 22, 2025

Copy link
Copy Markdown
Contributor Author

This requires two other PRs.

@jakub-vavra-cz jakub-vavra-cz 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

Comment thread src/tests/system/tests/test_ipa.py Outdated
Comment thread src/tests/system/tests/test_ipa.py Outdated
Comment thread src/tests/system/tests/test_ipa.py Outdated
Comment thread src/tests/system/tests/test_ipa.py Outdated
), 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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My mistake, fixed.

Comment thread src/tests/system/tests/test_ipa.py Outdated
), 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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread src/tests/system/tests/test_ipa.py Outdated
@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
Copy Markdown
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
Copy Markdown
Member

Note:

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

@alexey-tikhonov

Copy link
Copy Markdown
Member

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

@alexey-tikhonov

Copy link
Copy Markdown
Member

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

@alexey-tikhonov

Copy link
Copy Markdown
Member

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

@danlavu
danlavu force-pushed the tests-subid branch 3 times, most recently from 2fe4b25 to 42995ba Compare December 9, 2025 19:04

@jakub-vavra-cz jakub-vavra-cz 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

@danlavu
danlavu merged commit 449913a into SSSD:master Dec 10, 2025
23 of 24 checks passed
@danlavu
danlavu deleted the tests-subid branch January 23, 2026 14:43
@danlavu
danlavu restored the tests-subid branch January 27, 2026 03:24
@danlavu
danlavu deleted the tests-subid branch July 1, 2026 15:29
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