summaryrefslogtreecommitdiffstats
path: root/tests/shell
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-11-18 15:38:25 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-11-18 15:39:47 +0100
commit4a382ec54a8c09df1a625ddc7d32fc06257c596d (patch)
tree5077a7a81cf1d0c013b2caf8be49c39f25d6f7cd /tests/shell
parent816ce7261bdf9296307bad5cafe79e895f537978 (diff)
tests: shell: set reference from variable definition
Allow to define variable using set reference, eg. define x = @z Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell')
-rwxr-xr-xtests/shell/testcases/nft-f/0022variables_021
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/shell/testcases/nft-f/0022variables_0 b/tests/shell/testcases/nft-f/0022variables_0
new file mode 100755
index 00000000..ee17a627
--- /dev/null
+++ b/tests/shell/testcases/nft-f/0022variables_0
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+RULESET="define test1 = @y
+
+table ip x {
+ set y {
+ type ipv4_addr
+ flags dynamic,timeout
+ }
+
+ chain z {
+ type filter hook input priority filter; policy accept;
+ add \$test1 { ip saddr }
+ update \$test1 { ip saddr timeout 30s }
+ ip saddr \$test1
+ }
+}"
+
+$NFT -f - <<< "$RULESET"