diff options
| author | Cory Fields <[email protected]> | 2014-10-30 18:59:58 -0400 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2014-10-31 00:05:55 -0400 |
| commit | 7a41614aa27b9d3855b6145831cb4ad958f78823 (patch) | |
| tree | 0badd7331426f3c776b39ae6d2f2f4a1786d73a6 | |
| parent | tests: enable alertnotify test for Windows (diff) | |
| download | discoin-7a41614aa27b9d3855b6145831cb4ad958f78823.tar.xz discoin-7a41614aa27b9d3855b6145831cb4ad958f78823.zip | |
tests: allow rpc-tests to get filenames for bitcoind and bitcoin-cli from the environment
This will allow for windows tests to run with bitcoind.exe and bitcoin-cli.exe
| -rwxr-xr-x | qa/rpc-tests/conflictedbalance.sh | 5 | ||||
| -rwxr-xr-x | qa/rpc-tests/txnmall.sh | 5 | ||||
| -rw-r--r-- | qa/rpc-tests/util.py | 8 | ||||
| -rwxr-xr-x | qa/rpc-tests/wallet.sh | 5 | ||||
| -rwxr-xr-x | qa/rpc-tests/walletbackup.sh | 5 | ||||
| -rwxr-xr-x | qa/rpc-tests/zapwallettxes.sh | 5 |
6 files changed, 19 insertions, 14 deletions
diff --git a/qa/rpc-tests/conflictedbalance.sh b/qa/rpc-tests/conflictedbalance.sh index 71761321e..a112244c7 100755 --- a/qa/rpc-tests/conflictedbalance.sh +++ b/qa/rpc-tests/conflictedbalance.sh @@ -18,13 +18,14 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi set -f -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" diff --git a/qa/rpc-tests/txnmall.sh b/qa/rpc-tests/txnmall.sh index 035e7ee15..1296d54d9 100755 --- a/qa/rpc-tests/txnmall.sh +++ b/qa/rpc-tests/txnmall.sh @@ -8,13 +8,14 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi set -f -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index 6d0b21c92..c895eb161 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -85,11 +85,11 @@ def initialize_chain(test_dir): # Create cache directories, run bitcoinds: for i in range(4): datadir=initialize_datadir("cache", i) - args = [ "bitcoind", "-keypool=1", "-datadir="+datadir, "-discover=0" ] + args = [ os.getenv("BITCOIND", "bitcoind"), "-keypool=1", "-datadir="+datadir, "-discover=0" ] if i > 0: args.append("-connect=127.0.0.1:"+str(p2p_port(0))) bitcoind_processes[i] = subprocess.Popen(args) - subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir, + subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir, "-rpcwait", "getblockcount"], stdout=devnull) devnull.close() rpcs = [] @@ -150,11 +150,11 @@ def start_node(i, dir, extra_args=None, rpchost=None): Start a bitcoind and return RPC connection to it """ datadir = os.path.join(dir, "node"+str(i)) - args = [ "bitcoind", "-datadir="+datadir, "-keypool=1", "-discover=0" ] + args = [ os.getenv("BITCOIND", "bitcoind"), "-datadir="+datadir, "-keypool=1", "-discover=0" ] if extra_args is not None: args.extend(extra_args) bitcoind_processes[i] = subprocess.Popen(args) devnull = open("/dev/null", "w+") - subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir] + + subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir] + _rpchost_to_args(rpchost) + ["-rpcwait", "getblockcount"], stdout=devnull) devnull.close() diff --git a/qa/rpc-tests/wallet.sh b/qa/rpc-tests/wallet.sh index bb5f34f59..c9ad0f2a7 100755 --- a/qa/rpc-tests/wallet.sh +++ b/qa/rpc-tests/wallet.sh @@ -8,13 +8,14 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi set -f -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" diff --git a/qa/rpc-tests/walletbackup.sh b/qa/rpc-tests/walletbackup.sh index ee11418be..4af3d97f3 100755 --- a/qa/rpc-tests/walletbackup.sh +++ b/qa/rpc-tests/walletbackup.sh @@ -36,11 +36,12 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" diff --git a/qa/rpc-tests/zapwallettxes.sh b/qa/rpc-tests/zapwallettxes.sh index e6d490ccc..4312d84e9 100755 --- a/qa/rpc-tests/zapwallettxes.sh +++ b/qa/rpc-tests/zapwallettxes.sh @@ -8,13 +8,14 @@ if [ $# -lt 1 ]; then echo "Usage: $0 path_to_binaries" echo "e.g. $0 ../../src" + echo "Env vars BITCOIND and BITCOINCLI may be used to specify the exact binaries used" exit 1 fi set -f -BITCOIND=${1}/bitcoind -CLI=${1}/bitcoin-cli +BITCOIND=${BITCOIND:-${1}/bitcoind} +CLI=${BITCOINCLI:-${1}/bitcoin-cli} DIR="${BASH_SOURCE%/*}" SENDANDWAIT="${DIR}/send.sh" |