Browse Source

pyln: Set the bitcoin datadir when running tests

Telling `lightningd` to pass a `-datadir` to `bitcoin-cli` so it doesn't go
snooping where it doesn't belong (i.e., the user's home directory and config).

Changelog-None
Suggested-by: Simon Vrouwe <@SimonVrouwe>
Signed-off-by: Christian Decker <@cdecker>
nifty/pset-pre
Christian Decker 5 years ago
committed by Rusty Russell
parent
commit
7b752e00d5
  1. 3
      contrib/pyln-testing/pyln/testing/utils.py
  2. 1
      tests/plugins/bitcoin/part1.py

3
contrib/pyln-testing/pyln/testing/utils.py

@ -489,6 +489,9 @@ class LightningD(TailableProc):
'ignore-fee-limits': 'false', 'ignore-fee-limits': 'false',
'bitcoin-rpcuser': BITCOIND_CONFIG['rpcuser'], 'bitcoin-rpcuser': BITCOIND_CONFIG['rpcuser'],
'bitcoin-rpcpassword': BITCOIND_CONFIG['rpcpassword'], 'bitcoin-rpcpassword': BITCOIND_CONFIG['rpcpassword'],
# Make sure we don't touch any existing config files in the user's $HOME
'bitcoin-datadir': lightning_dir,
} }
for k, v in opts.items(): for k, v in opts.items():

1
tests/plugins/bitcoin/part1.py

@ -33,5 +33,6 @@ def getchaininfo(plugin, **kwargs):
plugin.add_option("bitcoin-rpcuser", "", "") plugin.add_option("bitcoin-rpcuser", "", "")
plugin.add_option("bitcoin-rpcpassword", "", "") plugin.add_option("bitcoin-rpcpassword", "", "")
plugin.add_option("bitcoin-rpcport", "", "") plugin.add_option("bitcoin-rpcport", "", "")
plugin.add_option("bitcoin-datadir", "", "")
plugin.run() plugin.run()

Loading…
Cancel
Save