[tests] add support for enable/disable OT mdns (#11660)

This commit is contained in:
Jonathan Hui
2025-07-01 11:48:55 -07:00
committed by GitHub
parent ef0e7bb858
commit 68d603ef42
2 changed files with 15 additions and 1 deletions
+14
View File
@@ -177,9 +177,23 @@ class OtbrDocker:
self.bash('service otbr-agent stop')
def stop_mdns_service(self):
self.send_command('mdns disable')
# The OT build may not include mdns, so ignore `InvalidCommand` errors.
try:
self._expect_result(r'Done')
except Exception as ex:
if 'InvalidCommand' not in str(ex):
raise
self.bash('service avahi-daemon stop; service mdns stop; !(cat /proc/net/udp | grep -i :14E9)')
def start_mdns_service(self):
self.send_command('mdns enable')
# The OT build may not include mdns, so ignore `InvalidCommand` errors.
try:
self._expect_result(r'Done')
except Exception as ex:
if 'InvalidCommand' not in str(ex):
raise
self.bash('service avahi-daemon start; service mdns start; cat /proc/net/udp | grep -i :14E9')
def start_ot_ctl(self):