[tests] Introduce TestNode

TestNode is a class responsible for all state related to a bitcoind node
under test. It stores local state, is responsible for tracking the
bitcoind process and delegates unrecognised messages to the RPC
connection.

This commit changes start_nodes and stop_nodes to start and stop the
bitcoind nodes in parallel, making test setup and teardown much faster.

Github-Pull: #10711
Rebased-From: 7897338918
This commit is contained in:
John Newbery
2017-06-02 14:30:36 -04:00
committed by MarcoFalke
parent fb7b529384
commit fc2aa09cf3
12 changed files with 193 additions and 97 deletions

View File

@@ -17,8 +17,7 @@ class KeyPoolTest(BitcoinTestFramework):
assert(addr_before_encrypting_data['hdmasterkeyid'] == wallet_info_old['hdmasterkeyid'])
# Encrypt wallet and wait to terminate
nodes[0].encryptwallet('test')
self.bitcoind_processes[0].wait()
nodes[0].node_encrypt_wallet('test')
# Restart node 0
nodes[0] = self.start_node(0, self.options.tmpdir)
# Keep creating keys