summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/optionals/log_prefix_0
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-07-07 17:42:37 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-07-08 11:25:25 +0200
commite76bb379401816bbea773e73b524cd747324760a (patch)
tree226b13363d4c3ecc36919645cf94c82e16733661 /tests/shell/testcases/optionals/log_prefix_0
parent8f56db64be3f2c57a196a5eaef0286ec71782950 (diff)
src: allow for variables in the log prefix string
For example: define test = "state" define foo = "match" table x { chain y { ct state invalid log prefix "invalid $test $foo:" } } This patch scans for variables in the log prefix string. The log prefix expression is a list of constant and variable expression that are converted into a constant expression from the evaluation phase. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/optionals/log_prefix_0')
-rwxr-xr-xtests/shell/testcases/optionals/log_prefix_016
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/shell/testcases/optionals/log_prefix_0 b/tests/shell/testcases/optionals/log_prefix_0
new file mode 100755
index 00000000..513a9e74
--- /dev/null
+++ b/tests/shell/testcases/optionals/log_prefix_0
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+set -e
+
+TMP=$(mktemp)
+
+RULESET='define test = "state"
+define foo = "match, logging"
+
+table x {
+ chain y {
+ ct state invalid log prefix "invalid $test $foo:"
+ }
+}'
+
+$NFT -f - <<< "$RULESET"