Skip to content

fixing dns server delete record in all roles#253

Merged
alexey-tikhonov merged 7 commits into
SSSD:masterfrom
danlavu:ipv6
Jul 17, 2026
Merged

fixing dns server delete record in all roles#253
alexey-tikhonov merged 7 commits into
SSSD:masterfrom
danlavu:ipv6

Conversation

@danlavu

@danlavu danlavu commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

The dig query is insufficient because it may be cached, failing when called because it attempts to delete a record that doesn't exist in the zone.

The method logic, at a high level, goes like this: because we pass in one parameter, we need to resolve the IP address from the hostname, which may return multiple addresses. We then iterate through the zones to determine the type of record. There may be a case where the A record is deleted, but still needs to iterate through because the PTR record exists. Then we determine if it's an IPv4 or IPv6 address. Each type of record requires a different argument to delete it properly, and then there is a lot of formatting required.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 refactors the DNS record deletion logic across the Active Directory, FreeIPA, and Samba roles to query and delete records directly using provider-specific tools rather than relying on generic dig commands, and adds IPv6 support to the network device utility. However, the refactored deletion logic introduces several critical issues that must be addressed: multiple potential TypeError exceptions from slicing or checking None values, a logic inversion in Samba where deletion only occurs if no records are found, an AttributeError on self.zone, a typo in raise_on_error, and several Python runtime errors in FreeIPA (such as calling the non-existent trim() method and unpacking errors).

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.

Comment thread sssd_test_framework/roles/ipa.py Outdated
Comment thread sssd_test_framework/roles/samba.py Outdated
Comment thread sssd_test_framework/roles/ad.py Outdated
Comment thread sssd_test_framework/roles/ad.py
Comment thread sssd_test_framework/roles/samba.py Outdated
Comment thread sssd_test_framework/roles/samba.py Outdated
Comment thread sssd_test_framework/roles/ipa.py Outdated
@danlavu
danlavu force-pushed the ipv6 branch 4 times, most recently from 86b2135 to d96150a Compare June 18, 2026 02:34
@danlavu danlavu changed the title dyndns - inprogress fixing dns server delete record in all roles Jun 18, 2026
@alexey-tikhonov
alexey-tikhonov requested a review from thalman June 18, 2026 12:45
@alexey-tikhonov
alexey-tikhonov requested a review from spoore1 June 18, 2026 12:46
Comment thread sssd_test_framework/utils/network.py Outdated

@thalman thalman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall looks good. See my question about add_device.

@danlavu
danlavu force-pushed the ipv6 branch 7 times, most recently from 08891e8 to a5bc137 Compare June 25, 2026 17:31

@spoore1 spoore1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall looks good and from testing it's working. I have a few nit-picks (optional mostly) and one actual question about the version pinning for pytest-mh.

Comment thread sssd_test_framework/roles/ad.py Outdated
Comment thread sssd_test_framework/roles/ad.py Outdated
Comment thread requirements.txt
@danlavu
danlavu force-pushed the ipv6 branch 3 times, most recently from 05fda02 to 0894b99 Compare June 27, 2026 23:12
@danlavu

danlavu commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

I have to redo the entire ipa logic because it was only returning one record. Looking back on this, knowing how complex it is now, I would have added more methods to find the record, get the record, etc. It may be beneficial if the look-up is faster than the dig. I think this will work in the interim.

@danlavu

danlavu commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

Increasing the retry/delay to a total of 120 seconds, from the run in IDMCI.

2026-06-28T00:06:39 =========================== short test summary info ============================
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_true (ad)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_false (ad)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0] (ad)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0, dummy0] (ad)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_over_tcp_only (ad)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = None] (ad)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_does_not_contain_use_after_free_bugs (ad)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_true (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_false (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0] (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0, dummy0] (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_configured_ttl_value (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_over_tcp_only (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = None] (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = GSS-TSIG] (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_does_not_contain_use_after_free_bugs (ipa)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_true (samba)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_false (samba)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0] (samba)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0, dummy0] (samba)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_configured_ttl_value (samba)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_over_tcp_only (samba)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = None] (samba)
2026-06-28T00:06:39 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_does_not_contain_use_after_free_bugs (samba)
2026-06-28T00:06:39 FAILED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_configured_ttl_value (ad) - AssertionError: Host client.ad-n9v8.test was not found!
2026-06-28T00:06:39 assert None
2026-06-28T00:06:39 FAILED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = GSS-TSIG] (ad) - AssertionError: Host client.ad-n9v8.test was not found!
2026-06-28T00:06:39 assert None
2026-06-28T00:06:39 FAILED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = GSS-TSIG] (samba) - AssertionError: Host client.samba.test was not found!
2026-06-28T00:06:39 assert None
2026-06-28T00:06:39 ==== 3 failed, 24 passed, 932 deselected, 9 warnings in 1477.30s (0:24:37) =====

@danlavu

danlavu commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

working in idmci


2026-06-28T06:11:05 =========================== short test summary info ============================
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_true (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_false (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0] (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0, dummy0] (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_configured_ttl_value (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_over_tcp_only (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = None] (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = GSS-TSIG] (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_does_not_contain_use_after_free_bugs (ad)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_true (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_false (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0] (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0, dummy0] (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_configured_ttl_value (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_over_tcp_only (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = None] (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = GSS-TSIG] (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_does_not_contain_use_after_free_bugs (ipa)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_true (samba)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_is_set_to_false (samba)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0] (samba)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_with_address_filtering[dyndns_iface = eth0, dummy0] (samba)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_configured_ttl_value (samba)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_over_tcp_only (samba)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = None] (samba)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_authentication_mechanism[dyndns_auth = GSS-TSIG] (samba)
2026-06-28T06:11:05 PASSED ../sssd/src/tests/system/tests/test_dyndns.py::test_dyndns__update_does_not_contain_use_after_free_bugs (samba)
2026-06-28T06:11:05 ========= 27 passed, 932 deselected, 2 warnings in 1151.41s (0:19:11) ==========

@danlavu
danlavu force-pushed the ipv6 branch 3 times, most recently from 6a51c4b to 8c066b2 Compare July 15, 2026 15:00

@spoore1 spoore1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

Comment thread requirements.txt

@thalman thalman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great job

@alexey-tikhonov
alexey-tikhonov merged commit 2d3035e into SSSD:master Jul 17, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants