]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: add loop detection tests
authorPatrick McHardy <kaber@trash.net>
Mon, 10 Dec 2012 16:10:58 +0000 (17:10 +0100)
committerPatrick McHardy <kaber@trash.net>
Mon, 10 Dec 2012 16:11:16 +0000 (17:11 +0100)
Signed-off-by: Patrick McHardy <kaber@trash.net>
tests/loop-detect.1 [new file with mode: 0644]
tests/loop-detect.2 [new file with mode: 0644]
tests/loop-detect.3 [new file with mode: 0644]
tests/loop-detect.4 [new file with mode: 0644]

diff --git a/tests/loop-detect.1 b/tests/loop-detect.1
new file mode 100644 (file)
index 0000000..e55864c
--- /dev/null
@@ -0,0 +1,8 @@
+#! nft -f
+
+# Create table and empty chains for loop detection tests
+add table filter
+
+add chain filter chain1
+add chain filter chain2
+add chain filter chain3
diff --git a/tests/loop-detect.2 b/tests/loop-detect.2
new file mode 100644 (file)
index 0000000..88a95e0
--- /dev/null
@@ -0,0 +1,7 @@
+#! nft -f
+
+# Circular regular jumps: chain1 -> chain2 -> chain3 -> chain1
+flush table filter
+add filter chain1 jump chain2
+add filter chain2 jump chain3
+add filter chain3 jump chain1
diff --git a/tests/loop-detect.3 b/tests/loop-detect.3
new file mode 100644 (file)
index 0000000..3b83ef1
--- /dev/null
@@ -0,0 +1,7 @@
+#! nft -f
+
+# Circular jump when creating an anonymous verdict map: chain1 -> chain2 -> chain3 -> chain1
+flush table filter
+add filter chain1 jump chain2
+add filter chain2 jump chain3
+add filter chain3 ip daddr vmap { 10.0.0.1 => continue, 192.168.0.1 => jump chain1 }
diff --git a/tests/loop-detect.4 b/tests/loop-detect.4
new file mode 100644 (file)
index 0000000..f6f4d57
--- /dev/null
@@ -0,0 +1,7 @@
+#! nft -f
+
+# Circular jump with an intermediate anonymous verdict map: chain1 -> chain2 -> chain3 -> chain1
+flush table filter
+add filter chain1 jump chain2
+add filter chain2 ip daddr vmap { 10.0.0.1 => continue, 192.168.0.1 => jump chain3 }
+add filter chain3 jump chain1