)
lines = dnstapread.out.splitlines()
- assert expectedlen == len(lines)
- return list(map(line_to_ips_and_queries, lines))
+ # Count distinct (destination, query) pairs, not raw lines: under load
+ # named may retransmit, adding identical entries.
+ ips_and_queries = list(dict.fromkeys(map(line_to_ips_and_queries, lines)))
+ assert expectedlen == len(ips_and_queries)
+ return ips_and_queries
# Because DNSTAP doesn't have ordering guarantee, the order doesn't matter here.
isctest.check.servfail(res)
# 4 queries to get to the delegation.
- # 13 queries to delegation NS servers.
+ # 13 queries to delegation NS servers (13 distinct destinations).
ips_and_queries = extract_dnstap(ns4, 17)
# Thanks to the de-duplication, only the first 13 NS IPs are
("10.53.1.1", "a.sub.example.tld/IN/A"),
("10.53.1.2", "a.sub.example.tld/IN/A"),
("10.53.2.1", "a.sub.example.tld/IN/A"),
- ("10.53.0.3", "a.sub.example.tld/IN/A"),
("127.0.0.1", "a.sub.example.tld/IN/A"),
("127.0.0.2", "a.sub.example.tld/IN/A"),
+ ("127.0.0.3", "a.sub.example.tld/IN/A"),
],
ips_and_queries,
)