Skip to content

Commit 127b460

Browse files
committed
test: Check if specified config file cannot be opened
1 parent 6bb5470 commit 127b460

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/feature_config_args.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ def run_test(self):
248248

249249
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.')
250250

251+
# Check that an explicitly specified config file that cannot be opened fails
252+
none_existent_conf_file = os.path.join(default_data_dir, "none_existent_bitcoin.conf")
253+
self.nodes[0].assert_start_raises_init_error(['-conf=' + none_existent_conf_file], 'Error: Error reading configuration file: specified config file "' + none_existent_conf_file + '" could not be opened.')
254+
251255
# Create the directory and ensure the config file now works
252256
os.mkdir(new_data_dir)
253257
self.start_node(0, ['-conf='+conf_file])

0 commit comments

Comments
 (0)