[tests] deal with the No Such Record lines in the output of dns-sd (#11223)

When resolving a hostname, `dns-sd` may output a line saying `No Such
Record` with an all-zero address which should be discarded.
This commit is contained in:
Handa Wang
2025-02-08 03:04:43 +08:00
committed by GitHub
parent 3385437695
commit fd2e06d413
+2
View File
@@ -4040,6 +4040,8 @@ class LinuxHost():
for line in self.bash(f'cat {host_name_file}', encoding='raw_unicode_escape'):
elements = line.split()
fullname = f'{host_name}.local.'
if 'No Such Record' in line:
continue
if fullname not in elements:
continue
if 'Add' not in elements: