]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: py: Use stateless option on tests
authorElise Lennion <elise.lennion@gmail.com>
Tue, 17 Jan 2017 15:44:54 +0000 (13:44 -0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 18 Jan 2017 17:54:45 +0000 (18:54 +0100)
To don't trigger false errors because of unrelated traffic on the
tested machine.

Tests, which have rules with counter and 'ok' result, are updated to
avoid new Warnings.

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
12 files changed:
tests/py/ip/flowtable.t
tests/py/ip/flowtable.t.payload
tests/py/ip/masquerade.t
tests/py/ip/masquerade.t.payload
tests/py/ip/redirect.t
tests/py/ip/redirect.t.payload
tests/py/ip6/flowtable.t
tests/py/ip6/masquerade.t
tests/py/ip6/masquerade.t.payload.ip6
tests/py/ip6/redirect.t
tests/py/ip6/redirect.t.payload.ip6
tests/py/nft-test.py

index aea57c32fec2da3a1680d9c0fe2175adf39aa194..41d5d3bb034346dfbae5f2f0e10b0fe1a69d488b 100644 (file)
@@ -2,4 +2,4 @@
 
 *ip;test-ip;input
 
-flow table xyz { ip saddr timeout 30s counter packets 0 bytes 0};ok
+flow table xyz { ip saddr timeout 30s counter};ok
index ffadfd2555c3f8184088ca04ddf180751a27827f..591abf2bd06e9b2508ef627b34d7ddfce9490a77 100644 (file)
@@ -1,4 +1,4 @@
-# flow table xyz { ip saddr timeout 30s counter packets 0 bytes 0}
+# flow table xyz { ip saddr timeout 30s counter}
 xyz test-ip 31
 xyz test-ip 0
 ip test-ip input 
index cee6e0e8ffb3afa4775fdd521b3288510559e231..26c3704316ae7467f6fa0de1c1d6a71cc91d2774 100644 (file)
@@ -26,5 +26,5 @@ ip saddr 10.1.1.1 masquerade drop;fail
 
 # masquerade with sets
 tcp dport { 1,2,3,4,5,6,7,8,101,202,303,1001,2002,3003} masquerade;ok
-ip daddr 10.0.0.0-10.2.3.4 udp dport 53 counter packets 0 bytes 0 masquerade;ok
+ip daddr 10.0.0.0-10.2.3.4 udp dport 53 counter masquerade;ok
 iifname eth0 ct state new,established tcp dport vmap {22 : drop, 222 : drop } masquerade;ok
index f4bbe99df8476e7dd02e7ea1c18186b3c5c78596..ad0ea518ed538755b6093abdbf0187e5e367b9db 100644 (file)
@@ -97,7 +97,7 @@ ip test-ip4 postrouting
   [ lookup reg 1 set __set%d ]
   [ masq ]
 
-# ip daddr 10.0.0.0-10.2.3.4 udp dport 53 counter packets 0 bytes 0 masquerade
+# ip daddr 10.0.0.0-10.2.3.4 udp dport 53 counter masquerade
 ip test-ip4 postrouting
   [ payload load 4b @ network header + 16 => reg 1 ]
   [ cmp gte reg 1 0x0000000a ]
index f6ddfc05e4edbfbe44d06a9335a550a729624d12..793236112107a1d666d5d4e23b763129253dd516 100644 (file)
@@ -43,7 +43,7 @@ ip saddr 10.1.1.1 redirect drop;fail
 
 # redirect with sets
 tcp dport { 1, 2, 3, 4, 5, 6, 7, 8, 101, 202, 303, 1001, 2002, 3003} redirect;ok
-ip daddr 10.0.0.0-10.2.3.4 udp dport 53 counter packets 0 bytes 0 redirect;ok
+ip daddr 10.0.0.0-10.2.3.4 udp dport 53 counter redirect;ok
 iifname eth0 ct state new,established tcp dport vmap {22 : drop, 222 : drop } redirect;ok
 
 # redirect with maps
index dfb5a3bd86011ff7f0f29b01b141350941abc36b..1f050bfe186e7d046805ae17851d32d8c4e1a61a 100644 (file)
@@ -179,7 +179,7 @@ ip test-ip4 output
   [ lookup reg 1 set __set%d ]
   [ redir ]
 
-# ip daddr 10.0.0.0-10.2.3.4 udp dport 53 counter packets 0 bytes 0 redirect
+# ip daddr 10.0.0.0-10.2.3.4 udp dport 53 counter redirect
 ip test-ip4 output
   [ payload load 4b @ network header + 16 => reg 1 ]
   [ cmp gte reg 1 0x0000000a ]
index ae408b784eabc0743553a8f24b4ffcee8e3bf228..cf0a6068f9c893a38da31b15eee184139d94e4eb 100644 (file)
@@ -2,5 +2,5 @@
 
 *ip6;test-ip6;input
 
-flow table acct_out { meta iif . ip6 saddr timeout 600s counter };ok;flow table acct_out { iif . ip6 saddr timeout 10m counter packets 0 bytes 0}
-flow table acct_out { ip6 saddr . meta iif timeout 600s counter };ok;flow table acct_out { ip6 saddr . iif timeout 10m counter packets 0 bytes 0}
+flow table acct_out { meta iif . ip6 saddr timeout 600s counter };ok;flow table acct_out { iif . ip6 saddr timeout 10m counter}
+flow table acct_out { ip6 saddr . meta iif timeout 600s counter };ok;flow table acct_out { ip6 saddr . iif timeout 10m counter}
index d36ff76bdcfeb7ee6b28e5f27c32e72bc0e772fc..fea739157631c5176b70022986283aa575c3afcb 100644 (file)
@@ -26,5 +26,5 @@ ip6 saddr ::1 masquerade drop;fail
 
 # masquerade with sets
 tcp dport { 1,2,3,4,5,6,7,8,101,202,303,1001,2002,3003} masquerade;ok
-ip6 daddr fe00::1-fe00::200 udp dport 53 counter packets 0 bytes 0 masquerade;ok
+ip6 daddr fe00::1-fe00::200 udp dport 53 counter masquerade;ok
 iifname eth0 ct state new,established tcp dport vmap {22 : drop, 222 : drop } masquerade;ok
index ded74c0abe1dbf596a9a87577acd2c3615200864..31cedf1ff00cf92bc9185ea685807c5de7ef6484 100644 (file)
@@ -97,7 +97,7 @@ ip6 test-ip6 postrouting
   [ lookup reg 1 set __set%d ]
   [ masq ]
 
-# ip6 daddr fe00::1-fe00::200 udp dport 53 counter packets 0 bytes 0 masquerade
+# ip6 daddr fe00::1-fe00::200 udp dport 53 counter masquerade
 ip6 test-ip6 postrouting
   [ payload load 16b @ network header + 24 => reg 1 ]
   [ cmp gte reg 1 0x000000fe 0x00000000 0x00000000 0x01000000 ]
index c5d939c53d7cb12bdbbc8eb266718b258086dd14..37169bca8fff6bdd36c412adff64401e57980c16 100644 (file)
@@ -5,7 +5,7 @@
 # with no arguments
 redirect;ok
 udp dport 954 redirect;ok
-ip6 saddr fe00::cafe counter packets 0 bytes 0 redirect;ok
+ip6 saddr fe00::cafe counter redirect;ok
 
 # nf_nat flags combination
 udp dport 53 redirect random;ok
@@ -42,7 +42,7 @@ ip6 saddr ::1 redirect drop;fail
 
 # redirect with sets
 tcp dport { 1, 2, 3, 4, 5, 6, 7, 8, 101, 202, 303, 1001, 2002, 3003} redirect;ok
-ip6 daddr fe00::1-fe00::200 udp dport 53 counter packets 0 bytes 0 redirect;ok
+ip6 daddr fe00::1-fe00::200 udp dport 53 counter redirect;ok
 iifname eth0 ct state new,established tcp dport vmap {22 : drop, 222 : drop } redirect;ok
 
 # redirect with maps
index 420e1f3659643524c2ad03ade93303da13fe98f8..f256326acf4b1da9be7cccbd57a3c8f5243abc50 100644 (file)
@@ -10,7 +10,7 @@ ip6 test-ip6 output
   [ cmp eq reg 1 0x0000ba03 ]
   [ redir ]
 
-# ip6 saddr fe00::cafe counter packets 0 bytes 0 redirect
+# ip6 saddr fe00::cafe counter redirect
 ip6 test-ip6 output
   [ payload load 16b @ network header + 8 => reg 1 ]
   [ cmp eq reg 1 0x000000fe 0x00000000 0x00000000 0xfeca0000 ]
@@ -163,7 +163,7 @@ ip6 test-ip6 output
   [ lookup reg 1 set __set%d ]
   [ redir ]
 
-# ip6 daddr fe00::1-fe00::200 udp dport 53 counter packets 0 bytes 0 redirect
+# ip6 daddr fe00::1-fe00::200 udp dport 53 counter redirect
 ip6 test-ip6 output
   [ payload load 16b @ network header + 24 => reg 1 ]
   [ cmp gte reg 1 0x000000fe 0x00000000 0x00000000 0x01000000 ]
index fc7ae608b46b209ab5ff981ba2d3196a1abe2f61..62b794218eace2c7b60a4fa4e7e6711d7e8d0cb8 100755 (executable)
@@ -625,7 +625,7 @@ def rule_add(rule, filename, lineno, force_all_family_option, filename_path):
                                   gotf.name, 1)
 
                 # Check output of nft
-                process = subprocess.Popen([NFT_BIN, '-nnn', 'list', 'table',
+                process = subprocess.Popen([NFT_BIN, '-nnns', 'list', 'table',
                                             table.family, table.name],
                                            shell=False,
                                            stdout=subprocess.PIPE,