]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: avoid spurious failure when running in host namespace
authorFlorian Westphal <fw@strlen.de>
Sat, 22 Feb 2020 08:46:40 +0000 (09:46 +0100)
committerFlorian Westphal <fw@strlen.de>
Sat, 22 Feb 2020 08:54:25 +0000 (09:54 +0100)
Dump validation may fail:
- tcp dport { 22, 23 } counter packets 0 bytes 0
+ tcp dport { 22, 23 } counter packets 9 bytes 3400

... which is normal on host namespace.

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/testcases/sets/0025anonymous_set_0
tests/shell/testcases/sets/dumps/0025anonymous_set_0.nft

index 93a7c02255cbca3da0a2497aeae21f32dc110dab..74777d8e021aa66eba7071706f19322331329e54 100755 (executable)
@@ -14,4 +14,4 @@ $NFT add rule t c ip daddr { \
 }
 
 #set : tcp ports
-$NFT add rule t c tcp dport { 22, 23 } counter
+$NFT add rule t c meta oifname \"doesntexist\" tcp dport { 22, 23 } counter
index 6204b00c1385d0693213c977a802fff408fb10cc..59636994839cd22cb005a5d7f5578d57615a4647 100644 (file)
@@ -2,6 +2,6 @@ table ip t {
        chain c {
                type filter hook output priority filter; policy accept;
                ip daddr { 192.168.0.1, 192.168.0.2, 192.168.0.3 }
-               tcp dport { 22, 23 } counter packets 0 bytes 0
+               oifname "doesntexist" tcp dport { 22, 23 } counter packets 0 bytes 0
        }
 }