Skip to contentSkip to conversation

tests: shell: Fix bogus testsuite failure with 250Hz

PATCH In review Phil Sutter 3 participants 3 messages Nov 2, 2021 – Nov 3, 2021 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 tests: shell: Fix bogus testsuite failure with 250Hz

Previous fix for HZ=100 was not sufficient, a kernel with HZ=250 rounds the 10ms to 8ms it seems. Do as Lukas suggests and accept the occasional input/output asymmetry instead of continuing the hide'n'seek game.

Fixes c9c5b5f621c37 ("tests: shell: Fix bogus testsuite failure with 100Hz")
---
 tests/shell/testcases/sets/0031set_timeout_size_0 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/shell/testcases/sets/0031set_timeout_size_0 +1 -1
index 796640d64670a..9a4a27f6c4512 100755
@@ -8,5 +8,5 @@ add rule x test set update ip daddr timeout 100ms @y"
 
 set -e
 $NFT -f - <<< "$RULESET"
-$NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s10ms }'
+$NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s\(10\|8\)ms }'
 $NFT list chain x test | grep -q 'update @y { ip daddr timeout 100ms }'
Signature · 1 line
2.33.0
#1 lore raw
Quoted 7 lines · Phil Sutter

Previous fix for HZ=100 was not sufficient, a kernel with HZ=250 rounds the 10ms to 8ms it seems. Do as Lukas suggests and accept the occasional input/output asymmetry instead of continuing the hide'n'seek game.

Fixes c9c5b5f621c37 ("tests: shell: Fix bogus testsuite failure with 100Hz")

ACK

Quoted 18 lines
---
 tests/shell/testcases/sets/0031set_timeout_size_0 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/shell/testcases/sets/0031set_timeout_size_0 +1 -1
index 796640d64670a..9a4a27f6c4512 100755
@@ -8,5 +8,5 @@ add rule x test set update ip daddr timeout 100ms @y"
 
 set -e
 $NFT -f - <<< "$RULESET"
-$NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s10ms }'
+$NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s\(10\|8\)ms }'
 $NFT list chain x test | grep -q 'update @y { ip daddr timeout 100ms }'
Signature · 1 line
2.33.0
#2 lore raw
In reply to Phil Sutter
Quoted 3 lines · Phil Sutter

Previous fix for HZ=100 was not sufficient, a kernel with HZ=250 rounds the 10ms to 8ms it seems. Do as Lukas suggests and accept the occasional input/output asymmetry instead of continuing the hide'n'seek game.

[...]

tests/shell/testcases/sets/0031set_timeout_size_0 add rule x test set update ip daddr timeout 100ms @y" · line 12

Quoted 9 lines
tests/shell/testcases/sets/0031set_timeout_size_0 +1 -1
@@ -8,5 +8,5 @@ add rule x test set update ip daddr timeout 100ms @y"
 
 set -e
 $NFT -f - <<< "$RULESET"
-$NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s10ms }'
+$NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s\(10\|8\)ms }'
 $NFT list chain x test | grep -q 'update @y { ip daddr timeout 100ms }'

Thanks, LGTM.

(The backslashes preceding the ( | ) characters could be avoided with grep -E, but that's just a matter of personal preference.)