-
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.
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. |
90b1f3f to
2a0ef6b
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.
As a general note, I'm missing the most basic smartcard test, where the user is able to login with the correct PIN. I'm telling you this because if test_gdm__smartcard_login_with_certs_and_passkey fails we don't know if it's because smartcard failed or it was passkey.
In addition, commit 3 (Tests: rename and update test_gdm to xidp) doesn't contain the changes specified in the commit message, they are totally unrelated. I don't know if you want to keep this commit, but if you do make sure to change the message or the content.
2a0ef6b to
a15f51c
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.
Some minor comments inline
a15f51c to
550c9d6
Compare
|
The code changes look good to me, but I will refrain from approving them until the framework changes are merged. By the way, is there any open PR for the framework changes? |
madhuriupadhye
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.
see inline
| :title: Login via GDM using smart card with PIN | ||
| :setup: | ||
| 1. Configure SSSD for gdm-switchable-auth and pam_cert_auth | ||
| 2. Start SSSD |
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.
Start SSSD must be with setup 1., Configure SSSD for gdm-switchable-auth and pam_cert_auth.
or do we need explicit start again?
same for all tests.
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.
No, it happens with step 1 in almost every case. I'll update the docstrings in both test modules.
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.
Ok, removed the start sssd steps since it's built into step 1.
| 5. Enroll smart card with domain for user | ||
| :steps: | ||
| 1. Select the user from the list. | ||
| 2. Select Smartcard authentication |
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 see two steps and expectedresults , 1 and 2 but are we not asserting those in test cases?
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.
Reworded the step/expectedresult to match others. Let me know if it makes more sense now or if you think I need to update the tests.
| enroll_smartcard(client, ipa, testuser, id="02", init=False) | ||
|
|
||
| # Set user_auth_type to passkey | ||
| ipa.user(testuser).modify(user_auth_type=["passkey", "pkinit"]) |
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.
why pkinit?
please add this in setup: also.
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 don't think it's actually needed (except to maybe enforce the kerberos side). I added a comment though to the setup for this though. I may drop this if I can resolve another issue I'm troubleshooting but, for now I added to setup.
550c9d6 to
1f6b438
Compare
1f6b438 to
74ee50a
Compare
@ikerexxe Here are the related PRs (including the framework one): |
74ee50a to
f90bf07
Compare
Renaming test_gdm.py to test_gdm_xidp.py to align with the other test_gdm_* test modules. Also adding authselect for with-switchable-auth which is needed to configure the system for GDM to use the new switchable authentication mechanisms.
point to upstream branch for testing
f90bf07 to
f8399a4
Compare
No description provided.