summaryrefslogtreecommitdiffstats
path: root/tests/shell/features/stateful_object_update.sh
blob: 62fbf7e385631c64f0da2c953914d5f47ea6adc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# d62d0ba97b58 ("netfilter: nf_tables: Introduce stateful object update operation")
# v5.4-rc1~131^2~59^2~2

set -e
$NFT add table test-ip
$NFT add quota test-ip traffic-quota 25 mbytes
$NFT add quota test-ip traffic-quota 50 mbytes

EXPECTED="table ip test-ip {
	quota traffic-quota {
		50 mbytes
	}
}"

GET="$($NFT list ruleset)"
if [ "$EXPECTED" != "$GET" ] ; then
	diff -u <(echo "$EXPECTED") <(echo "$GET")
	exit 1
fi