Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_framework.py
Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | def wait_for_node_exit(self, i, timeout): | ||||
self.nodes[i].process.wait(timeout) | self.nodes[i].process.wait(timeout) | ||||
def split_network(self): | def split_network(self): | ||||
""" | """ | ||||
Split the network of four nodes into nodes 0/1 and 2/3. | Split the network of four nodes into nodes 0/1 and 2/3. | ||||
""" | """ | ||||
disconnect_nodes(self.nodes[1], self.nodes[2]) | disconnect_nodes(self.nodes[1], self.nodes[2]) | ||||
disconnect_nodes(self.nodes[2], self.nodes[1]) | disconnect_nodes(self.nodes[2], self.nodes[1]) | ||||
self.sync_all([self.nodes[:2], self.nodes[2:]]) | self.sync_all(self.nodes[:2]) | ||||
self.sync_all(self.nodes[2:]) | |||||
def join_network(self): | def join_network(self): | ||||
""" | """ | ||||
Join the (previously split) network halves together. | Join the (previously split) network halves together. | ||||
""" | """ | ||||
connect_nodes_bi(self.nodes[1], self.nodes[2]) | connect_nodes_bi(self.nodes[1], self.nodes[2]) | ||||
self.sync_all() | self.sync_all() | ||||
def sync_all(self, node_groups=None): | def sync_all(self, nodes=None, **kwargs): | ||||
if not node_groups: | sync_blocks(nodes or self.nodes, **kwargs) | ||||
node_groups = [self.nodes] | sync_mempools(nodes or self.nodes, **kwargs) | ||||
for group in node_groups: | |||||
sync_blocks(group) | |||||
sync_mempools(group) | |||||
# Private helper methods. These should not be accessed by the subclass | # Private helper methods. These should not be accessed by the subclass | ||||
# test scripts. | # test scripts. | ||||
def _start_logging(self): | def _start_logging(self): | ||||
# Add logger and logging handlers | # Add logger and logging handlers | ||||
self.log = logging.getLogger('TestFramework') | self.log = logging.getLogger('TestFramework') | ||||
self.log.setLevel(logging.DEBUG) | self.log.setLevel(logging.DEBUG) | ||||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |