aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework
diff options
context:
space:
mode:
authorptschip <peter.tschipper@gmail.com>2015-08-26 06:02:21 -0700
committerptschip <peter.tschipper@gmail.com>2015-08-26 10:59:22 -0700
commit060058e9557f4d3094b6a8d2fa079539c5658d95 (patch)
tree712cf6d8711eeff8540d54ae15a623bff1b84957 /qa/rpc-tests/test_framework
parentea19c2bc3f2281ad319457c6fa518bff96af13e3 (diff)
downloadbitcoin-060058e9557f4d3094b6a8d2fa079539c5658d95.tar.xz
Enable python tests for Native Windows
1) Multiplatorm support for devnull 2) Fixed a bug in the handling of cache files 3) Deleted run-bitcoin-cli as no longer needed
Diffstat (limited to 'qa/rpc-tests/test_framework')
-rw-r--r--qa/rpc-tests/test_framework/util.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py
index c236ec2602..3759cc8162 100644
--- a/qa/rpc-tests/test_framework/util.py
+++ b/qa/rpc-tests/test_framework/util.py
@@ -78,8 +78,17 @@ def initialize_chain(test_dir):
bitcoind and bitcoin-cli must be in search path.
"""
- if not os.path.isdir(os.path.join("cache", "node0")):
- devnull = open("/dev/null", "w+")
+ if (not os.path.isdir(os.path.join("cache","node0"))
+ or not os.path.isdir(os.path.join("cache","node1"))
+ or not os.path.isdir(os.path.join("cache","node2"))
+ or not os.path.isdir(os.path.join("cache","node3"))):
+
+ #find and delete old cache directories if any exist
+ for i in range(4):
+ if os.path.isdir(os.path.join("cache","node"+str(i))):
+ shutil.rmtree(os.path.join("cache","node"+str(i)))
+
+ devnull = open(os.devnull, "w")
# Create cache directories, run bitcoinds:
for i in range(4):
datadir=initialize_datadir("cache", i)
@@ -171,7 +180,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
args = [ binary, "-datadir="+datadir, "-keypool=1", "-discover=0", "-rest" ]
if extra_args is not None: args.extend(extra_args)
bitcoind_processes[i] = subprocess.Popen(args)
- devnull = open("/dev/null", "w+")
+ devnull = open(os.devnull, "w")
if os.getenv("PYTHON_DEBUG", ""):
print "start_node: bitcoind started, calling bitcoin-cli -rpcwait getblockcount"
subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir] +