Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_config_args.py
Show All 35 Lines | def run_test(self): | ||||
f.write("datadir=" + new_data_dir + "\n") | f.write("datadir=" + new_data_dir + "\n") | ||||
f.write(conf_file_contents) | f.write(conf_file_contents) | ||||
self.nodes[0].assert_start_raises_init_error( | self.nodes[0].assert_start_raises_init_error( | ||||
['-conf=' + conf_file], 'Error reading configuration file: specified data directory "' + new_data_dir + '" does not exist.') | ['-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 | # Create the directory and ensure the config file now works | ||||
os.mkdir(new_data_dir) | os.mkdir(new_data_dir) | ||||
self.start_node(0, ['-conf='+conf_file, '-wallet=w1']) | self.start_node(0, ['-conf=' + conf_file, '-wallet=w1']) | ||||
self.stop_node(0) | self.stop_node(0) | ||||
assert os.path.exists(os.path.join( | assert os.path.exists(os.path.join( | ||||
new_data_dir, 'regtest', 'wallets', 'w1')) | new_data_dir, 'regtest', 'wallets', 'w1')) | ||||
# Ensure command line argument overrides datadir in conf | # Ensure command line argument overrides datadir in conf | ||||
os.mkdir(new_data_dir_2) | os.mkdir(new_data_dir_2) | ||||
self.nodes[0].datadir = new_data_dir_2 | self.nodes[0].datadir = new_data_dir_2 | ||||
self.start_node(0, ['-datadir='+new_data_dir_2, | self.start_node(0, ['-datadir=' + new_data_dir_2, | ||||
'-conf='+conf_file, '-wallet=w2']) | '-conf=' + conf_file, '-wallet=w2']) | ||||
assert os.path.exists(os.path.join( | assert os.path.exists(os.path.join( | ||||
new_data_dir_2, 'regtest', 'wallets', 'w2')) | new_data_dir_2, 'regtest', 'wallets', 'w2')) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
ConfArgsTest().main() | ConfArgsTest().main() |