From 4bd0284a1558f5d8c1edb07aa7ac591df1c1f935 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 8 Nov 2016 21:51:55 +1030 Subject: [PATCH] test: only start up/shutdown bitcoind if not already running. Signed-off-by: Rusty Russell --- daemon/test/test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/daemon/test/test.sh b/daemon/test/test.sh index 7d54049ac..0fdee03a9 100755 --- a/daemon/test/test.sh +++ b/daemon/test/test.sh @@ -5,7 +5,13 @@ cd `git rev-parse --show-toplevel`/daemon/test . scripts/vars.sh -scripts/setup.sh +# If bitcoind not already running, start it. +if ! $CLI getinfo >/dev/null 2>&1; then + scripts/setup.sh + SHUTDOWN_BITCOIN=scripts/shutdown.sh +else + SHUTDOWN_BITCOIN=/bin/true +fi # Bash variables for in-depth debugging. #set -vx @@ -343,7 +349,7 @@ all_ok() if grep ^== $DIR1/errors; then exit 1; fi if grep ^== $DIR2/errors; then exit 1; fi if grep ^== $DIR3/errors; then exit 1; fi - scripts/shutdown.sh + $SHUTDOWN_BITCOIN trap "rm -rf $DIR1 $DIR2 $DIR3" EXIT exit 0