diff options
Diffstat (limited to 'tests/shell/testcases/nft-f/0013defines_1')
-rwxr-xr-x | tests/shell/testcases/nft-f/0013defines_1 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/shell/testcases/nft-f/0013defines_1 b/tests/shell/testcases/nft-f/0013defines_1 new file mode 100755 index 00000000..05370034 --- /dev/null +++ b/tests/shell/testcases/nft-f/0013defines_1 @@ -0,0 +1,25 @@ +#!/bin/bash + +# Tests use of variable before definition. + +set -e + +tmpfile=$(mktemp) +if [ ! -w $tmpfile ] ; then + echo "Failed to create tmp file" >&2 + exit 0 +fi + +trap "rm -rf $tmpfile" EXIT # cleanup if aborted + +echo " +define var2 = \$var1 +define var1 = lo + +table ip t { + chain c { + iif \$var2 + } +}" >> $tmpfile + +$NFT -f $tmpfile |