]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tools: match_nomatch: fix spurious failure in nomatch test
authorFlorian Westphal <fw@strlen.de>
Fri, 1 May 2026 13:12:06 +0000 (15:12 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 7 May 2026 22:07:04 +0000 (00:07 +0200)
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/helpers/set_match_nomatch_helpers

index 35114895c68cf46dfd35ad26d69c2095d76f93a6..d2169e9a82c31729f7219d943584a2ec6353f38c 100644 (file)
@@ -305,7 +305,7 @@ test_nomatch()
 
        if ip netns exec "$R" $NFT list set ip test s | grep -q 'counter packets 1' ; then
                ip netns exec "$R" $NFT list set ip test s
-               exit_fatal "Unexpected entry listed as matching"
+               exit_fatal "Unexpected entry listed as matching, sent $psent packets."
        fi
 
        if ip netns exec "$R" $NFT list counter ip test nomatch | grep -q "packets $psent"; then
@@ -358,7 +358,7 @@ test_match_ranges()
        test_match "rbtree" $rnd_addrs
 
        echo Validate addresses outside range
-       test_nomatch $bad_addrs
+       [ -z "$bad_addrs" ] || test_nomatch $bad_addrs
 }
 
 test_match_ranges_rnd()