summaryrefslogtreecommitdiffstats
path: root/tests/py/inet/sets.t
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-05-09 12:18:20 +0200
committerFlorian Westphal <fw@strlen.de>2018-05-09 12:18:20 +0200
commit2efbdf7b8fcf79f3fa8a6471d2eca00df0c91108 (patch)
treea7020e985b188bd249202594a0ed8cf94f1d829c /tests/py/inet/sets.t
parent71624f25f22b1d750bb532ced75e080b4123fb56 (diff)
tests: py: allow to specify sets with a timeout
Not usable yet, as the set timeout netlink output isn't captured so far, but it adds groundwork to add this as a follow-up. Set definition syntax changes a little, if you want to add multiple elements they now have to be separated by "," just like in nftables. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/inet/sets.t')
-rw-r--r--tests/py/inet/sets.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/py/inet/sets.t b/tests/py/inet/sets.t
new file mode 100644
index 00000000..8f1cbff7
--- /dev/null
+++ b/tests/py/inet/sets.t
@@ -0,0 +1,18 @@
+:input;type filter hook input priority 0
+:ingress;type filter hook ingress device lo priority 0
+
+*inet;test-inet;input
+*bridge;test-inet;input
+*netdev;test-netdev;ingress
+
+!set1 type ipv4_addr timeout 60s;ok
+?set1 192.168.3.4 timeout 30s, 10.2.1.1;ok
+
+!set2 type ipv6_addr timeout 23d23h59m59s;ok
+?set2 dead::beef timeout 1s;ok
+
+ip saddr @set1 drop;ok
+ip saddr != @set2 drop;fail
+
+ip6 daddr != @set2 accept;ok
+ip6 daddr @set1 drop;fail