File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
components/mdns/tests/host_test Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,21 @@ def test_ptr_additional_records_for_service(dig_app):
7676 dig_app .check_additional (resp , 'TXT' , 'test_service._http._tcp.local' , expected = True )
7777
7878
79+ def test_instance_any_answer_records (dig_app ):
80+ """Query ANY for the service instance and ensure SRV/TXT are in Answer (Q/A path)."""
81+ resp = dig_app .run_query ('test_service._http._tcp.local' , query_type = 'ANY' )
82+
83+ # Answer section should contain SRV and TXT records for the instance
84+ srv_answers = dig_app .parse_section (resp , 'answer' , 'SRV' )
85+ txt_answers = dig_app .parse_section (resp , 'answer' , 'TXT' )
86+ assert any ('test_service._http._tcp.local' in a for a in srv_answers )
87+ assert any ('test_service._http._tcp.local' in a for a in txt_answers )
88+
89+ # We should not see a PTR for the generic service name in the Answer section
90+ ptr_answers = dig_app .parse_section (resp , 'answer' , 'PTR' )
91+ assert not any ('_http._tcp.local' in a for a in ptr_answers )
92+
93+
7994def test_remove_service (mdns_console , dig_app ):
8095 mdns_console .send_input ('mdns_service_remove _http _tcp' )
8196 mdns_console .send_input ('mdns_service_lookup _http _tcp' )
You can’t perform that action at this time.
0 commit comments