diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-08-26 00:41:43 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-08-26 18:38:21 +0200 |
commit | 7886acd7f6f4d08498bf271126496f4c92c02140 (patch) | |
tree | c164938cf29746223be01ae6c227e51414da999e /tests/shell/testcases | |
parent | dbff26bfba8336c485a270509440e94bc1240d08 (diff) |
tests: shell: cover anonymous set with reset command
Extend existing test to reset counters for rules with anonymous set.
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1763
Tested-by: Eric Garver <eric@garver.life>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases')
-rwxr-xr-x | tests/shell/testcases/rule_management/0011reset_0 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/shell/testcases/rule_management/0011reset_0 b/tests/shell/testcases/rule_management/0011reset_0 index 3fede56f..2004b17d 100755 --- a/tests/shell/testcases/rule_management/0011reset_0 +++ b/tests/shell/testcases/rule_management/0011reset_0 @@ -4,6 +4,27 @@ set -e +echo "loading ruleset with anonymous set" +$NFT -f - <<EOF +table t { + chain dns-nat-pre { + type nat hook prerouting priority filter; policy accept; + meta l4proto { tcp, udp } th dport 53 ip saddr 10.24.0.0/24 ip daddr != 10.25.0.1 counter packets 1000 bytes 1000 dnat to 10.25.0.1 + } +} +EOF + +echo "resetting ruleset with anonymous set" +$NFT reset rules +EXPECT='table ip t { + chain dns-nat-pre { + type nat hook prerouting priority filter; policy accept; + meta l4proto { tcp, udp } th dport 53 ip saddr 10.24.0.0/24 ip daddr != 10.25.0.1 counter packets 0 bytes 0 dnat to 10.25.0.1 + } +}' +$DIFF -u <(echo "$EXPECT") <($NFT list ruleset) +$NFT flush ruleset + echo "loading ruleset" $NFT -f - <<EOF table ip t { |