From 4c6681a7b2ee8e0d912fb2ba74ceb64ee9b16bfd Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Sat, 9 Apr 2022 15:58:30 +0200 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- .../testcases/sets/dumps/sets_with_ifnames.nft | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/shell/testcases/sets/dumps/sets_with_ifnames.nft (limited to 'tests/shell/testcases/sets/dumps') 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 + } +} -- cgit v1.2.3