1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

sharness/testlib: seed RANDOM

this is ugly. ideally would seed using date, but unclear
what a portable datetime is. date '+%s' doesnt work on osx.
This commit is contained in:
Juan Batiz-Benet
2015-03-02 07:40:26 -08:00
parent 25f042ce36
commit 04a3a66c6c

View File

@ -136,6 +136,7 @@ test_init_ipfs() {
# Using RANDOM like this is clearly wrong-- it samples with replacement
# and it doesnt even check the port is unused. this is a trivial stop gap
# until the proper solution is implemented.
RANDOM=$$
PORT_API=$((RANDOM % 3000 + 5100))
ADDR_API="/ip4/127.0.0.1/tcp/$PORT_API"