summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-f/0028policy_variable_1
diff options
context:
space:
mode:
authorFernando Fernandez Mancera <ffmancera@riseup.net>2019-08-02 12:12:10 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-08-08 12:43:10 +0200
commitdba4a9b4b5fe2c4b6929be799fdb9332fc653e1b (patch)
tree800a99b457f9a37fd7790a8308c0d4ec33809510 /tests/shell/testcases/nft-f/0028policy_variable_1
parent627c451b2351310da9ad82dbdb64747b1fada8e5 (diff)
src: allow variable in chain policy
This patch allows you to use variables in chain policy definition, e.g. define default_policy = "accept" add table ip foo add chain ip foo bar {type filter hook input priority filter; policy $default_policy} Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/nft-f/0028policy_variable_1')
-rw-r--r--tests/shell/testcases/nft-f/0028policy_variable_118
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/shell/testcases/nft-f/0028policy_variable_1 b/tests/shell/testcases/nft-f/0028policy_variable_1
new file mode 100644
index 00000000..027eb015
--- /dev/null
+++ b/tests/shell/testcases/nft-f/0028policy_variable_1
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Tests use of variables in priority specification
+
+set -e
+
+RULESET="
+define default_policy = *
+
+table inet global {
+ chain prerouting {
+ type filter hook prerouting priority filter
+ policy \$default_policy
+ }
+}"
+
+$NFT -f - <<< "$RULESET" && exit 1
+exit 0