diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -98,6 +98,8 @@ help="Attach a python debugger if test fails") parser.add_argument("--usecli", dest="usecli", default=False, action="store_true", help="use bitcoin-cli instead of RPC for all commands") + parser.add_argument("--nodes_arg", dest="nodes_arg", action="append", + help="Extra arguments that applies to all nodes. Can be called mutiple times") self.add_options(parser) self.options = parser.parse_args() @@ -222,9 +224,12 @@ def setup_nodes(self): """Override this method to customize test node setup""" - extra_args = None + extra_args = [[]] * self.num_nodes + if self.options.nodes_arg is not None: + extra_args = [self.options.nodes_arg] * self.num_nodes if hasattr(self, "extra_args"): - extra_args = self.extra_args + assert(len(self.extra_args) == self.num_nodes) + extra_args = [i + j for i, j in zip(extra_args, self.extra_args)] self.add_nodes(self.num_nodes, extra_args) self.start_nodes() @@ -499,9 +504,13 @@ help="bitcoind binary to use for reference nodes (if any)") def setup_network(self): - extra_args = [['-whitelist=127.0.0.1']] * self.num_nodes + extra_arg = ['-whitelist=127.0.0.1'] + if self.options.nodes_arg is not None: + extra_arg.extend(self.options.nodes_arg) + extra_args = [extra_arg] * self.num_nodes if hasattr(self, "extra_args"): - extra_args = self.extra_args + assert(len(self.extra_args) == self.num_nodes) + extra_args = [i + j for i, j in zip(extra_args, self.extra_args)] self.add_nodes(self.num_nodes, extra_args, binary=[self.options.testbinary] + [self.options.refbinary] * (self.num_nodes - 1))