Skip to content

Commit 07090c5

Browse files
author
MarcoFalke
committed
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
2 parents acd1e61 + face722 commit 07090c5

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

test/functional/interface_rest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class RESTTest (BitcoinTestFramework):
4646
def set_test_params(self):
4747
self.setup_clean_chain = True
4848
self.num_nodes = 3
49+
self.extra_args = [["-rest"]] * self.num_nodes
4950

5051
def setup_network(self, split=False):
5152
super().setup_network()

test/functional/test_framework/test_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def _initialize_chain(self):
392392
# Create cache directories, run bitcoinds:
393393
for i in range(MAX_NODES):
394394
datadir = initialize_datadir(self.options.cachedir, i)
395-
args = [os.getenv("BITCOIND", "bitcoind"), "-server", "-keypool=1", "-datadir=" + datadir, "-discover=0"]
395+
args = [os.getenv("BITCOIND", "bitcoind"), "-datadir=" + datadir]
396396
if i > 0:
397397
args.append("-connect=127.0.0.1:" + str(p2p_port(0)))
398398
self.nodes.append(TestNode(i, self.options.cachedir, extra_args=[], rpchost=None, timewait=None, binary=None, stderr=None, mocktime=self.mocktime, coverage_dir=None))

test/functional/test_framework/test_node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ def __init__(self, i, dirname, extra_args, rpchost, timewait, binary, stderr, mo
5757
self.binary = binary
5858
self.stderr = stderr
5959
self.coverage_dir = coverage_dir
60-
# 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.
60+
# Most callers will just need to add extra args to the standard list below.
61+
# For those callers that need more flexibity, they can just set the args property directly.
62+
# Note that common args are set in the config file (see initialize_datadir)
6163
self.extra_args = extra_args
62-
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]
64+
self.args = [self.binary, "-datadir=" + self.datadir, "-logtimemicros", "-debug", "-debugexclude=libevent", "-debugexclude=leveldb", "-mocktime=" + str(mocktime), "-uacomment=testnode%d" % i]
6365

6466
self.cli = TestNodeCLI(os.getenv("BITCOINCLI", "bitcoin-cli"), self.datadir)
6567
self.use_cli = use_cli

test/functional/test_framework/util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ def initialize_datadir(dirname, n):
291291
f.write("regtest=1\n")
292292
f.write("port=" + str(p2p_port(n)) + "\n")
293293
f.write("rpcport=" + str(rpc_port(n)) + "\n")
294+
f.write("server=1\n")
295+
f.write("keypool=1\n")
296+
f.write("discover=0\n")
294297
f.write("listenonion=0\n")
295298
return datadir
296299

0 commit comments

Comments
 (0)