From 825227a71a6c70f8b046f5c66a91cde8abd14757 Mon Sep 17 00:00:00 2001 From: Eduardo Montoya Date: Wed, 17 Nov 2021 19:14:32 +0100 Subject: [PATCH] [thci] fix `mdns_query` (#7154) Avoid parsing responses for not expected cases. Fixes some issues with Thread 1.2 certification test cases in which it's not required to parse the mDNS response. --- tools/harness-thci/OpenThread_BR.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/harness-thci/OpenThread_BR.py b/tools/harness-thci/OpenThread_BR.py index 47a25f327..12dbc7d31 100644 --- a/tools/harness-thci/OpenThread_BR.py +++ b/tools/harness-thci/OpenThread_BR.py @@ -612,9 +612,12 @@ EOF" print('mdns_query %s %s %s' % (dst, service, addrs_blacklist)) result = self.bash('dig -p 5353 @%s %s ptr +time=2 +retry=2' % (dst, service)) - responses = ' '.join(result).split(';; ANSWER SECTION:') + + if dst == 'ff02::fb' and not addrs_blacklist: + return (0, '') # Remove responses from unwanted devices + responses = ' '.join(result).split(';; ANSWER SECTION:') for response in responses: if not set(response.split()).isdisjoint(set(addrs_blacklist)): break