mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-09 19:13:28 +02:00
Merge #15864: Fix datadir handling
ffea41f530
Enable all tests in feature_config_args.py (Hennadii Stepanov)66f5c17f8a
Use CheckDataDirOption() for code uniformity (Hennadii Stepanov)7e33a18a34
Fix datadir handling in bitcoin-cli (Hennadii Stepanov)b28dada374
Fix datadir handling in bitcoin-qt (Hennadii Stepanov)50824093bb
Fix datadir handling in bitcoind (Hennadii Stepanov)740d41ce9f
Add CheckDataDirOption() function (Hennadii Stepanov)c1f325126c
Return absolute path early in AbsPathForConfigVal (Hennadii Stepanov) Pull request description: Fix #15240, see: https://github.com/bitcoin/bitcoin/issues/15240#issuecomment-487353760 Fix #15745 Fix broken `feature_config_args.py` tests (disabled by MarcoFalke@fabe28a0cdcfa13e0e595a0905e3642a960d3077). All test are enabled now. This PR is alternative to #13621. User's `$HOME` directory is not touched unnecessarily now. ~To make reviewing easier only `bitcoind` code is modified (neither `bitcoin-cli` nor `bitcoin-qt`).~ Refs: - https://github.com/bitcoin/bitcoin/issues/15745#issuecomment-479852569 by **laanwj** - #16220 Top commit has no ACKs. Tree-SHA512: 4a4cda10e0b67c8f374da0c9567003d2b566d948e7f8550fe246868b5794c15010e88ea206009480b9cd2f737f310a15e984f920730448f99a895893bed351df
This commit is contained in:
@@ -109,17 +109,15 @@ class ConfArgsTest(BitcoinTestFramework):
|
||||
f.write("datadir=" + new_data_dir + "\n")
|
||||
f.write(conf_file_contents)
|
||||
|
||||
# Temporarily disabled, because this test would access the user's home dir (~/.bitcoin)
|
||||
#self.nodes[0].assert_start_raises_init_error(['-conf=' + conf_file], 'Error reading configuration file: specified data directory "' + new_data_dir + '" does not exist.')
|
||||
self.nodes[0].assert_start_raises_init_error(['-conf=' + conf_file], 'Error: Error reading configuration file: specified data directory "' + new_data_dir + '" does not exist.')
|
||||
|
||||
# Create the directory and ensure the config file now works
|
||||
os.mkdir(new_data_dir)
|
||||
# Temporarily disabled, because this test would access the user's home dir (~/.bitcoin)
|
||||
#self.start_node(0, ['-conf='+conf_file, '-wallet=w1'])
|
||||
#self.stop_node(0)
|
||||
#assert os.path.exists(os.path.join(new_data_dir, 'regtest', 'blocks'))
|
||||
#if self.is_wallet_compiled():
|
||||
#assert os.path.exists(os.path.join(new_data_dir, 'regtest', 'wallets', 'w1'))
|
||||
self.start_node(0, ['-conf='+conf_file, '-wallet=w1'])
|
||||
self.stop_node(0)
|
||||
assert os.path.exists(os.path.join(new_data_dir, 'regtest', 'blocks'))
|
||||
if self.is_wallet_compiled():
|
||||
assert os.path.exists(os.path.join(new_data_dir, 'regtest', 'wallets', 'w1'))
|
||||
|
||||
# Ensure command line argument overrides datadir in conf
|
||||
os.mkdir(new_data_dir_2)
|
||||
|
Reference in New Issue
Block a user