mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[tests] add support for enable/disable OT mdns (#11660)
This commit is contained in:
@@ -137,9 +137,9 @@ class TestDnssdServerOnMultiBr(thread_cert.TestCase):
|
||||
self.simulator.go(5)
|
||||
|
||||
# start BR2 late to ensure it doesn't have mDNS cache
|
||||
br2.start_mdns_service()
|
||||
br2.start_otbr_service()
|
||||
br2.start()
|
||||
br2.start_mdns_service()
|
||||
|
||||
self.simulator.go(config.BORDER_ROUTER_STARTUP_DELAY)
|
||||
br2.dns_upstream_query_state = False
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user