Skip to content

Conversation

@spoore1
Copy link
Contributor

@spoore1 spoore1 commented Nov 20, 2025

No description provided.

@spoore1 spoore1 marked this pull request as draft November 20, 2025 23:24
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 new GDM smartcard tests. The changes include updating a test dependency and adding a new test file. My review has identified a critical issue with the dependency change, which points to a personal fork and should be reverted before merging. Additionally, I've found several uses of time.sleep() in the new tests, which can lead to test flakiness and should be replaced with more robust waiting mechanisms.

client.gdm.click_on("Smartcard")

client.gdm.kb_write(pin[:-1])
time.sleep(5)

Choose a reason for hiding this comment

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

high

Using time.sleep(5) here can make the test flaky. It's better to use an explicit wait for the 'Smartcard PIN' prompt to reappear. The client.gdm.assert_text() method might already have a timeout mechanism. If so, this sleep is redundant. If not, please use a more robust waiting strategy, like polling for the element with a timeout.

# Enroll smartcard with first key/cert issued from IPA
enroll_smartcard(client, ipa, testuser, id="01")

time.sleep(1)

Choose a reason for hiding this comment

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

high

This test contains multiple time.sleep() calls which can cause flakiness:

  • Line 99: time.sleep(1) between two enroll_smartcard calls. enroll_smartcard restarts virt_cacard.service. If a wait is necessary, it should be for the service to become active, not a fixed duration.
  • Lines 116 and 130: time.sleep(5) before client.gdm.check_home_screen(). The check_home_screen method should ideally handle waiting for the home screen to appear. Relying on a fixed sleep is unreliable.
    Please replace these with explicit waits provided by the test framework.

@spoore1 spoore1 requested a review from ikerexxe November 21, 2025 16:09
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.

I just took a first glance at this proposal and I'm missing several things:

  • Docstring with title, description and test steps is missing.
  • Tests only run in IPA environment. Should they also target other environments?
  • Related to the previous one, client_setup_for_smartcard() seems to be for all providers but as I mentioned before tests only cover IPA. In addition, with the current implementation enroll_smartcard() only works with IPA provider

@spoore1
Copy link
Contributor Author

spoore1 commented Dec 1, 2025

I just took a first glance at this proposal and I'm missing several things:

  • Docstring with title, description and test steps is missing.
  • Tests only run in IPA environment. Should they also target other environments?
  • Related to the previous one, client_setup_for_smartcard() seems to be for all providers but as I mentioned before tests only cover IPA. In addition, with the current implementation enroll_smartcard() only works with IPA provider

Currently, IPA is all that the test framework can support for smart card testing. We'll expand these when more options are supported in the framework. With that said, I'll review the helper functions closer to try to make them forward compatible if possible. As for the docstrings, I'll update asap.

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