Merge #12443: qa: Move common args to bitcoin.conf

face722 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
This commit is contained in:
pasta 2020-12-10 20:08:07 -06:00
parent 3eb72d798b
commit 185e4b128c
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
4 changed files with 7 additions and 2 deletions

View File

@ -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()

View File

@ -445,7 +445,7 @@ class BitcoinTestFramework():
self.set_genesis_mocktime()
for i in range(MAX_NODES):
datadir = initialize_datadir(self.options.cachedir, i)
args = [self.options.bitcoind, "-server", "-keypool=1", "-datadir=" + datadir, "-discover=0", "-mocktime="+str(GENESISTIME)]
args = [self.options.bitcoind, "-datadir=" + datadir, "-mocktime="+str(GENESISTIME)]
if i > 0:
args.append("-connect=127.0.0.1:" + str(p2p_port(0)))
if extra_args is not None:

View File

@ -68,9 +68,10 @@ class TestNode():
append_config(dirname, i, extra_conf)
# 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.extra_args_from_options = extra_args_from_options
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(bitcoin_cli, self.datadir)
self.use_cli = use_cli

View File

@ -316,6 +316,9 @@ def initialize_datadir(dirname, n):
f.write("[regtest]\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