Skip to contentSkip to conversation

tests: shell: fix spurious dump failure in vmap timeout test

PATCH In review Florian Westphal 2 participants 3 messages Oct 11, 2024 netfilter

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 tests: shell: fix spurious dump failure in vmap timeout test

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")
---
 tests/shell/testcases/maps/vmap_timeout | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/shell/testcases/maps/vmap_timeout +1 -1
index 3f0563afacac..6d73f3cc9ae2 100755
@@ -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=""
Signature · 1 line
2.45.2
reviewer
#1 lore raw
Quoted 21 lines · 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:

(quoted diff) +2 -1
-               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")
---
 tests/shell/testcases/maps/vmap_timeout | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/shell/testcases/maps/vmap_timeout +0 -0
index 3f0563afacac..6d73f3cc9ae2 100755

tests/shell/testcases/maps/vmap_timeout for i in $(seq 1 100) ; do · line 35

Quoted 5 lines
tests/shell/testcases/maps/vmap_timeout +1 -1
@@ -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

author maintainer
#2 lore raw
Quoted 7 lines · Phil Sutter

tests/shell/testcases/maps/vmap_timeout for i in $(seq 1 100) ; do · line 35

Quoted 3 lines
tests/shell/testcases/maps/vmap_timeout +1 -1
 		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.