Skip to content

fix(tests): make user_groups integration tests distro-aware#6889

Open
mmummigatti wants to merge 2 commits into
canonical:mainfrom
mmummigatti:rhel-fix-user-group
Open

fix(tests): make user_groups integration tests distro-aware#6889
mmummigatti wants to merge 2 commits into
canonical:mainfrom
mmummigatti:rhel-fix-user-group

Conversation

@mmummigatti
Copy link
Copy Markdown

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.

  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.
Copy link
Copy Markdown
Contributor

@ani-sinha ani-sinha left a comment

Choose a reason for hiding this comment

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

Can you please check that tests pass with both RHEL and Ubuntu images?

if IS_UBUNTU and CURRENT_RELEASE > NOBLE
else []
)

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.

whitespace.

warnings = (
[NEW_USER_EMPTY_PASSWD_WARNING.format(username="nopassworduser")]
if CURRENT_RELEASE > NOBLE
if IS_UBUNTU and CURRENT_RELEASE > NOBLE
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.

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()

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.

whitespace.

)


# @pytest.mark.user_data(USER_DATA)
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.

remove these commented code.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

okay will do that

Comment thread tests/integration_tests/modules/test_users_groups.py
  Address review feedback to remove commented pytest decorators
  that are no longer needed.
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