summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-f/0015defines_1
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/nft-f/0015defines_1')
-rwxr-xr-xtests/shell/testcases/nft-f/0015defines_124
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/shell/testcases/nft-f/0015defines_1 b/tests/shell/testcases/nft-f/0015defines_1
new file mode 100755
index 00000000..9c1a7013
--- /dev/null
+++ b/tests/shell/testcases/nft-f/0015defines_1
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Tests recursive definition of a variable.
+
+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 var1 = \$var1
+
+table ip t {
+ chain c {
+ iif \$var1
+ }
+}" >> $tmpfile
+
+$NFT -f $tmpfile