diff options
author | Eyal Soha <eyalsoha@google.com> | 2020-03-04 00:14:41 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-04 00:15:49 -0800 |
commit | ef1219c1451a75916693a54ddad39d04cf763d90 (patch) | |
tree | 1db58ad611496fa889a0f704f9539814f0c31d32 | |
parent | d949c33143bd934a42d6a0645483d32526d858a2 (diff) |
Use shuf instead of $RANDOM everywhere.
$RANDOM can cause collisions but shuf uses /dev/urandom so it ought to cause
fewer.
PiperOrigin-RevId: 298786344
-rwxr-xr-x | test/packetdrill/packetdrill_test.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/packetdrill/packetdrill_test.sh b/test/packetdrill/packetdrill_test.sh index 0b22dfd5c..c8268170f 100755 --- a/test/packetdrill/packetdrill_test.sh +++ b/test/packetdrill/packetdrill_test.sh @@ -91,8 +91,8 @@ fi # Variables specific to the test runner start with TEST_RUNNER_. declare -r PACKETDRILL="/packetdrill/gtests/net/packetdrill/packetdrill" # Use random numbers so that test networks don't collide. -declare -r CTRL_NET="ctrl_net-${RANDOM}${RANDOM}" -declare -r TEST_NET="test_net-${RANDOM}${RANDOM}" +declare -r CTRL_NET="ctrl_net-$(shuf -i 0-99999999 -n 1)" +declare -r TEST_NET="test_net-$(shuf -i 0-99999999 -n 1)" declare -r tolerance_usecs=100000 # On both DUT and test runner, testing packets are on the eth2 interface. declare -r TEST_DEVICE="eth2" |