netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] tests: shell: fix spurious dump failure in vmap timeout test
@ 2024-10-11  0:32 Florian Westphal
  2024-10-11  8:39 ` Phil Sutter
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2024-10-11  0:32 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

Blamed commit can update the timeout to 6s, but last line waits
for 5 seconds and expects that to be enough to have all elements vanish.

Fix the typo to limit update timeout also to 5 seconds and not 6.
This fixes spurious dump failures like this one:

-               elements = { 1.2.3.4 . 22 : jump ssh_input }
+               elements = { 1.2.3.4 . 22 : jump ssh_input,
+                            10.0.95.144 . 38023 timeout 6s expires 545ms : jump other_input }

Fixes: db80037c0279 ("tests: shell: extend vmap test with updates")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tests/shell/testcases/maps/vmap_timeout | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/shell/testcases/maps/vmap_timeout b/tests/shell/testcases/maps/vmap_timeout
index 3f0563afacac..6d73f3cc9ae2 100755
--- a/tests/shell/testcases/maps/vmap_timeout
+++ b/tests/shell/testcases/maps/vmap_timeout
@@ -32,7 +32,7 @@ for i in $(seq 1 100) ; do
 		timeout=$((timeout+1))
 		expire=$((RANDOM%timeout))
 		utimeout=$((RANDOM%5))
-		utimeout=$((timeout+1))
+		utimeout=$((utimeout+1))
 
 		timeout_str="timeout ${timeout}s"
 		expire_str=""
-- 
2.45.2


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

* Re: [PATCH nft] tests: shell: fix spurious dump failure in vmap timeout test
  2024-10-11  0:32 [PATCH nft] tests: shell: fix spurious dump failure in vmap timeout test Florian Westphal
@ 2024-10-11  8:39 ` Phil Sutter
  2024-10-11  9:15   ` Florian Westphal
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Sutter @ 2024-10-11  8:39 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

On Fri, Oct 11, 2024 at 02:32:08AM +0200, Florian Westphal wrote:
> Blamed commit can update the timeout to 6s, but last line waits
> for 5 seconds and expects that to be enough to have all elements vanish.
> 
> Fix the typo to limit update timeout also to 5 seconds and not 6.
> This fixes spurious dump failures like this one:
> 
> -               elements = { 1.2.3.4 . 22 : jump ssh_input }
> +               elements = { 1.2.3.4 . 22 : jump ssh_input,
> +                            10.0.95.144 . 38023 timeout 6s expires 545ms : jump other_input }
> 
> Fixes: db80037c0279 ("tests: shell: extend vmap test with updates")
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  tests/shell/testcases/maps/vmap_timeout | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/shell/testcases/maps/vmap_timeout b/tests/shell/testcases/maps/vmap_timeout
> index 3f0563afacac..6d73f3cc9ae2 100755
> --- a/tests/shell/testcases/maps/vmap_timeout
> +++ b/tests/shell/testcases/maps/vmap_timeout
> @@ -32,7 +32,7 @@ for i in $(seq 1 100) ; do
>  		timeout=$((timeout+1))
>  		expire=$((RANDOM%timeout))
>  		utimeout=$((RANDOM%5))
> -		utimeout=$((timeout+1))
> +		utimeout=$((utimeout+1))

How about merging the statements?

| utimeout=$((RANDOM % 5 + 1))

This applies to three spots in total.

Cheers, Phil

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

* Re: [PATCH nft] tests: shell: fix spurious dump failure in vmap timeout test
  2024-10-11  8:39 ` Phil Sutter
@ 2024-10-11  9:15   ` Florian Westphal
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2024-10-11  9:15 UTC (permalink / raw)
  To: Phil Sutter, Florian Westphal, netfilter-devel

Phil Sutter <phil@nwl.cc> wrote:
> >  		utimeout=$((RANDOM%5))
> > -		utimeout=$((timeout+1))
> > +		utimeout=$((utimeout+1))
> 
> How about merging the statements?
>
> | utimeout=$((RANDOM % 5 + 1))

Sure, that works too.  I applied the patch as-is, you can munge this as
a followup if you like.

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11  0:32 [PATCH nft] tests: shell: fix spurious dump failure in vmap timeout test Florian Westphal
2024-10-11  8:39 ` Phil Sutter
2024-10-11  9:15   ` Florian Westphal

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).