summaryrefslogtreecommitdiffstats
path: root/tests/shell/run-tests.sh
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-11-27 20:15:36 +0100
committerFlorian Westphal <fw@strlen.de>2023-11-28 02:06:52 +0100
commit50ed58323883c238f5809d471c677662a427d41b (patch)
tree6624a069b665669535a4104ca12439507fb5dac7 /tests/shell/run-tests.sh
parentf03ca7390f8b923d4302b08941ad9e87440240f9 (diff)
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 <thaller@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/run-tests.sh')
-rwxr-xr-xtests/shell/run-tests.sh1
1 files changed, 1 insertions, 0 deletions
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")"