summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/testcases/ipt-restore/0008-restore-counters_0
blob: 5ac70682b76bf7d23fab856d54f38ea1242553e6 (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

DUMP="*filter
:foo - [23:42]
[13:37] -A foo -j ACCEPT
COMMIT
"

EXPECT=":foo - [0:0]
[0:0] -A foo -j ACCEPT"

$XT_MULTI iptables-restore <<< "$DUMP"
diff -u -Z <(echo -e "$EXPECT") <($XT_MULTI iptables-save --counters | grep foo)

# iptables-*-restore ignores custom chain counters :(
EXPECT=":foo - [0:0]
[13:37] -A foo -j ACCEPT"

$XT_MULTI iptables-restore --counters <<< "$DUMP"
diff -u -Z <(echo -e "$EXPECT") <($XT_MULTI iptables-save --counters | grep foo)