summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/optionals/update_object_handles_0
blob: 17c0c86cf9b0f2815b0abca326804629098e91e2 (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

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

EXPECTED="table ip test-ip {
	counter traffic-counter {
		packets 0 bytes 0
	}

	quota traffic-quota {
		50 mbytes
	}
}"

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