summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-f/0015defines_1
blob: 9c1a7013e62fa49ca311d13bae251b58d5169ca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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