]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: Add test case for jump chain.
authorVarsha Rao <rvarsha016@gmail.com>
Wed, 11 Oct 2017 04:41:37 +0000 (10:11 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 17 Oct 2017 12:01:48 +0000 (14:01 +0200)
This patch adds test case for checking jump to non existing chain.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/chains/0015check_jump_loop_1 [new file with mode: 0755]

diff --git a/tests/shell/testcases/chains/0015check_jump_loop_1 b/tests/shell/testcases/chains/0015check_jump_loop_1
new file mode 100755 (executable)
index 0000000..ba40ddb
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+$NFT add table t
+$NFT add chain t c1
+$NFT add chain t c2
+$NFT add t c1 jump c2
+# kernel should return ENOENT
+$NFT add t c2 ip daddr vmap { 1 : jump c3 }
+echo "E: Jumped to non existing chain" >&2