]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: Join arithmetic statements in maps/vmap_timeout
authorPhil Sutter <phil@nwl.cc>
Fri, 11 Oct 2024 09:22:44 +0000 (11:22 +0200)
committerPhil Sutter <phil@nwl.cc>
Fri, 11 Oct 2024 09:37:02 +0000 (11:37 +0200)
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

index 6d73f3cc9ae249352a13c13cd0c02631838b2fc2..8ac7e8e7684ab92ac759f7f6a0be9751ae225887 100755 (executable)
@@ -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=""