-
Notifications
You must be signed in to change notification settings - Fork 270
Add GDM Smartcard tests #8216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add GDM Smartcard tests #8216
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test contains multiple time.sleep() calls which can cause flakiness:
- Line 99:
time.sleep(1)between twoenroll_smartcardcalls.enroll_smartcardrestartsvirt_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)beforeclient.gdm.check_home_screen(). Thecheck_home_screenmethod 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.
15a30c4 to
0cef101
Compare
ikerexxe
left a comment
There was a problem hiding this 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 implementationenroll_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. |
No description provided.