netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Haller <thaller@redhat.com>
To: NetFilter <netfilter-devel@vger.kernel.org>
Cc: Thomas Haller <thaller@redhat.com>
Subject: [PATCH nft 2/2] tests/shell: workaround lack of $SRANDOM before bash 5.1
Date: Mon, 27 Nov 2023 20:15:36 +0100	[thread overview]
Message-ID: <20231127191713.3528973-3-thaller@redhat.com> (raw)
In-Reply-To: <20231127191713.3528973-1-thaller@redhat.com>

$SRANDOM is only supported since bash 5.1. Add a fallback to $RANDOM.

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 tests/shell/run-tests.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index f1345bb14e7c..e54f8bf3e3ee 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")"
-- 
2.43.0


  parent reply	other threads:[~2023-11-27 19:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 19:15 [PATCH nft 0/2] tests/shell: workaround for bash Thomas Haller
2023-11-27 19:15 ` [PATCH nft 1/2] tests/shell: workaround lack of `wait -p` before bash 5.1 Thomas Haller
2023-11-27 19:15 ` Thomas Haller [this message]
2023-11-29 18:55 ` [PATCH nft 0/2] tests/shell: workaround for bash Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231127191713.3528973-3-thaller@redhat.com \
    --to=thaller@redhat.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).