summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2012-12-10 17:10:58 +0100
committerPatrick McHardy <kaber@trash.net>2012-12-10 17:11:16 +0100
commit4ddc2fd15d8bea177e0fb1c8b538e4ab30d1ec7f (patch)
treebe94050d20c83f262f8dce470b99642cc0e70ca5 /tests
parent176698a280d24840b745a7ab57c553655e7dd1a6 (diff)
tests: add loop detection tests
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/loop-detect.18
-rw-r--r--tests/loop-detect.27
-rw-r--r--tests/loop-detect.37
-rw-r--r--tests/loop-detect.47
4 files changed, 29 insertions, 0 deletions
diff --git a/tests/loop-detect.1 b/tests/loop-detect.1
new file mode 100644
index 00000000..e55864c8
--- /dev/null
+++ b/tests/loop-detect.1
@@ -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
index 00000000..88a95e0b
--- /dev/null
+++ b/tests/loop-detect.2
@@ -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
index 00000000..3b83ef12
--- /dev/null
+++ b/tests/loop-detect.3
@@ -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
index 00000000..f6f4d572
--- /dev/null
+++ b/tests/loop-detect.4
@@ -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