]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: cover split chain reference across tables
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 14 Jun 2021 18:51:11 +0000 (20:51 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 14 Jun 2021 18:53:18 +0000 (20:53 +0200)
Add a test to cover table T1 containing the definition of chain C1, and
table T1' (actually the same definition as T1) that contains a (jump)
reference to chain C1.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/nft-f/0027split_chains_0 [new file with mode: 0755]
tests/shell/testcases/nft-f/dumps/0027split_chains_0.nft [new file with mode: 0644]

diff --git a/tests/shell/testcases/nft-f/0027split_chains_0 b/tests/shell/testcases/nft-f/0027split_chains_0
new file mode 100755 (executable)
index 0000000..de1e5a0
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -e
+
+RULESET="table inet filter {
+       chain x {
+       }
+}
+table inet filter {
+       chain input {
+              type filter hook input priority filter; policy accept;
+              jump x
+       }
+}"
+
+$NFT -f - <<< "$RULESET" && exit 0
+exit 1
diff --git a/tests/shell/testcases/nft-f/dumps/0027split_chains_0.nft b/tests/shell/testcases/nft-f/dumps/0027split_chains_0.nft
new file mode 100644 (file)
index 0000000..39198be
--- /dev/null
@@ -0,0 +1,9 @@
+table inet filter {
+       chain x {
+       }
+
+       chain input {
+               type filter hook input priority filter; policy accept;
+               jump x
+       }
+}