fix(mdns): Create a test to check answer section for PTR/ANY

to differentiate between discoveries and actual queries

fix(mdns): Revert the fix to check if CI fails
This commit is contained in:
David Cermak
2025-11-27 11:50:57 +01:00
parent 07b1bcdc34
commit 6c2c2cd22b

View File

@@ -76,6 +76,21 @@ def test_ptr_additional_records_for_service(dig_app):
dig_app.check_additional(resp, 'TXT', 'test_service._http._tcp.local', expected=True) dig_app.check_additional(resp, 'TXT', 'test_service._http._tcp.local', expected=True)
def test_instance_any_answer_records(dig_app):
"""Query ANY for the service instance and ensure SRV/TXT are in Answer (Q/A path)."""
resp = dig_app.run_query('test_service._http._tcp.local', query_type='ANY')
# Answer section should contain SRV and TXT records for the instance
srv_answers = dig_app.parse_section(resp, 'answer', 'SRV')
txt_answers = dig_app.parse_section(resp, 'answer', 'TXT')
assert any('test_service._http._tcp.local' in a for a in srv_answers)
assert any('test_service._http._tcp.local' in a for a in txt_answers)
# We should not see a PTR for the generic service name in the Answer section
ptr_answers = dig_app.parse_section(resp, 'answer', 'PTR')
assert not any('_http._tcp.local' in a for a in ptr_answers)
def test_remove_service(mdns_console, dig_app): def test_remove_service(mdns_console, dig_app):
mdns_console.send_input('mdns_service_remove _http _tcp') mdns_console.send_input('mdns_service_remove _http _tcp')
mdns_console.send_input('mdns_service_lookup _http _tcp') mdns_console.send_input('mdns_service_lookup _http _tcp')