From: Pablo Neira Ayuso Date: Mon, 18 Nov 2019 14:38:25 +0000 (+0100) Subject: tests: shell: set reference from variable definition X-Git-Tag: v0.9.3~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a382ec54a8c09df1a625ddc7d32fc06257c596d;p=thirdparty%2Fnftables.git tests: shell: set reference from variable definition Allow to define variable using set reference, eg. define x = @z Signed-off-by: Pablo Neira Ayuso --- 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"