diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-02-23 12:36:59 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-02-23 12:37:06 -0500 |
commit | 07090c5339436f856e79a8036d1c85deeb453803 (patch) | |
tree | fa054551809120aaa605798ed8b46041c8668c19 | |
parent | acd1e6155ca62a6d91ca8d5eb23ea64f94d098b5 (diff) | |
parent | face7220b776e3decf9889b2c20c9d5f935e971e (diff) |
Merge #12443: qa: Move common args to bitcoin.conf
face7220b7 qa: Move common args to bitcoin.conf (MarcoFalke)
Pull request description:
Beside removing duplicates of the same args in the code, this actually helps with debugging after a test failure.
For example, `bitcoin-qt` has `server` turned off, so you'd have to turn it on every time, if you wanted to debug a temporary test datadir created by the test framework.
Also, `keypool` would fill up if you forget to specify `-keypool=1`.
Tree-SHA512: 996bec8738dc0fce7297ab1fc5b4fbe3aa31b9b6241f8c4e685db728925363ccaca6145ad1edc6bee2f360e02ac4b9a53fcdff74eb79de90793393742d52b559
-rwxr-xr-x | test/functional/interface_rest.py | 1 | ||||
-rwxr-xr-x | test/functional/test_framework/test_framework.py | 2 | ||||
-rwxr-xr-x | test/functional/test_framework/test_node.py | 6 | ||||
-rw-r--r-- | test/functional/test_framework/util.py | 3 |
4 files changed, 9 insertions, 3 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py index 9006e27cbe..3e87f6d33f 100755 --- a/test/functional/interface_rest.py +++ b/test/functional/interface_rest.py @@ -46,6 +46,7 @@ class RESTTest (BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 3 + self.extra_args = [["-rest"]] * self.num_nodes def setup_network(self, split=False): super().setup_network() diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index a5e66bd959..ecb91b315e 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -392,7 +392,7 @@ class BitcoinTestFramework(): # Create cache directories, run bitcoinds: for i in range(MAX_NODES): datadir = initialize_datadir(self.options.cachedir, i) - args = [os.getenv("BITCOIND", "bitcoind"), "-server", "-keypool=1", "-datadir=" + datadir, "-discover=0"] + args = [os.getenv("BITCOIND", "bitcoind"), "-datadir=" + datadir] if i > 0: args.append("-connect=127.0.0.1:" + str(p2p_port(0))) self.nodes.append(TestNode(i, self.options.cachedir, extra_args=[], rpchost=None, timewait=None, binary=None, stderr=None, mocktime=self.mocktime, coverage_dir=None)) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 1054e6d028..93a052f785 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -57,9 +57,11 @@ class TestNode(): self.binary = binary self.stderr = stderr self.coverage_dir = coverage_dir - # Most callers will just need to add extra args to the standard list below. For those callers that need more flexibity, they can just set the args property directly. + # Most callers will just need to add extra args to the standard list below. + # For those callers that need more flexibity, they can just set the args property directly. + # Note that common args are set in the config file (see initialize_datadir) self.extra_args = extra_args - self.args = [self.binary, "-datadir=" + self.datadir, "-server", "-keypool=1", "-discover=0", "-rest", "-logtimemicros", "-debug", "-debugexclude=libevent", "-debugexclude=leveldb", "-mocktime=" + str(mocktime), "-uacomment=testnode%d" % i] + self.args = [self.binary, "-datadir=" + self.datadir, "-logtimemicros", "-debug", "-debugexclude=libevent", "-debugexclude=leveldb", "-mocktime=" + str(mocktime), "-uacomment=testnode%d" % i] self.cli = TestNodeCLI(os.getenv("BITCOINCLI", "bitcoin-cli"), self.datadir) self.use_cli = use_cli diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 4fe586b848..e9e7bbd8e4 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -291,6 +291,9 @@ def initialize_datadir(dirname, n): f.write("regtest=1\n") f.write("port=" + str(p2p_port(n)) + "\n") f.write("rpcport=" + str(rpc_port(n)) + "\n") + f.write("server=1\n") + f.write("keypool=1\n") + f.write("discover=0\n") f.write("listenonion=0\n") return datadir |