summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets/dumps
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2022-04-09 15:58:30 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2022-04-13 13:43:38 +0200
commit4c6681a7b2ee8e0d912fb2ba74ceb64ee9b16bfd (patch)
treee1513f50a5569bc503ad7721089bbd277e25e83a /tests/shell/testcases/sets/dumps
parent5e393ea1fc0ad6b59e90103bf83e93b2449d519e (diff)
tests: add testcases for interface names in sets
Add initial test case, sets with names and interfaces, anonymous and named ones. Check match+no-match. netns with ppp1 and ppq veth, send packets via both interfaces. Rule counters should have incremented on the three rules. (that match on set that have "abcdef1" or "abcdef*" strings in them). Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/sets/dumps')
-rw-r--r--tests/shell/testcases/sets/dumps/sets_with_ifnames.nft28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/shell/testcases/sets/dumps/sets_with_ifnames.nft b/tests/shell/testcases/sets/dumps/sets_with_ifnames.nft
new file mode 100644
index 00000000..12c1aa96
--- /dev/null
+++ b/tests/shell/testcases/sets/dumps/sets_with_ifnames.nft
@@ -0,0 +1,28 @@
+table inet testifsets {
+ set simple {
+ type ifname
+ elements = { "abcdef0",
+ "abcdef1",
+ "othername" }
+ }
+
+ set simple_wild {
+ type ifname
+ flags interval
+ elements = { "abcdef*",
+ "othername",
+ "ppp0" }
+ }
+
+ chain v4icmp {
+ iifname @simple counter packets 0 bytes 0
+ iifname @simple_wild counter packets 0 bytes 0
+ iifname { "eth0", "abcdef0" } counter packets 0 bytes 0
+ iifname { "abcdef*", "eth0" } counter packets 0 bytes 0
+ }
+
+ chain input {
+ type filter hook input priority filter; policy accept;
+ ip protocol icmp goto v4icmp
+ }
+}