[cli] add support for DNS-SD command (#6116)

This commit adds new commands in CLI to support DNS-SD browse and
service resolution.
This commit is contained in:
Abtin Keshavarzian
2021-02-12 11:27:11 -08:00
committed by Jonathan Hui
parent 7084422a0e
commit 4538a5fb7c
5 changed files with 193 additions and 35 deletions
+4 -4
View File
@@ -88,11 +88,11 @@ class TestDnssd(thread_cert.TestCase):
self._config_srp_client_services(CLIENT2, 'ins2', 'host2', 22222, 2, 2, client2_addrs)
# Test AAAA query using DNS client
ip, ttl = self.nodes[CLIENT1].dns_resolve(f"host1.{DOMAIN}", self.nodes[SERVER].get_mleid(), 53)
self.assertIn(ipaddress.IPv6Address(ip), map(ipaddress.IPv6Address, client1_addrs))
response = self.nodes[CLIENT1].dns_resolve(f"host1.{DOMAIN}", self.nodes[SERVER].get_mleid(), 53)
self.assertIn(ipaddress.IPv6Address(response[0][0]), map(ipaddress.IPv6Address, client1_addrs))
ip, ttl = self.nodes[CLIENT1].dns_resolve(f"host2.{DOMAIN}", self.nodes[SERVER].get_mleid(), 53)
self.assertIn(ipaddress.IPv6Address(ip), map(ipaddress.IPv6Address, client2_addrs))
response = self.nodes[CLIENT1].dns_resolve(f"host2.{DOMAIN}", self.nodes[SERVER].get_mleid(), 53)
self.assertIn(ipaddress.IPv6Address(response[0][0]), map(ipaddress.IPv6Address, client2_addrs))
# TODO: test other query types using DNS-SD client