summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-05-24 21:12:56 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-05-31 17:57:31 +0200
commit27f6a4c68b4fdc351890d9a675603fefc48f7353 (patch)
treeb4c1cd44b2d5758b4b93da19acb28db42338fa64 /tests/shell/testcases
parenta35e3a0cdc63a1e177a9950e3f8e73ce862d3163 (diff)
tests: replace single element sets
Add at least two elements to sets. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases')
-rwxr-xr-xtests/shell/testcases/cache/0001_cache_handling_04
-rw-r--r--tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft6
-rwxr-xr-xtests/shell/testcases/listing/0011sets_08
-rwxr-xr-xtests/shell/testcases/netns/0001nft-f_06
-rwxr-xr-xtests/shell/testcases/netns/0002loosecommands_04
-rwxr-xr-xtests/shell/testcases/netns/0003many_06
-rwxr-xr-xtests/shell/testcases/nft-f/0002rollback_rule_02
-rwxr-xr-xtests/shell/testcases/nft-f/0003rollback_jump_02
-rwxr-xr-xtests/shell/testcases/nft-f/0004rollback_set_02
-rwxr-xr-xtests/shell/testcases/nft-f/0005rollback_map_02
-rwxr-xr-xtests/shell/testcases/nft-f/0006action_object_04
-rwxr-xr-xtests/shell/testcases/nft-f/0016redefines_14
-rw-r--r--tests/shell/testcases/nft-f/dumps/0002rollback_rule_0.nft2
-rw-r--r--tests/shell/testcases/nft-f/dumps/0003rollback_jump_0.nft2
-rw-r--r--tests/shell/testcases/nft-f/dumps/0004rollback_set_0.nft2
-rw-r--r--tests/shell/testcases/nft-f/dumps/0005rollback_map_0.nft2
-rwxr-xr-xtests/shell/testcases/sets/0021nesting_01
17 files changed, 30 insertions, 29 deletions
diff --git a/tests/shell/testcases/cache/0001_cache_handling_0 b/tests/shell/testcases/cache/0001_cache_handling_0
index f3dc9a34..431aada5 100755
--- a/tests/shell/testcases/cache/0001_cache_handling_0
+++ b/tests/shell/testcases/cache/0001_cache_handling_0
@@ -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
}
}'
diff --git a/tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft b/tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft
index f6dd6541..20998652 100644
--- a/tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft
+++ b/tests/shell/testcases/cache/dumps/0001_cache_handling_0.nft
@@ -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
}
}
diff --git a/tests/shell/testcases/listing/0011sets_0 b/tests/shell/testcases/listing/0011sets_0
index f021962a..aac9eac9 100755
--- a/tests/shell/testcases/listing/0011sets_0
+++ b/tests/shell/testcases/listing/0011sets_0
@@ -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
diff --git a/tests/shell/testcases/netns/0001nft-f_0 b/tests/shell/testcases/netns/0001nft-f_0
index 83448087..81942263 100755
--- a/tests/shell/testcases/netns/0001nft-f_0
+++ b/tests/shell/testcases/netns/0001nft-f_0
@@ -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
}
diff --git a/tests/shell/testcases/netns/0002loosecommands_0 b/tests/shell/testcases/netns/0002loosecommands_0
index e6278280..465c2e86 100755
--- a/tests/shell/testcases/netns/0002loosecommands_0
+++ b/tests/shell/testcases/netns/0002loosecommands_0
@@ -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
}
diff --git a/tests/shell/testcases/netns/0003many_0 b/tests/shell/testcases/netns/0003many_0
index 61ad37bd..a5fcb5d6 100755
--- a/tests/shell/testcases/netns/0003many_0
+++ b/tests/shell/testcases/netns/0003many_0
@@ -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
}
diff --git a/tests/shell/testcases/nft-f/0002rollback_rule_0 b/tests/shell/testcases/nft-f/0002rollback_rule_0
index da3cdc0b..33e1212d 100755
--- a/tests/shell/testcases/nft-f/0002rollback_rule_0
+++ b/tests/shell/testcases/nft-f/0002rollback_rule_0
@@ -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
}
diff --git a/tests/shell/testcases/nft-f/0003rollback_jump_0 b/tests/shell/testcases/nft-f/0003rollback_jump_0
index 1238f150..294a234e 100755
--- a/tests/shell/testcases/nft-f/0003rollback_jump_0
+++ b/tests/shell/testcases/nft-f/0003rollback_jump_0
@@ -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
}
diff --git a/tests/shell/testcases/nft-f/0004rollback_set_0 b/tests/shell/testcases/nft-f/0004rollback_set_0
index 25fc870c..512840ef 100755
--- a/tests/shell/testcases/nft-f/0004rollback_set_0
+++ b/tests/shell/testcases/nft-f/0004rollback_set_0
@@ -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
}
diff --git a/tests/shell/testcases/nft-f/0005rollback_map_0 b/tests/shell/testcases/nft-f/0005rollback_map_0
index 90108e72..b1eb3dd3 100755
--- a/tests/shell/testcases/nft-f/0005rollback_map_0
+++ b/tests/shell/testcases/nft-f/0005rollback_map_0
@@ -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
}
diff --git a/tests/shell/testcases/nft-f/0006action_object_0 b/tests/shell/testcases/nft-f/0006action_object_0
index b9766f2d..ffa6c9bd 100755
--- a/tests/shell/testcases/nft-f/0006action_object_0
+++ b/tests/shell/testcases/nft-f/0006action_object_0
@@ -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}
"
}
diff --git a/tests/shell/testcases/nft-f/0016redefines_1 b/tests/shell/testcases/nft-f/0016redefines_1
index d0148d65..4c26b379 100755
--- a/tests/shell/testcases/nft-f/0016redefines_1
+++ b/tests/shell/testcases/nft-f/0016redefines_1
@@ -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 }
}
}"
diff --git a/tests/shell/testcases/nft-f/dumps/0002rollback_rule_0.nft b/tests/shell/testcases/nft-f/dumps/0002rollback_rule_0.nft
index f6f26158..3fad9090 100644
--- a/tests/shell/testcases/nft-f/dumps/0002rollback_rule_0.nft
+++ b/tests/shell/testcases/nft-f/dumps/0002rollback_rule_0.nft
@@ -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
}
diff --git a/tests/shell/testcases/nft-f/dumps/0003rollback_jump_0.nft b/tests/shell/testcases/nft-f/dumps/0003rollback_jump_0.nft
index f6f26158..3fad9090 100644
--- a/tests/shell/testcases/nft-f/dumps/0003rollback_jump_0.nft
+++ b/tests/shell/testcases/nft-f/dumps/0003rollback_jump_0.nft
@@ -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
}
diff --git a/tests/shell/testcases/nft-f/dumps/0004rollback_set_0.nft b/tests/shell/testcases/nft-f/dumps/0004rollback_set_0.nft
index f6f26158..3fad9090 100644
--- a/tests/shell/testcases/nft-f/dumps/0004rollback_set_0.nft
+++ b/tests/shell/testcases/nft-f/dumps/0004rollback_set_0.nft
@@ -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
}
diff --git a/tests/shell/testcases/nft-f/dumps/0005rollback_map_0.nft b/tests/shell/testcases/nft-f/dumps/0005rollback_map_0.nft
index f6f26158..3fad9090 100644
--- a/tests/shell/testcases/nft-f/dumps/0005rollback_map_0.nft
+++ b/tests/shell/testcases/nft-f/dumps/0005rollback_map_0.nft
@@ -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
}
diff --git a/tests/shell/testcases/sets/0021nesting_0 b/tests/shell/testcases/sets/0021nesting_0
index c8d8f057..0b90dc7c 100755
--- a/tests/shell/testcases/sets/0021nesting_0
+++ b/tests/shell/testcases/sets/0021nesting_0
@@ -5,6 +5,7 @@ set -e
RULESET='
define set1 = {
2.2.2.0/24,
+ 3.3.3.0/24,
}
define set2 = {
$set1,