netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nft PATCH v2] tests: shell: Fix sets/reset_command_0 for current kernels
@ 2023-11-02 17:57 Phil Sutter
  2023-11-22 17:58 ` Phil Sutter
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2023-11-02 17:57 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, Thomas Haller

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>
---
Changes since v1:
- Assume behaviour is permanent, explicitly test for it
- Move comment content into commit message
---
 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 e663dac831f8c..d38ddb3ffeebb 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"
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [nft PATCH v2] tests: shell: Fix sets/reset_command_0 for current kernels
  2023-11-02 17:57 [nft PATCH v2] tests: shell: Fix sets/reset_command_0 for current kernels Phil Sutter
@ 2023-11-22 17:58 ` Phil Sutter
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Sutter @ 2023-11-22 17:58 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, Thomas Haller

On Thu, Nov 02, 2023 at 06:57:54PM +0100, Phil Sutter wrote:
> 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>

Patch applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-22 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-02 17:57 [nft PATCH v2] tests: shell: Fix sets/reset_command_0 for current kernels Phil Sutter
2023-11-22 17:58 ` Phil Sutter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).