From 2efbdf7b8fcf79f3fa8a6471d2eca00df0c91108 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 9 May 2018 12:18:20 +0200 Subject: 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 --- tests/py/inet/sets.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/py/inet/sets.t (limited to 'tests/py/inet/sets.t') 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 -- cgit v1.2.3