From b22bdfcbe8ed5d9a7594fa9ab9f17cf0255b18b8 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 26 Aug 2016 15:44:04 +0930 Subject: [PATCH] test: use random port/rpcport for bitcoind. This means we don't get confused if a testnet bitcoind already running. Signed-off-by: Rusty Russell --- daemon/test/scripts/setup.sh | 6 ++++++ daemon/test/scripts/vars.sh | 6 ++++++ daemon/test/test.sh | 4 +--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/daemon/test/scripts/setup.sh b/daemon/test/scripts/setup.sh index e7ada945c..af6208344 100755 --- a/daemon/test/scripts/setup.sh +++ b/daemon/test/scripts/setup.sh @@ -11,10 +11,16 @@ fi rm -rf $DATADIR mkdir $DATADIR +# Find a free port (racy, but hey) +PORT=`findport 18332` +RPCPORT=`findport $(($PORT + 1))` + # Create appropriate config file so cmdline matches. cat > $DATADIR/bitcoin.conf <> $DIR2/config + echo port=`findport 4000` >> $DIR2/config fi if [ -n "$DIFFERENT_FEES" ]; then