diff options
author | Patrick McHardy <kaber@trash.net> | 2012-12-10 17:10:58 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2012-12-10 17:11:16 +0100 |
commit | 4ddc2fd15d8bea177e0fb1c8b538e4ab30d1ec7f (patch) | |
tree | be94050d20c83f262f8dce470b99642cc0e70ca5 | |
parent | 176698a280d24840b745a7ab57c553655e7dd1a6 (diff) |
tests: add loop detection tests
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | tests/loop-detect.1 | 8 | ||||
-rw-r--r-- | tests/loop-detect.2 | 7 | ||||
-rw-r--r-- | tests/loop-detect.3 | 7 | ||||
-rw-r--r-- | tests/loop-detect.4 | 7 |
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 |