Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_framework.py
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | def __init__(self): | ||||
self.chain = 'regtest' | self.chain = 'regtest' | ||||
self.setup_clean_chain = False | self.setup_clean_chain = False | ||||
self.nodes = [] | self.nodes = [] | ||||
self.network_thread = None | self.network_thread = None | ||||
# Wait for up to 60 seconds for the RPC server to respond | # Wait for up to 60 seconds for the RPC server to respond | ||||
self.rpc_timeout = 60 | self.rpc_timeout = 60 | ||||
self.supports_cli = False | self.supports_cli = False | ||||
self.bind_to_localhost_only = True | self.bind_to_localhost_only = True | ||||
# We run parse_args before set_test_params for tests who need to | |||||
# know the parser options during setup. | |||||
self.parse_args() | |||||
self.set_test_params() | |||||
def main(self): | def main(self): | ||||
"""Main function. This should not be overridden by the subclass test scripts.""" | """Main function. This should not be overridden by the subclass test scripts.""" | ||||
self.parse_args() | |||||
self.set_test_params() | |||||
assert hasattr( | assert hasattr( | ||||
self, "num_nodes"), "Test must set self.num_nodes in set_test_params()" | self, "num_nodes"), "Test must set self.num_nodes in set_test_params()" | ||||
try: | try: | ||||
self.setup() | self.setup() | ||||
self.run_test() | self.run_test() | ||||
except JSONRPCException: | except JSONRPCException: | ||||
self.log.exception("JSONRPC error") | self.log.exception("JSONRPC error") | ||||
▲ Show 20 Lines • Show All 564 Lines • Show Last 20 Lines |