summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/flowtable/0012flowtable_variable_0
blob: 9c03820f128e30fe0e7048628b8cb59393206453 (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
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

# NFT_TEST_REQUIRES(NFT_TEST_HAVE_flowtable_counter)

set -e

iface_cleanup() {
	ip link del dummy1 &>/dev/null || :
}
trap 'iface_cleanup' EXIT
iface_cleanup

ip link add name dummy1 type dummy

EXPECTED="define if_main = { lo, dummy1 }

table filter1 {
	flowtable Main_ft1 {
		hook ingress priority filter
		counter
		devices = \$if_main
	}
}"

$NFT -f - <<< $EXPECTED

EXPECTED="define if_main = \"lo\"

table filter2 {
	flowtable Main_ft2 {
		hook ingress priority filter
		counter
		devices = { \$if_main, dummy1 }
	}
}"

$NFT -f - <<< $EXPECTED