[dnssd] add tests for Service Instance names with spaces (#7143)

This commit adds tests to make sure Service Instance names with spaces
are handled properly by SRP and DNS-SD.
This commit is contained in:
Simon Lin
2021-11-15 10:15:10 -08:00
committed by GitHub
parent b4c76b3e17
commit 34c8c82ee4
5 changed files with 371 additions and 1 deletions
+2
View File
@@ -862,6 +862,7 @@ class OTCI(object):
def dns_resolve_service(self, instance: str, service: str) -> Dict:
"""Resolves aservice instance."""
instance = self.__escape_escapable(instance)
cmd = f'dns service {instance} {service}'
output = self.execute_command(cmd, 30.0)
@@ -1122,6 +1123,7 @@ class OTCI(object):
priority: int = 0,
weight: int = 0,
txt: Dict[str, Union[str, bytes, bool]] = None):
instance = self.__escape_escapable(instance)
cmd = f'srp client service add {instance} {service} {port} {priority} {weight}'
if txt:
cmd += f' {self.__txt_to_hex(txt)}'