sharness: randomize swarm address too.
This may take care of the daemon clashing on travis.
Juan Batiz-Benet committed
May 10, 2015 at 08:27 UTC
c946dbede3f0be89244f3bd0b8938790479a3c89
1 file changed
+7
test/sharness/lib/test-lib.sh
+7
@@ -143,6 +143,12 @@ test_init_ipfs() {
143
PORT_GWAY=$((RANDOM % 3000 + 8100))
144
ADDR_GWAY="/ip4/127.0.0.1/tcp/$PORT_GWAY"
145
146
+ PORT_SWARM=$((RANDOM % 3000 + 12000))
147
+ ADDR_SWARM="[
148
+ \"/ip4/0.0.0.0/tcp/$PORT_SWARM\"
149
+]"
150
+
151
+
152
# we set the Addresses.API config variable.
153
# the cli client knows to use it, so only need to set.
154
# todo: in the future, use env?
@@ -158,6 +164,7 @@ test_init_ipfs() {
164
test_config_set Mounts.IPNS "$(pwd)/ipns" &&
165
test_config_set Addresses.API "$ADDR_API" &&
166
test_config_set Addresses.Gateway "$ADDR_GWAY" &&
167
+ test_config_set --json Addresses.Swarm "$ADDR_SWARM" &&
168
ipfs bootstrap rm --all ||
169
test_fsh cat "\"$IPFS_PATH/config\""
170
'