]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: avoid single-value anon sets
authorFlorian Westphal <fw@strlen.de>
Fri, 17 May 2019 11:57:23 +0000 (13:57 +0200)
committerFlorian Westphal <fw@strlen.de>
Sun, 19 May 2019 17:09:49 +0000 (19:09 +0200)
Future change is going to auto-change them to simple compare
ops rather than lookup in set with only one element.

Signed-off-by: Florian Westphal <fw@strlen.de>
13 files changed:
tests/shell/testcases/cache/0001_cache_handling_0
tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft
tests/shell/testcases/netns/0001nft-f_0
tests/shell/testcases/netns/0002loosecommands_0
tests/shell/testcases/netns/0003many_0
tests/shell/testcases/nft-f/0002rollback_rule_0
tests/shell/testcases/nft-f/0003rollback_jump_0
tests/shell/testcases/nft-f/0004rollback_set_0
tests/shell/testcases/nft-f/0005rollback_map_0
tests/shell/testcases/nft-f/dumps/0002rollback_rule_0.nft
tests/shell/testcases/nft-f/dumps/0003rollback_jump_0.nft
tests/shell/testcases/nft-f/dumps/0004rollback_set_0.nft
tests/shell/testcases/nft-f/dumps/0005rollback_map_0.nft

index f3dc9a347972316e1f334e8af145f54daf4e773d..a110be79d6f9aca1335e4d803a019a1c8967eb27 100755 (executable)
@@ -9,7 +9,7 @@ table inet test {
 
        chain test {
                ip saddr @test counter accept
-               ip daddr { 2.2.2.2} counter accept
+               ip daddr 2.2.2.2 counter accept
        }
 }'
 
index f6dd654158381446eb7da630f06850ac5e0f236d..47d744e9b9b3ad573911f6eac7172345c0ecdd6b 100644 (file)
@@ -5,8 +5,8 @@ table inet test {
        }
 
        chain test {
-               ip daddr { 2.2.2.2 } counter packets 0 bytes 0 accept
+               ip daddr 2.2.2.2 counter packets 0 bytes 0 accept
                ip saddr @test counter packets 0 bytes 0 accept
-               ip daddr { 2.2.2.2 } counter packets 0 bytes 0 accept
+               ip daddr 2.2.2.2 counter packets 0 bytes 0 accept
        }
 }
index 8344808760b7ba233e4c4c4351f7a367a77ee8d9..89bf5a3dcb0fb206a5cb462e5092fc8636275d13 100755 (executable)
@@ -16,7 +16,7 @@ RULESET="table ip t {
 
        chain c {
                ct state new
-               udp dport { 12345 }
+               udp dport 12345
                ip saddr @s drop
                jump other
        }
@@ -32,7 +32,7 @@ table ip6 t {
 
        chain c {
                ct state new
-               udp dport { 12345 }
+               udp dport 12345
                ip6 saddr @s drop
                jump other
        }
@@ -48,7 +48,7 @@ table inet t {
 
        chain c {
                ct state new
-               udp dport { 12345 }
+               udp dport 12345
                ip6 saddr @s drop
                jump other
        }
index e62782804da4c88f169cafaa64052a50f7474170..abef50a15ec0a1fbdfd13e856bde942a2269dcae 100755 (executable)
@@ -30,9 +30,9 @@ netns_exec $NETNS_NAME "$NFT add table ip t"
 netns_exec $NETNS_NAME "$NFT add chain ip t c"
 netns_exec $NETNS_NAME "$NFT add chain ip t other"
 netns_exec $NETNS_NAME "$NFT add set ip t s { type ipv4_addr; }"
-netns_exec $NETNS_NAME "$NFT add element ip t s {1.1.0.0 }"
+netns_exec $NETNS_NAME "$NFT add element ip t s {1.1.0.0}"
 netns_exec $NETNS_NAME "$NFT add rule ip t c ct state new"
-netns_exec $NETNS_NAME "$NFT add rule ip t c udp dport { 12345 }"
+netns_exec $NETNS_NAME "$NFT add rule ip t c udp dport 12345"
 netns_exec $NETNS_NAME "$NFT add rule ip t c ip saddr @s drop"
 netns_exec $NETNS_NAME "$NFT add rule ip t c jump other"
 
@@ -44,7 +44,7 @@ RULESET="table ip t {
 
        chain c {
                ct state new
-               udp dport { 12345 }
+               udp dport 12345
                ip saddr @s drop
                jump other
        }
index 61ad37bddadb64160d5085af45ee75f0710ac702..36b29cfb3a210cc75dc6a09cd02307e1e14c8468 100755 (executable)
@@ -19,7 +19,7 @@ RULESET="table ip t {
 
        chain c {
                ct state new
-               udp dport { 12345 }
+               udp dport 12345
                ip saddr @s drop
                jump other
        }
@@ -35,7 +35,7 @@ table ip6 t {
 
        chain c {
                ct state new
-               udp dport { 12345 }
+               udp dport 12345
                ip6 saddr @s drop
                jump other
        }
@@ -51,7 +51,7 @@ table inet t {
 
        chain c {
                ct state new
-               udp dport { 12345 }
+               udp dport 12345
                ip6 saddr @s drop
                jump other
        }
index da3cdc0bc161934ab4ee255c23cb704f94626f6d..e459b4d4a67d6390951d53dc9bd5487930b2782f 100755 (executable)
@@ -11,7 +11,7 @@ GOOD_RULESET="table ip t {
 
        chain c {
                ct state new
-               tcp dport { 22222 }
+               tcp dport 22222
                ip saddr @t drop
                jump other
        }
index 1238f1504c96bfa3a337cbf5d1505064de81f1e4..06fc50e472fe27e68529969972f4c83d38f85268 100755 (executable)
@@ -11,7 +11,7 @@ GOOD_RULESET="table ip t {
 
        chain c {
                ct state new
-               tcp dport { 22222 }
+               tcp dport 22222
                ip saddr @t drop
                jump other
        }
index 25fc870c67421e8abd27920aff841c84ffccfe52..bf779e9e53279e41e4b27af7d7528ac9cca341b8 100755 (executable)
@@ -11,7 +11,7 @@ GOOD_RULESET="table ip t {
 
        chain c {
                ct state new
-               tcp dport { 22222 }
+               tcp dport 22222
                ip saddr @t drop
                jump other
        }
index 90108e729d59b3c1ddbd4607cc4221883e8de95c..188f459a3f35ceb6595fe428987bf8597c204fc3 100755 (executable)
@@ -11,7 +11,7 @@ GOOD_RULESET="table ip t {
 
        chain c {
                ct state new
-               tcp dport { 22222 }
+               tcp dport 22222
                ip saddr @t drop
                jump other
        }
index f6f2615852c7aec5834609e90da2ad243b8a1c5a..2014d502e63e66e646575717d7459408a8a4f4f4 100644 (file)
@@ -6,7 +6,7 @@ table ip t {
 
        chain c {
                ct state new
-               tcp dport { 22222 }
+               tcp dport 22222
                ip saddr @t drop
                jump other
        }
index f6f2615852c7aec5834609e90da2ad243b8a1c5a..2014d502e63e66e646575717d7459408a8a4f4f4 100644 (file)
@@ -6,7 +6,7 @@ table ip t {
 
        chain c {
                ct state new
-               tcp dport { 22222 }
+               tcp dport 22222
                ip saddr @t drop
                jump other
        }
index f6f2615852c7aec5834609e90da2ad243b8a1c5a..2014d502e63e66e646575717d7459408a8a4f4f4 100644 (file)
@@ -6,7 +6,7 @@ table ip t {
 
        chain c {
                ct state new
-               tcp dport { 22222 }
+               tcp dport 22222
                ip saddr @t drop
                jump other
        }
index f6f2615852c7aec5834609e90da2ad243b8a1c5a..2014d502e63e66e646575717d7459408a8a4f4f4 100644 (file)
@@ -6,7 +6,7 @@ table ip t {
 
        chain c {
                ct state new
-               tcp dport { 22222 }
+               tcp dport 22222
                ip saddr @t drop
                jump other
        }