summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-f/0013defines_1
blob: 053700348c0be2f2f2e895b121683f2da0654df2 (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
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