]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests/py: clean up set backend support fallout
authorFlorian Westphal <fw@strlen.de>
Tue, 24 Jun 2025 19:39:46 +0000 (21:39 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 24 Jun 2025 19:40:40 +0000 (21:40 +0200)
Pablo reports failing py tests woth recent kernel and userland:
 any/objects.t: OK
WARNING: line 3: 'add rule ip6 test-ip6 input ..
mismatches 'family 2 __set0 test-ip4 3 backend nft_set_bitmap_type [nf_tables] count 7'

When nf_tables is built as a module, the set backend name coming
from kernel contains the module name ([nf_tables]), this makes the
test script treat it as part of the pseudo instructions.

Skip this line explicitly to avoid these warnings.

Fixes: 7cec20e45a75 ("tests/py: prepare for set debug change")
Reported-by: Pablo Neira Ayuso <pablo@netfilter.org>
Tested-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/py/nft-test.py

index ea70f19b196d4b6a3715219dffb81c214f07bfc1..c7e55b0c324128131ee0183e5b7f8d73adbbec3c 100755 (executable)
@@ -722,7 +722,7 @@ def payload_check(payload_buffer, file, cmd):
              continue
 
         line = file.readline()
-        while line.find("[") < 0 or line.find("]") < 0:
+        while line.find("[") < 0 or line.find("]") < 0 or (line.startswith("family ") and line.find(" [nf_tables]") > 0):
             line = file.readline()
             if line == "":
                 break