summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-i/0001define_0
blob: 62e1b6dede21dd911476f3642c922abcec8346df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -e

# test if using defines in interactive nft sessions works

$NFT -i >/dev/null <<EOF
add table inet t
add chain inet t c
define ports = { 22, 443 }
add rule inet t c tcp dport \$ports accept
add rule inet t c udp dport \$ports accept
EOF

$NFT -i >/dev/null <<EOF
define port = 22
flush chain inet t c
redefine port = 443
delete chain inet t c
undefine port
delete table inet t
EOF