From: Thomas Haller Date: Mon, 27 Nov 2023 19:15:36 +0000 (+0100) Subject: tests/shell: workaround lack of $SRANDOM before bash 5.1 X-Git-Tag: v1.1.0~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50ed58323883c238f5809d471c677662a427d41b;p=thirdparty%2Fnftables.git tests/shell: workaround lack of $SRANDOM before bash 5.1 $SRANDOM is only supported since bash 5.1. Add a fallback to $RANDOM. Signed-off-by: Thomas Haller Signed-off-by: Florian Westphal --- diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh index f1345bb1..e54f8bf3 100755 --- a/tests/shell/run-tests.sh +++ b/tests/shell/run-tests.sh @@ -314,6 +314,7 @@ DO_LIST_TESTS= if [ -z "$NFT_TEST_RANDOM_SEED" ] ; then # Choose a random value. n="$SRANDOM" + [ -z "$n" ] && n="$RANDOM" else # Parse as number. n="$(strtonum "$NFT_TEST_RANDOM_SEED")"