fix(tests): make user_groups integration tests distro-aware#6889
Open
mmummigatti wants to merge 2 commits into
Open
fix(tests): make user_groups integration tests distro-aware#6889mmummigatti wants to merge 2 commits into
mmummigatti wants to merge 2 commits into
Conversation
The integration tests for users_groups module had Ubuntu-specific warning expectations that caused failures on RHEL-family systems. Password unlock warning behavior differs across distros. The tests were assuming Ubuntu warning behavior universally, causing failures on RHEL even though the underlying functionality was working correctly. Changes: - Add skipif decorators for Ubuntu-specific warning tests - Make warning validation conditional on IS_UBUNTU - Handle non-Ubuntu distros with appropriate error expectations - Remove unused JAMMY import This ensures tests pass on both Ubuntu and RHEL-family systems.
ani-sinha
suggested changes
May 20, 2026
Contributor
ani-sinha
left a comment
There was a problem hiding this comment.
Can you please check that tests pass with both RHEL and Ubuntu images?
| if IS_UBUNTU and CURRENT_RELEASE > NOBLE | ||
| else [] | ||
| ) | ||
|
|
| warnings = ( | ||
| [NEW_USER_EMPTY_PASSWD_WARNING.format(username="nopassworduser")] | ||
| if CURRENT_RELEASE > NOBLE | ||
| if IS_UBUNTU and CURRENT_RELEASE > NOBLE |
Contributor
There was a problem hiding this comment.
Seems this would not be needed since you are skipping the test for non-Ubuntu case anyway. Can you try and removing this and checking if it worked on Fedora/RHEL.
| class_client.execute("passwd -d foobar") | ||
| class_client.instance.clean() | ||
| class_client.restart() | ||
|
|
| ) | ||
|
|
||
|
|
||
| # @pytest.mark.user_data(USER_DATA) |
Contributor
There was a problem hiding this comment.
remove these commented code.
Address review feedback to remove commented pytest decorators that are no longer needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The integration tests for users_groups module had Ubuntu-specific
warning expectations that caused failures on RHEL-family systems.
Password unlock warning behavior differs across distros. The tests
were assuming Ubuntu warning behavior universally, causing failures
on RHEL even though the underlying functionality was working correctly.
Changes:
This ensures tests pass on both Ubuntu and RHEL-family systems.