]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
tests-extra: fix response.check() to check both rdata and nordata
authorDaniel Salzman <daniel.salzman@nic.cz>
Fri, 12 Sep 2025 07:28:15 +0000 (09:28 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Fri, 12 Sep 2025 07:37:57 +0000 (09:37 +0200)
tests-extra/tools/dnstest/response.py

index f3d110287d9d9d05565232989163e4d613841dce..a6cf19cd6f4b4171a437f7e698a8af6f54b041a3 100644 (file)
@@ -120,6 +120,7 @@ class Response(object):
             ref = str(list(rrset)[0])
 
             # Check answer section if contains reference rdata.
+            found = False
             for data in sect:
                 if name is not None and str(data.name) != str(name):
                     continue
@@ -133,8 +134,11 @@ class Response(object):
                         # Check TTL if specified.
                         if ttl != None:
                             compare(data.ttl, int(ttl), "TTL")
-                        return
-            else:
+                        found = True
+                        break
+                if found:
+                    break
+            if not found:
                 set_err("CHECK RDATA")
                 check_log("ERROR: CHECK RDATA")
                 detail_log("!Missing data in %s section:" % section)