From 4a382ec54a8c09df1a625ddc7d32fc06257c596d Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 18 Nov 2019 15:38:25 +0100 Subject: tests: shell: set reference from variable definition Allow to define variable using set reference, eg. define x = @z Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/nft-f/0022variables_0 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/shell/testcases/nft-f/0022variables_0 (limited to 'tests') 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" -- cgit v1.2.3