nftables/0005-tests-shell-Fix-sets-reset_command_0-for-current-ker.patch
Phil Sutter f6acf13f03 nftables-1.0.9-5.el9
* Thu Oct 16 2025 Phil Sutter <psutter@redhat.com> [1.0.9-5.el9]
- tests: py: missing json output in never merge across non-expression statements (Phil Sutter) [RHEL-114095]
- tests: py: add missing json.output data (Phil Sutter) [RHEL-114095]
- tests: py: remove huge-limit test cases (Phil Sutter) [RHEL-114095]
- datatype: rt_symbol_table_init() to search for iproute2 configs (Phil Sutter) [RHEL-114095]
- tests: shell: connect chains to hook point (Phil Sutter) [RHEL-114095]
- tests: shell: Fix sets/reset_command_0 for current kernels (Phil Sutter) [RHEL-114095]
Resolves: RHEL-114095
2025-10-16 16:20:12 +02:00

57 lines
2.1 KiB
Diff

From 1172955315cf4d14f0ddc53f26ff82447f0dadda Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Thu, 16 Oct 2025 16:12:09 +0200
Subject: [PATCH] tests: shell: Fix sets/reset_command_0 for current kernels
JIRA: https://issues.redhat.com/browse/RHEL-114095
Upstream Status: nftables commit 7a6089a400a573b9a4fd92f29c00a6be7b8ef269
commit 7a6089a400a573b9a4fd92f29c00a6be7b8ef269
Author: Phil Sutter <phil@nwl.cc>
Date: Thu Nov 2 16:02:14 2023 +0100
tests: shell: Fix sets/reset_command_0 for current kernels
Since kernel commit 4c90bba60c26 ("netfilter: nf_tables: do not refresh
timeout when resetting element"), element reset won't touch expiry
anymore. Invert the one check to make sure it remains unaltered, drop
the other testing behaviour for per-element timeouts.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Phil Sutter <psutter@redhat.com>
---
tests/shell/testcases/sets/reset_command_0 | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/tests/shell/testcases/sets/reset_command_0 b/tests/shell/testcases/sets/reset_command_0
index e663dac..d38ddb3 100755
--- a/tests/shell/testcases/sets/reset_command_0
+++ b/tests/shell/testcases/sets/reset_command_0
@@ -44,10 +44,10 @@ elem='element t s { 1.0.0.1 . udp . 53 }'
grep 'elements = ' | drop_seconds | uniq | wc -l) == 1 ]]
echo OK
-echo -n "counters and expiry are reset: "
+echo -n "counters are reset, expiry left alone: "
NEW=$($NFT "get $elem")
grep -q 'counter packets 0 bytes 0' <<< "$NEW"
-[[ $(expires_minutes <<< "$NEW") -gt 20 ]]
+[[ $(expires_minutes <<< "$NEW") -lt 20 ]]
echo OK
echo -n "get map elem matches reset map elem: "
@@ -80,12 +80,6 @@ OUT=$($NFT reset map t m)
$DIFF -u <(echo "$EXP") <(echo "$OUT")
echo OK
-echo -n "reset command respects per-element timeout: "
-VAL=$($NFT get element t s '{ 2.0.0.2 . tcp . 22 }' | expires_minutes)
-[[ $VAL -lt 15 ]] # custom timeout applies
-[[ $VAL -gt 10 ]] # expires was reset
-echo OK
-
echo -n "remaining elements are reset: "
OUT=$($NFT list ruleset)
grep -q '2.0.0.2 . tcp . 22 counter packets 0 bytes 0' <<< "$OUT"