DONOTMERGE: Temporary commit for testing - #8980
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new system test for Active Directory smartcard authentication (test_smartcard_ad.py) and updates the test framework requirements. Feedback on the changes includes reverting the dependency on a personal fork in requirements.txt back to the official upstream repository, removing unused imports and commented-out code blocks in the new test file, and optimizing the user lookup polling loop to avoid an unnecessary initial sleep delay.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| #git+https://github.com/SSSD/sssd-test-framework | ||
| git+https://github.com/spoore1/sssd-test-framework@adcs_smartcard_setup_v2 |
There was a problem hiding this comment.
The requirements file has been modified to point to a personal fork and branch (spoore1/sssd-test-framework@adcs_smartcard_setup_v2) instead of the official upstream repository. This must be reverted to the official SSSD repository before merging to ensure stability and avoid supply chain risks.
git+https://github.com/SSSD/sssd-test-framework
| from sssd_test_framework.roles.generic import GenericADProvider | ||
| from sssd_test_framework.topology import KnownTopology, KnownTopologyGroup |
There was a problem hiding this comment.
The imports GenericADProvider and KnownTopologyGroup are not used anywhere in this test file. Removing unused imports keeps the codebase clean and adheres to PEP 8 guidelines.
| from sssd_test_framework.roles.generic import GenericADProvider | |
| from sssd_test_framework.topology import KnownTopology, KnownTopologyGroup | |
| from sssd_test_framework.topology import KnownTopology |
|
|
||
| # client.host.conn.run("rm -f /etc/krb5.conf /etc/krb5.keytab", raise_on_error=False) | ||
| # client.host.conn.run( | ||
| # f"realm join {ad.domain}", | ||
| # input=ad.host.adminpw, | ||
| # raise_on_error=False, | ||
| # ) | ||
|
|
There was a problem hiding this comment.
This block of commented-out code should be removed to keep the test suite clean and maintainable.
| # client.host.conn.run("rm -f /etc/krb5.conf /etc/krb5.keytab", raise_on_error=False) | |
| # client.host.conn.run( | |
| # f"realm join {ad.domain}", | |
| # input=ad.host.adminpw, | |
| # raise_on_error=False, | |
| # ) | |
| # | ||
| # client.host.conn.run( | ||
| # r"sed -i 's/\[default=2 ignore=ignore success=ok\]\s*pam_localuser.so/" | ||
| # r"[default=ignore ignore=ignore success=ok] pam_localuser.so/' " | ||
| # r"/etc/pam.d/system-auth", | ||
| # ) | ||
| # | ||
| # client.sssd.config_load() |
There was a problem hiding this comment.
This block of commented-out code should be removed to keep the test suite clean and maintainable.
| # | |
| # client.host.conn.run( | |
| # r"sed -i 's/\[default=2 ignore=ignore success=ok\]\s*pam_localuser.so/" | |
| # r"[default=ignore ignore=ignore success=ok] pam_localuser.so/' " | |
| # r"/etc/pam.d/system-auth", | |
| # ) | |
| # | |
| # client.sssd.config_load() | |
| for _attempt in range(10): | ||
| time.sleep(3) | ||
| result = client.tools.getent.passwd(fqdn_user) | ||
| if result is not None: | ||
| break | ||
| if _attempt == 2: | ||
| client.host.conn.run("sss_cache -E", raise_on_error=False) |
There was a problem hiding this comment.
The loop always sleeps for 3 seconds on the very first iteration before checking if the user is available. Checking the passwd database first before sleeping avoids an unnecessary 3-second delay in the happy path, improving test suite efficiency.
| for _attempt in range(10): | |
| time.sleep(3) | |
| result = client.tools.getent.passwd(fqdn_user) | |
| if result is not None: | |
| break | |
| if _attempt == 2: | |
| client.host.conn.run("sss_cache -E", raise_on_error=False) | |
| for _attempt in range(10): | |
| result = client.tools.getent.passwd(fqdn_user) | |
| if result is not None: | |
| break | |
| if _attempt == 2: | |
| client.host.conn.run("sss_cache -E", raise_on_error=False) | |
| time.sleep(3) |
| import pytest | ||
| from sssd_test_framework.roles.ad import AD | ||
| from sssd_test_framework.roles.client import Client | ||
| from sssd_test_framework.roles.generic import GenericADProvider |
| from sssd_test_framework.roles.ad import AD | ||
| from sssd_test_framework.roles.client import Client | ||
| from sssd_test_framework.roles.generic import GenericADProvider | ||
| from sssd_test_framework.topology import KnownTopology, KnownTopologyGroup |
| username = "adcertuser1" | ||
| try: | ||
| ad.user(username).delete() | ||
| except Exception: |
| # if "config_file_version" in client.sssd.sssd: | ||
| # del client.sssd.sssd["config_file_version"] |
No description provided.