Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_node.py
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | class TestNode(): | ||||
- a Python subprocess.Popen object representing the running process | - a Python subprocess.Popen object representing the running process | ||||
- an RPC connection to the node | - an RPC connection to the node | ||||
- one or more P2P connections to the node | - one or more P2P connections to the node | ||||
To make things easier for the test writer, any unrecognised messages will | To make things easier for the test writer, any unrecognised messages will | ||||
be dispatched to the RPC connection.""" | be dispatched to the RPC connection.""" | ||||
def __init__(self, i, datadir, *, chain, host, rpc_port, p2p_port, timewait, bitcoind, bitcoin_cli, | def __init__(self, i, datadir, *, chain, host, rpc_port, p2p_port, timewait, bitcoind, bitcoin_cli, | ||||
mocktime, coverage_dir, extra_conf=None, extra_args=None, use_cli=False, emulator=None): | coverage_dir, extra_conf=None, extra_args=None, use_cli=False, emulator=None): | ||||
self.index = i | self.index = i | ||||
self.datadir = datadir | self.datadir = datadir | ||||
self.bitcoinconf = os.path.join(self.datadir, "bitcoin.conf") | self.bitcoinconf = os.path.join(self.datadir, "bitcoin.conf") | ||||
self.stdout_dir = os.path.join(self.datadir, "stdout") | self.stdout_dir = os.path.join(self.datadir, "stdout") | ||||
self.stderr_dir = os.path.join(self.datadir, "stderr") | self.stderr_dir = os.path.join(self.datadir, "stderr") | ||||
self.chain = chain | self.chain = chain | ||||
self.host = host | self.host = host | ||||
self.rpc_port = rpc_port | self.rpc_port = rpc_port | ||||
Show All 15 Lines | def __init__(self, i, datadir, *, chain, host, rpc_port, p2p_port, timewait, bitcoind, bitcoin_cli, | ||||
# initialize_datadir) | # initialize_datadir) | ||||
self.extra_args = extra_args | self.extra_args = extra_args | ||||
self.default_args = [ | self.default_args = [ | ||||
"-datadir=" + self.datadir, | "-datadir=" + self.datadir, | ||||
"-logtimemicros", | "-logtimemicros", | ||||
"-debug", | "-debug", | ||||
"-debugexclude=libevent", | "-debugexclude=libevent", | ||||
"-debugexclude=leveldb", | "-debugexclude=leveldb", | ||||
"-mocktime=" + str(mocktime), | |||||
"-uacomment=" + self.name, | "-uacomment=" + self.name, | ||||
"-noprinttoconsole", | "-noprinttoconsole", | ||||
] | ] | ||||
if emulator is not None: | if emulator is not None: | ||||
if not os.path.isfile(emulator): | if not os.path.isfile(emulator): | ||||
raise FileNotFoundError( | raise FileNotFoundError( | ||||
"Emulator '{}' could not be found.".format(emulator)) | "Emulator '{}' could not be found.".format(emulator)) | ||||
▲ Show 20 Lines • Show All 457 Lines • Show Last 20 Lines |