aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_config_args.py
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2018-04-04 18:05:00 +1000
committerAnthony Towns <aj@erisian.com.au>2018-04-11 23:15:28 +1000
commit8a9817d175453c74ec060dcac026cd713bec98fa (patch)
treea615df03dd8d20349d4ca87ce919c13d1aae4231 /test/functional/feature_config_args.py
parent30f94074c83f7c544a88251b7308bda8b9e0fdda (diff)
[tests] Use regtest section in functional tests configs
Diffstat (limited to 'test/functional/feature_config_args.py')
-rwxr-xr-xtest/functional/feature_config_args.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py
index a1d22191af..e9924451d1 100755
--- a/test/functional/feature_config_args.py
+++ b/test/functional/feature_config_args.py
@@ -29,8 +29,13 @@ class ConfArgsTest(BitcoinTestFramework):
# Check that using non-existent datadir in conf file fails
conf_file = os.path.join(default_data_dir, "bitcoin.conf")
- with open(conf_file, 'a', encoding='utf8') as f:
+
+ # datadir needs to be set before [regtest] section
+ conf_file_contents = open(conf_file, encoding='utf8').read()
+ with open(conf_file, 'w', encoding='utf8') as f:
f.write("datadir=" + new_data_dir + "\n")
+ f.write(conf_file_contents)
+
self.nodes[0].assert_start_raises_init_error(['-conf=' + conf_file], 'Error reading configuration file: specified data directory "' + new_data_dir + '" does not exist.')
# Create the directory and ensure the config file now works