summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/chains/0003jump_loop_1
diff options
context:
space:
mode:
authorArturo Borrero <arturo.borrero.glez@gmail.com>2016-03-22 14:06:09 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-03-23 12:09:29 +0100
commit7fa2b0534745f53881ec74a0a73d4f870ea4b026 (patch)
treeca2e06bcc30a239c50947fbc820388474b5a652c /tests/shell/testcases/chains/0003jump_loop_1
parent4de76d7f998ed7ef4698f4f5135457b4f58591a2 (diff)
tests/shell: add chain validations tests
Some basic test regarding chains: jumps and validations. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/chains/0003jump_loop_1')
-rwxr-xr-xtests/shell/testcases/chains/0003jump_loop_121
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/shell/testcases/chains/0003jump_loop_1 b/tests/shell/testcases/chains/0003jump_loop_1
new file mode 100755
index 00000000..f74361f2
--- /dev/null
+++ b/tests/shell/testcases/chains/0003jump_loop_1
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+MAX_JUMPS=16
+
+$NFT add table t
+
+for i in $(seq 1 $MAX_JUMPS)
+do
+ $NFT add chain t c${i}
+done
+
+for i in $(seq 1 $((MAX_JUMPS - 1)))
+do
+ $NFT add rule t c${i} jump c$((i + 1))
+done
+
+# this last jump should fail: loop
+$NFT add rule t c${MAX_JUMPS} jump c1 2>/dev/null
+echo "E: loop of jumps ignored?" >&2