summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets/0038meter_list_0
blob: e9e0f6fb02b14f28779b902f8b6f84232afea5df (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
#!/bin/bash

#
# Listing meters should not include dynamic sets in the output
#

set -e

RULESET="
  add table t
  add set t s { type ipv4_addr; size 256; flags dynamic,timeout; }
  add chain t c
  add rule t c tcp dport 80 meter m size 128 { ip saddr limit rate 10/second }
"

expected_output="table ip t {
	meter m {
		type ipv4_addr
		size 128
		flags dynamic
	}
}"

$NFT -f - <<< "$RULESET"

test_output=$($NFT list meters)

test "$test_output" = "$expected_output"