tests: port ad_provider idmap.sh coverage to system tests - #8871
Conversation
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Port bash/client/ad_provider/idmap/idmap.sh into a new test_idmap.py. - test_idmap__ldap_provider_maps_consistently_across_restart - test_idmap__invalid_range_config_rejects_lookup - test_idmap__range_min_zero_allows_lookup - test_idmap__default_domain_sid_mismatch_still_maps - test_idmap__default_domain_sid_match_avoids_remap - test_idmap__invalid_default_domain_sid_rejected - test_idmap__autorid_compat_logs_default_sid_state - test_idmap__builtin_sid_debug_silenced Co-authored-by: Cursor <cursoragent@cursor.com> Model used: Sonnet 5
7a0ab5b to
d8f1f8f
Compare
| """ | ||
| client.sssd.start() | ||
|
|
||
| result = client.host.conn.run("id Administrator", raise_on_error=False) |
There was a problem hiding this comment.
Should this use client.tools.id("Administrator")
There was a problem hiding this comment.
Yes, you are absolutely right, I really didn't look at them too carefully. Still in shock at how well AI wrote these test cases.
|
|
||
| log = client.fs.read(client.sssd.logs.domain()) | ||
| assert "Could not add domain" in log, "'Could not add domain' not found in the domain log!" | ||
| assert "[junk][0] to ID map" in log, "'[junk][0] to ID map' not found in the domain log!" |
There was a problem hiding this comment.
This asserts a very specific log format including [junk][0]. If the log message format changes (e.g., spacing, order), this breaks.
There was a problem hiding this comment.
Like above, aside from those two things, are tests okay?
There was a problem hiding this comment.
AI-generated tests are impressively close to the originals. But the gaps are real,
Required changes:
- Missing id_provider = ldap code path coverage for 5 tests
- Missing idmapuser02 / idmapgroup02 with POSIX attributes coverage
Nice-to-haves (6):
- Missing SSH login check in test_idmap__default_domain_sid_match_avoids_remap
- Log clearing before id Administrator in test_idmap__builtin_sid_debug_silenced to avoid false positives from startup logs
- Missing domain SID verification in test_idmap__autorid_compat_logs_default_sid_state (default_sid_set_but_unrelated) — bash checks the real AD domain SID also appears in the log after user lookup
|
|
I took a closer look at these tests, and I really don't like them. It can also use the enhancements from SSSD/sssd-test-framework#264 so I'm moving this back to draft. |
Port bash/client/ad_provider/idmap/idmap.sh into a new test_idmap.py.
Co-authored-by: Cursor cursoragent@cursor.com
Model used: Sonnet 5