tests: replace single element sets
Pablo Neira Ayuso
maintainerPATCH 1/1 tests: replace single element sets
Add at least two elements to sets.
Signed-off-by Pablo Neira Ayuso <[email protected]>
---
Needs to revert two recent commits upstream to apply this.
tests/py/any/ct.t | 9 +- tests/py/any/ct.t.payload | 52 +-- tests/py/any/meta.t | 30 +- tests/py/any/meta.t.payload | 386 +++++++++++---------- tests/shell/testcases/cache/0001_cache_handling_0 | 4 +- .../cache/dumps/0001_cache_handling_0.nft | 6 +- tests/shell/testcases/listing/0011sets_0 | 8 +- tests/shell/testcases/netns/0001nft-f_0 | 6 +- tests/shell/testcases/netns/0002loosecommands_0 | 4 +- tests/shell/testcases/netns/0003many_0 | 6 +- tests/shell/testcases/nft-f/0002rollback_rule_0 | 2 +- tests/shell/testcases/nft-f/0003rollback_jump_0 | 2 +- tests/shell/testcases/nft-f/0004rollback_set_0 | 2 +- tests/shell/testcases/nft-f/0005rollback_map_0 | 2 +- tests/shell/testcases/nft-f/0006action_object_0 | 4 +- tests/shell/testcases/nft-f/0016redefines_1 | 4 +- .../testcases/nft-f/dumps/0002rollback_rule_0.nft | 2 +- .../testcases/nft-f/dumps/0003rollback_jump_0.nft | 2 +- .../testcases/nft-f/dumps/0004rollback_set_0.nft | 2 +- .../testcases/nft-f/dumps/0005rollback_map_0.nft | 2 +- tests/shell/testcases/sets/0021nesting_0 | 1 + 21 files changed, 280 insertions(+), 256 deletions(-)
tests/py/any/ct.t +4 -5
@@ -73,17 +73,16 @@ ct expiration 33-45;ok;ct expiration 33s-45s ct expiration != 33-45;ok;ct expiration != 33s-45s ct expiration {33, 55, 67, 88};ok;ct expiration { 1m7s, 33s, 55s, 1m28s} ct expiration != {33, 55, 67, 88};ok;ct expiration != { 1m7s, 33s, 55s, 1m28s} -ct expiration {33-55};ok;ct expiration { 33s-55s} -ct expiration != {33-55};ok;ct expiration != { 33s-55s} +ct expiration {33-55, 66-88};ok;ct expiration { 33s-55s, 1m6s-1m28s} +ct expiration != {33-55, 66-88};ok;ct expiration != { 33s-55s, 1m6s-1m28s} ct helper "ftp";ok ct helper "12345678901234567";fail ct helper "";fail -ct state . ct mark { new . 0x12345678};ok ct state . ct mark { new . 0x12345678, new . 0x34127856, established . 0x12785634};ok -ct direction . ct mark { original . 0x12345678};ok -ct state . ct mark vmap { new . 0x12345678 : drop};ok +ct direction . ct mark { original . 0x12345678, reply . 0x87654321};ok +ct state . ct mark vmap { new . 0x12345678 : drop, established . 0x87654321 : accept};ok ct original bytes > 100000;ok ct reply packets < 100;ok
tests/py/any/ct.t.payload +26 -26
73 lines not on this page · raw message
tests/py/any/meta.t +14 -16
@@ -17,8 +17,8 @@ meta length { 33, 55, 67, 88};ok meta length { 33-55, 67-88};ok meta length { 33-55, 56-88, 100-120};ok;meta length { 33-88, 100-120} meta length != { 33, 55, 67, 88};ok -meta length { 33-55};ok -meta length != { 33-55};ok +meta length { 33-55, 66-88};ok +meta length != { 33-55, 66-88};ok meta protocol { ip, arp, ip6, vlan };ok;meta protocol { ip6, ip, vlan, arp} meta protocol != {ip, arp, ip6, vlan};ok
@@ -31,8 +31,8 @@ meta l4proto 33-45;ok meta l4proto != 33-45;ok meta l4proto { 33, 55, 67, 88};ok;meta l4proto { 33, 55, 67, 88} meta l4proto != { 33, 55, 67, 88};ok -meta l4proto { 33-55};ok -meta l4proto != { 33-55};ok +meta l4proto { 33-55, 66-88};ok +meta l4proto != { 33-55, 66-88};ok meta priority root;ok meta priority none;ok
@@ -81,8 +81,6 @@ meta iiftype ppp;ok meta oif "lo" accept;ok;oif "lo" accept meta oif != "lo" accept;ok;oif != "lo" accept -meta oif {"lo"} accept;ok;oif {"lo"} accept -meta oif != {"lo"} accept;ok;oif != {"lo"} accept meta oifname "dummy0";ok;oifname "dummy0" meta oifname != "dummy0";ok;oifname != "dummy0"
@@ -105,8 +103,8 @@ meta skuid gt 3000 accept;ok;meta skuid > 3000 accept meta skuid eq 3000 accept;ok;meta skuid 3000 accept meta skuid 3001-3005 accept;ok;meta skuid 3001-3005 accept meta skuid != 2001-2005 accept;ok;meta skuid != 2001-2005 accept -meta skuid { 2001-2005} accept;ok;meta skuid { 2001-2005} accept -meta skuid != { 2001-2005} accept;ok;meta skuid != { 2001-2005} accept +meta skuid { 2001-2005, 3001-3005} accept;ok;meta skuid { 2001-2005, 3001-3005} accept +meta skuid != { 2001-2005, 3001-3005} accept;ok;meta skuid != { 2001-2005, 3001-3005} accept meta skgid {"bin", "root", "daemon"} accept;ok;meta skgid { 0, 1, 2} accept meta skgid != {"bin", "root", "daemon"} accept;ok;meta skgid != { 1, 0, 2} accept
@@ -173,22 +171,22 @@ meta iifgroup 0;ok;iifgroup "default" meta iifgroup != 0;ok;iifgroup != "default" meta iifgroup "default";ok;iifgroup "default" meta iifgroup != "default";ok;iifgroup != "default" -meta iifgroup {"default"};ok;iifgroup {"default"} -meta iifgroup != {"default"};ok;iifgroup != {"default"} +meta iifgroup {"default", 11};ok;iifgroup {"default", 11} +meta iifgroup != {"default", 11};ok;iifgroup != {"default", 11} meta iifgroup { 11,33};ok;iifgroup { 11,33} -meta iifgroup {11-33};ok;iifgroup {11-33} +meta iifgroup {11-33, 44-55};ok;iifgroup {11-33, 44-55} meta iifgroup != { 11,33};ok;iifgroup != { 11,33} -meta iifgroup != {11-33};ok;iifgroup != {11-33} +meta iifgroup != {11-33, 44-55};ok;iifgroup != {11-33, 44-55} meta oifgroup 0;ok;oifgroup "default" meta oifgroup != 0;ok;oifgroup != "default" meta oifgroup "default";ok;oifgroup "default" meta oifgroup != "default";ok;oifgroup != "default" -meta oifgroup {"default"};ok;oifgroup {"default"} -meta oifgroup != {"default"};ok;oifgroup != {"default"} +meta oifgroup {"default", 11};ok;oifgroup {"default", 11} +meta oifgroup != {"default", 11};ok;oifgroup != {"default", 11} meta oifgroup { 11,33};ok;oifgroup { 11,33} -meta oifgroup {11-33};ok;oifgroup {11-33} +meta oifgroup {11-33, 44-55};ok;oifgroup {11-33, 44-55} meta oifgroup != { 11,33};ok;oifgroup != { 11,33} -meta oifgroup != {11-33};ok;oifgroup != {11-33} +meta oifgroup != {11-33, 44-55};ok;oifgroup != {11-33, 44-55} meta cgroup 1048577;ok;meta cgroup 1048577 meta cgroup != 1048577;ok;meta cgroup != 1048577
tests/py/any/meta.t.payload +206 -180
449 lines not on this page · raw message
tests/shell/testcases/cache/0001_cache_handling_0 +2 -2
@@ -4,12 +4,12 @@ RULESET=' table inet test { set test { type ipv4_addr - elements = { 1.1.1.1} + elements = { 1.1.1.1, 3.3.3.3} } chain test { ip saddr @test counter accept - ip daddr { 2.2.2.2} counter accept + ip daddr { 2.2.2.2, 4.4.4.4} counter accept } }'
tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft +3 -3
@@ -1,12 +1,12 @@ table inet test { set test { type ipv4_addr - elements = { 1.1.1.1 } + elements = { 1.1.1.1, 3.3.3.3 } } chain test { - ip daddr { 2.2.2.2 } counter packets 0 bytes 0 accept + ip daddr { 2.2.2.2, 4.4.4.4 } 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, 4.4.4.4 } counter packets 0 bytes 0 accept } }
tests/shell/testcases/listing/0011sets_0 +4 -4
@@ -17,19 +17,19 @@ set -e $NFT add table ip nat $NFT add chain ip nat test -$NFT add rule ip nat test tcp dport {123} +$NFT add rule ip nat test tcp dport {123, 321} $NFT add table ip6 test $NFT add chain ip6 test test -$NFT add rule ip6 test test udp sport {123} +$NFT add rule ip6 test test udp sport {123, 321} $NFT add table arp test_arp $NFT add chain arp test_arp test -$NFT add rule arp test_arp test meta mark {123} +$NFT add rule arp test_arp test meta mark {123, 321} $NFT add table bridge test_bridge $NFT add chain bridge test_bridge test -$NFT add rule bridge test_bridge test ip daddr {1.1.1.1} +$NFT add rule bridge test_bridge test ip daddr {1.1.1.1, 2.2.2.2} $NFT add table inet filter $NFT add chain inet filter test
tests/shell/testcases/netns/0001nft-f_0 +3 -3
@@ -16,7 +16,7 @@ RULESET="table ip t { chain c { ct state new - udp dport { 12345 } + udp dport { 12345, 54321 } ip saddr @s drop jump other }
@@ -32,7 +32,7 @@ table ip6 t { chain c { ct state new - udp dport { 12345 } + udp dport { 12345, 54321 } ip6 saddr @s drop jump other }
@@ -48,7 +48,7 @@ table inet t { chain c { ct state new - udp dport { 12345 } + udp dport { 12345, 54321 } ip6 saddr @s drop jump other }
tests/shell/testcases/netns/0002loosecommands_0 +2 -2
@@ -32,7 +32,7 @@ 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 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, 54321 }" 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, 54321 } ip saddr @s drop jump other }
tests/shell/testcases/netns/0003many_0 +3 -3
@@ -19,7 +19,7 @@ RULESET="table ip t { chain c { ct state new - udp dport { 12345 } + udp dport { 12345, 54321 } ip saddr @s drop jump other }
@@ -35,7 +35,7 @@ table ip6 t { chain c { ct state new - udp dport { 12345 } + udp dport { 12345, 54321 } ip6 saddr @s drop jump other }
@@ -51,7 +51,7 @@ table inet t { chain c { ct state new - udp dport { 12345 } + udp dport { 12345, 54321 } ip6 saddr @s drop jump other }
tests/shell/testcases/nft-f/0002rollback_rule_0 +1 -1
@@ -11,7 +11,7 @@ GOOD_RULESET="table ip t { chain c { ct state new - tcp dport { 22222 } + tcp dport { 22222, 33333 } ip saddr @t drop jump other }
tests/shell/testcases/nft-f/0003rollback_jump_0 +1 -1
@@ -11,7 +11,7 @@ GOOD_RULESET="table ip t { chain c { ct state new - tcp dport { 22222 } + tcp dport { 22222, 33333 } ip saddr @t drop jump other }
tests/shell/testcases/nft-f/0004rollback_set_0 +1 -1
@@ -11,7 +11,7 @@ GOOD_RULESET="table ip t { chain c { ct state new - tcp dport { 22222 } + tcp dport { 22222, 33333 } ip saddr @t drop jump other }
tests/shell/testcases/nft-f/0005rollback_map_0 +1 -1
@@ -11,7 +11,7 @@ GOOD_RULESET="table ip t { chain c { ct state new - tcp dport { 22222 } + tcp dport { 22222, 33333 } ip saddr @t drop jump other }
tests/shell/testcases/nft-f/0006action_object_0 +2 -2
@@ -16,11 +16,11 @@ generate1() add set $family t s {type inet_service;} add element $family t s {8080} insert rule $family t c meta l4proto tcp tcp dport @s accept - replace rule $family t c handle 2 meta l4proto tcp tcp dport {9090} + replace rule $family t c handle 2 meta l4proto tcp tcp dport {9090, 8080} add map $family t m {type inet_service:verdict;} add element $family t m {10080:drop} insert rule $family t c meta l4proto tcp tcp dport vmap @m - add rule $family t c meta l4proto udp udp sport vmap {1111:accept} + add rule $family t c meta l4proto udp udp sport vmap {1111:accept, 2222:drop} " }
tests/shell/testcases/nft-f/0016redefines_1 +2 -2
@@ -8,7 +8,7 @@ table ip x { define unused = 4.4.4.4 define address = { 1.1.1.1, 2.2.2.2 } ip saddr \$address - redefine address = { 3.3.3.3 } + redefine address = { 3.3.3.3, 4.4.4.4 } ip saddr \$address undefine unused }
@@ -17,7 +17,7 @@ table ip x { EXPECTED="table ip x { chain y { ip saddr { 1.1.1.1, 2.2.2.2 } - ip saddr { 3.3.3.3 } + ip saddr { 3.3.3.3, 4.4.4.4 } } }"
tests/shell/testcases/nft-f/dumps/0002rollback_rule_0.nft +1 -1
@@ -6,7 +6,7 @@ table ip t { chain c { ct state new - tcp dport { 22222 } + tcp dport { 22222, 33333 } ip saddr @t drop jump other }
tests/shell/testcases/nft-f/dumps/0003rollback_jump_0.nft +1 -1
@@ -6,7 +6,7 @@ table ip t { chain c { ct state new - tcp dport { 22222 } + tcp dport { 22222, 33333 } ip saddr @t drop jump other }
tests/shell/testcases/nft-f/dumps/0004rollback_set_0.nft +1 -1
@@ -6,7 +6,7 @@ table ip t { chain c { ct state new - tcp dport { 22222 } + tcp dport { 22222, 33333 } ip saddr @t drop jump other }
tests/shell/testcases/nft-f/dumps/0005rollback_map_0.nft +1 -1
@@ -6,7 +6,7 @@ table ip t { chain c { ct state new - tcp dport { 22222 } + tcp dport { 22222, 33333 } ip saddr @t drop jump other }
tests/shell/testcases/sets/0021nesting_0 +1 -0
@@ -5,6 +5,7 @@ set -e RULESET=' define set1 = { 2.2.2.0/24, + 3.3.3.0/24, } define set2 = { $set1,
Signature · 1 line
2.11.0