Skip to content

GDM topology and util fixes#236

Open
spoore1 wants to merge 1 commit intoSSSD:masterfrom
spoore1:gdm_and_topo_fixes_v2
Open

GDM topology and util fixes#236
spoore1 wants to merge 1 commit intoSSSD:masterfrom
spoore1:gdm_and_topo_fixes_v2

Conversation

@spoore1
Copy link
Contributor

@spoore1 spoore1 commented Mar 4, 2026

With additional changes for the Passwordless GDM tests, the changes allow for better integration with default MHC configs with out pre-provisioning environments.

GDM topology controller now joins IPA domain during setup.

Additional check in GDMTopologyController for gdm feature so that we skip topology_setup is gdm is not available on the client.

Consolidate realm join steps into a join_domain helper method in ProvisionedBackupTopologyController and call it from topology_setup in relevant topologies.

Check in join_domain if already joined and leave before attempting a join.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors and enhances the test framework's domain joining capabilities, particularly benefiting GDM-related test scenarios. By centralizing domain enrollment logic into a new helper method and integrating it across relevant topology controllers, the changes improve code reusability and robustness. Additionally, conditional execution of GDM topology setup and teardown based on client features, along with more resilient UI automation commands, contributes to a more flexible and reliable testing environment, especially for passwordless GDM tests.

Highlights

  • Centralized Domain Joining Logic: Introduced a reusable join_domain helper method to centralize domain enrollment logic within ProvisionedBackupTopologyController, including pre-checks for existing joins, cleanup of Kerberos configurations, and robust error handling for IPA domain joins.
  • Refactored Topology Controllers: Integrated the new join_domain method across various topology controllers (ClientTopologyController, ADTopologyController, TrustTopologyController, GDMTopologyController) to streamline and standardize domain joining procedures.
  • Conditional GDM Topology Execution: Enhanced GDMTopologyController with a check to conditionally skip topology_setup and topology_teardown if the GDM feature is not present on the client, improving test environment adaptability and preventing unnecessary operations.
  • Improved GDM Test Utility Robustness: Updated scauto utility commands in gdm.py to include verbose debugging, improved error handling with raise_on_error=False, and added a @retry decorator for UI interaction methods like click_on, making GDM tests more reliable.
  • GDM Topology Definition Update: Configured the GDM topology definition in topology.py to explicitly specify the IPA domain for testing purposes, ensuring correct domain association during setup.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • sssd_test_framework/topology.py
    • Added a 'domains' dictionary to the 'gdm' topology definition, mapping 'test' to 'sssd.ipa[0]'.
  • sssd_test_framework/topology_controllers.py
    • Imported the re module for regular expression operations.
    • Implemented a new join_domain helper method within ProvisionedBackupTopologyController to encapsulate domain joining logic, including removing existing Kerberos configs, checking for and leaving existing domains, backing up IPA client files, and handling IPA join failures with an uninstall/retry mechanism.
    • Refactored ClientTopologyController.topology_setup to utilize the new join_domain method for IPA domain enrollment.
    • Refactored ADTopologyController.topology_setup to utilize the new join_domain method for AD/Samba domain enrollment.
    • Refactored TrustTopologyController.topology_setup to utilize the new join_domain method for IPA domain enrollment.
    • Modified GDMTopologyController.topology_setup to first check for the 'gdm' feature on the client and skip setup if not found, then call join_domain to enroll the client into the IPA domain.
    • Modified GDMTopologyController.topology_teardown to accept a client argument and include a check for the 'gdm' feature, skipping teardown if not found.
  • sssd_test_framework/utils/gdm.py
    • Updated the scauto command initialization to include --verbose debug for more detailed logging.
    • Modified assert_text to pass raise_on_error=False to the exec command, preventing immediate exceptions on non-zero exit codes.
    • Modified click_on to include a @retry decorator for increased robustness, pass raise_on_error=False to exec, and explicitly raise an AssertionError if the click operation fails.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 introduces several valuable improvements, primarily focused on refactoring domain joining logic and enhancing the GDM test utilities. Consolidating the realm join steps into a join_domain helper method is a significant step forward for code maintainability. The changes to the GDM utilities, such as adding retry logic, should improve test stability. I have provided a couple of suggestions to further enhance the robustness and maintainability of the new code.

@spoore1 spoore1 force-pushed the gdm_and_topo_fixes_v2 branch 4 times, most recently from b2ddabf to 44a20cd Compare March 4, 2026 20:10
@alexey-tikhonov alexey-tikhonov requested a review from ikerexxe March 5, 2026 13:35
@alexey-tikhonov alexey-tikhonov requested a review from danlavu March 5, 2026 13:36
@jakub-vavra-cz jakub-vavra-cz self-requested a review March 5, 2026 13:42
@jakub-vavra-cz jakub-vavra-cz self-assigned this Mar 5, 2026
jakub-vavra-cz
jakub-vavra-cz previously approved these changes Mar 5, 2026
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.

danlavu
danlavu previously approved these changes Mar 6, 2026
Copy link
Contributor

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

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

Just some minor issues inline

Comment on lines +101 to +105
if isinstance(provider, (IPAHost)) and result.rc != 0:
self.logger.info(f"Running realm join for IPA failed with:\n{result.stdout}\n{result.stderr}")
self.logger.info("Trying uninstall and join again.")
client.conn.exec(["ipa-client-install", "--uninstall", "-U"])
client.conn.exec(["realm", "join", provider.domain], input=provider.adminpw)
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing login for other providers like ADHost and SambaHost

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure if the other provides had similar but, I do realize I left this wide open to silent failure. Is there something I should retry on other providers to uninstall in case the join fails? Or just raise an exception here for all other providers if the join fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Take a look at the update. I fixed it to attempt a realm leave --unattended before the join if not IPA.

With additional changes for the Passwordless GDM tests, the changes
allow for better integration with default MHC configs with out
pre-provisioning environments.

GDM topology controller now joins IPA domain during setup.

Additional check in GDMTopologyController for gdm feature so that we
skip topology_setup is gdm is not available on the client.

Consolidate realm join steps into a join_domain helper method in
ProvisionedBackupTopologyController and call it from topology_setup in
relevant topologies.

Check in join_domain if already joined and leave before attempting a
join.

Add realmd.conf to join_domain to prevent realm from clobbering
krb5.conf.  This is seen when joining AD domains.
@spoore1 spoore1 dismissed stale reviews from danlavu and jakub-vavra-cz via cc58cad March 6, 2026 14:41
@spoore1 spoore1 force-pushed the gdm_and_topo_fixes_v2 branch from 44a20cd to cc58cad Compare March 6, 2026 14:41
danlavu
danlavu previously approved these changes Mar 6, 2026
@danlavu danlavu dismissed their stale review March 6, 2026 22:04

foobar

@spoore1 spoore1 requested a review from danlavu March 7, 2026 15:18
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.

4 participants