summaryrefslogtreecommitdiffstats
path: root/tests/py/ip/ct.t
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-01-04 20:53:52 +0100
committerFlorian Westphal <fw@strlen.de>2016-01-04 20:54:13 +0100
commit399d11797bd2c2d5e8f793081cd81832fe872889 (patch)
treec82596fb1828f70f83da416f8eb7ceb72d1f0390 /tests/py/ip/ct.t
parent2d81dd1fdf13571ee95d4c1c3cde03b5774a0084 (diff)
tests: add ct tests for ip family
Cannot check e.g. saddr for 192.168.0.1 for 'any' protocol, nft needs to expect arguments of a specific address type. So e.g. when using 'inet' we need to add a rule that makes the expected family explicit, e.g. 'meta nfproto ipv4'. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/ip/ct.t')
-rw-r--r--tests/py/ip/ct.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/py/ip/ct.t b/tests/py/ip/ct.t
new file mode 100644
index 00000000..28ad7660
--- /dev/null
+++ b/tests/py/ip/ct.t
@@ -0,0 +1,23 @@
+*ip;test-ip4
+
+:output;type filter hook output priority 0
+
+ct saddr original 192.168.0.1;ok
+ct saddr reply 192.168.0.1;ok
+ct daddr original 192.168.0.1;ok
+ct daddr reply 192.168.0.1;ok
+
+# same, but with a netmask
+ct saddr original 192.168.1.0/24;ok
+ct saddr reply 192.168.1.0/24;ok
+ct daddr original 192.168.1.0/24;ok
+ct daddr reply 192.168.1.0/24;ok
+
+ct l3proto original ipv4;ok
+ct l3proto reply foobar;fail
+
+ct protocol original 6 ct proto-dst original 22;ok
+ct protocol original 17 ct proto-src reply 53;ok
+
+# wrong address family
+ct daddr reply dead::beef;fail