From 35b8af92265ed74de63c3818e5290c27b3f35df2 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 27 May 2013 19:55:01 -0400 Subject: autotools: switch to autotools buildsystem --- qa/pull-tester/run-bitcoind-for-test.sh.in | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 qa/pull-tester/run-bitcoind-for-test.sh.in (limited to 'qa/pull-tester/run-bitcoind-for-test.sh.in') diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in new file mode 100755 index 0000000000..e02fef3b56 --- /dev/null +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -0,0 +1,27 @@ +#!/bin/bash +DATADIR="@abs_top_builddir@/.bitcoin" +rm -rf "$DATADIR" +mkdir -p "$DATADIR"/regtest +touch "$DATADIR/regtest/debug.log" +tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & +WAITER=$! +"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -logtimestamps -port=18444 -regtest & +BITCOIND=$! + +#Install a watchdog. +(sleep 10 && kill -0 $WAITER 2>/dev/null && kill -9 $BITCOIND $$)& +wait $WAITER + +if [ -n "$TIMEOUT" ]; then + timeout "$TIMEOUT"s "$@" + RETURN=$? +else + "$@" + RETURN=$? +fi + +(sleep 15 && kill -0 $BITCOIND 2>/dev/null && kill -9 $BITCOIND $$)& +kill $BITCOIND && wait $BITCOIND + +# timeout returns 124 on timeout, otherwise the return value of the child +exit $RETURN -- cgit v1.2.3