All of lore.kernel.org
 help / color / mirror / Atom feed
* [nft PATCH] tests: shell: Join arithmetic statements in maps/vmap_timeout
@ 2024-10-11  9:25 Phil Sutter
  2024-10-11  9:27 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Sutter @ 2024-10-11  9:25 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

In light of the recent typo fix, go an extra step and merge the modulo
and offset adjustment in a single term.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 tests/shell/testcases/maps/vmap_timeout | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tests/shell/testcases/maps/vmap_timeout b/tests/shell/testcases/maps/vmap_timeout
index 6d73f3cc9ae24..8ac7e8e7684ab 100755
--- a/tests/shell/testcases/maps/vmap_timeout
+++ b/tests/shell/testcases/maps/vmap_timeout
@@ -9,8 +9,7 @@ $NFT -f $dumpfile
 
 port=23
 for i in $(seq 1 100) ; do
-	timeout=$((RANDOM%5))
-	timeout=$((timeout+1))
+	timeout=$((RANDOM % 5 + 1))
 	expire=$((RANDOM%timeout))
 	j=1
 
@@ -28,11 +27,9 @@ for i in $(seq 1 100) ; do
 
 	port=$((port + 1))
 	for j in $(seq 2 400); do
-		timeout=$((RANDOM%5))
-		timeout=$((timeout+1))
+		timeout=$((RANDOM % 5 + 1))
 		expire=$((RANDOM%timeout))
-		utimeout=$((RANDOM%5))
-		utimeout=$((utimeout+1))
+		utimeout=$((RANDOM % 5 + 1))
 
 		timeout_str="timeout ${timeout}s"
 		expire_str=""
-- 
2.43.0


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

* Re: [nft PATCH] tests: shell: Join arithmetic statements in maps/vmap_timeout
  2024-10-11  9:25 [nft PATCH] tests: shell: Join arithmetic statements in maps/vmap_timeout Phil Sutter
@ 2024-10-11  9:27 ` Pablo Neira Ayuso
  2024-10-11  9:37   ` Phil Sutter
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2024-10-11  9:27 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netfilter-devel, fw

On Fri, Oct 11, 2024 at 11:25:08AM +0200, Phil Sutter wrote:
> In light of the recent typo fix, go an extra step and merge the modulo
> and offset adjustment in a single term.

LGTM.

> Signed-off-by: Phil Sutter <phil@nwl.cc>
> ---
>  tests/shell/testcases/maps/vmap_timeout | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/shell/testcases/maps/vmap_timeout b/tests/shell/testcases/maps/vmap_timeout
> index 6d73f3cc9ae24..8ac7e8e7684ab 100755
> --- a/tests/shell/testcases/maps/vmap_timeout
> +++ b/tests/shell/testcases/maps/vmap_timeout
> @@ -9,8 +9,7 @@ $NFT -f $dumpfile
>  
>  port=23
>  for i in $(seq 1 100) ; do
> -	timeout=$((RANDOM%5))
> -	timeout=$((timeout+1))
> +	timeout=$((RANDOM % 5 + 1))
>  	expire=$((RANDOM%timeout))
>  	j=1
>  
> @@ -28,11 +27,9 @@ for i in $(seq 1 100) ; do
>  
>  	port=$((port + 1))
>  	for j in $(seq 2 400); do
> -		timeout=$((RANDOM%5))
> -		timeout=$((timeout+1))
> +		timeout=$((RANDOM % 5 + 1))
>  		expire=$((RANDOM%timeout))
> -		utimeout=$((RANDOM%5))
> -		utimeout=$((utimeout+1))
> +		utimeout=$((RANDOM % 5 + 1))
>  
>  		timeout_str="timeout ${timeout}s"
>  		expire_str=""
> -- 
> 2.43.0
> 

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

* Re: [nft PATCH] tests: shell: Join arithmetic statements in maps/vmap_timeout
  2024-10-11  9:27 ` Pablo Neira Ayuso
@ 2024-10-11  9:37   ` Phil Sutter
  0 siblings, 0 replies; 3+ messages in thread
From: Phil Sutter @ 2024-10-11  9:37 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel, fw

On Fri, Oct 11, 2024 at 11:27:37AM +0200, Pablo Neira Ayuso wrote:
> On Fri, Oct 11, 2024 at 11:25:08AM +0200, Phil Sutter wrote:
> > In light of the recent typo fix, go an extra step and merge the modulo
> > and offset adjustment in a single term.
> 
> LGTM.

Patch applied, thanks guys!

Cheers, Phil

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

end of thread, other threads:[~2024-10-11  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11  9:25 [nft PATCH] tests: shell: Join arithmetic statements in maps/vmap_timeout Phil Sutter
2024-10-11  9:27 ` Pablo Neira Ayuso
2024-10-11  9:37   ` Phil Sutter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.