From 04a3a66c6ca59a32b707de620a92c8e0ec9aa341 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Mon, 2 Mar 2015 07:40:26 -0800 Subject: [PATCH] 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. --- test/sharness/lib/test-lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/sharness/lib/test-lib.sh b/test/sharness/lib/test-lib.sh index a04e42320..bc1be0be9 100644 --- a/test/sharness/lib/test-lib.sh +++ b/test/sharness/lib/test-lib.sh @@ -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"