Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_multiwallet.py
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
['-walletdir=debug.log'], 'Error: Specified -walletdir "debug.log" is not a directory', cwd=data_dir()) | ['-walletdir=debug.log'], 'Error: Specified -walletdir "debug.log" is not a directory', cwd=data_dir()) | ||||
# should not initialize if there are duplicate wallets | # should not initialize if there are duplicate wallets | ||||
self.nodes[0].assert_start_raises_init_error( | self.nodes[0].assert_start_raises_init_error( | ||||
['-wallet=w1', '-wallet=w1'], 'Error: Error loading wallet w1. Duplicate -wallet filename specified.') | ['-wallet=w1', '-wallet=w1'], 'Error: Error loading wallet w1. Duplicate -wallet filename specified.') | ||||
# should not initialize if one wallet is a copy of another | # should not initialize if one wallet is a copy of another | ||||
shutil.copyfile(wallet_dir('w8'), wallet_dir('w8_copy')) | shutil.copyfile(wallet_dir('w8'), wallet_dir('w8_copy')) | ||||
exp_stderr = r"BerkeleyBatch: Can't open database w8_copy \(duplicates fileid \w+ from w8\)" | exp_stderr = r"BerkeleyDatabase: Can't open database w8_copy \(duplicates fileid \w+ from w8\)" | ||||
self.nodes[0].assert_start_raises_init_error( | self.nodes[0].assert_start_raises_init_error( | ||||
['-wallet=w8', '-wallet=w8_copy'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX) | ['-wallet=w8', '-wallet=w8_copy'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX) | ||||
# should not initialize if wallet file is a symlink | # should not initialize if wallet file is a symlink | ||||
if os.name != 'nt': | if os.name != 'nt': | ||||
os.symlink('w8', wallet_dir('w8_symlink')) | os.symlink('w8', wallet_dir('w8_symlink')) | ||||
self.nodes[0].assert_start_raises_init_error( | self.nodes[0].assert_start_raises_init_error( | ||||
['-wallet=w8_symlink'], r'Error: Invalid -wallet path \'w8_symlink\'\. .*', match=ErrorMatch.FULL_REGEX) | ['-wallet=w8_symlink'], r'Error: Invalid -wallet path \'w8_symlink\'\. .*', match=ErrorMatch.FULL_REGEX) | ||||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# filepath) | # filepath) | ||||
assert_raises_rpc_error( | assert_raises_rpc_error( | ||||
-4, | -4, | ||||
"Wallet file verification failed. Error loading wallet wallet.dat. Duplicate -wallet filename specified.", | "Wallet file verification failed. Error loading wallet wallet.dat. Duplicate -wallet filename specified.", | ||||
self.nodes[0].loadwallet, | self.nodes[0].loadwallet, | ||||
'wallet.dat') | 'wallet.dat') | ||||
# Fail to load if one wallet is a copy of another | # Fail to load if one wallet is a copy of another | ||||
assert_raises_rpc_error(-4, "BerkeleyBatch: Can't open database w8_copy (duplicates fileid", | assert_raises_rpc_error(-4, "BerkeleyDatabase: Can't open database w8_copy (duplicates fileid", | ||||
self.nodes[0].loadwallet, 'w8_copy') | self.nodes[0].loadwallet, 'w8_copy') | ||||
# Fail to load if one wallet is a copy of another. | # Fail to load if one wallet is a copy of another. | ||||
# Test this twice to make sure that we don't re-introduce | # Test this twice to make sure that we don't re-introduce | ||||
# https://github.com/bitcoin/bitcoin/issues/14304 | # https://github.com/bitcoin/bitcoin/issues/14304 | ||||
assert_raises_rpc_error(-4, "BerkeleyBatch: Can't open database w8_copy (duplicates fileid", | assert_raises_rpc_error(-4, "BerkeleyDatabase: Can't open database w8_copy (duplicates fileid", | ||||
self.nodes[0].loadwallet, 'w8_copy') | self.nodes[0].loadwallet, 'w8_copy') | ||||
# Fail to load if wallet file is a symlink | # Fail to load if wallet file is a symlink | ||||
if os.name != 'nt': | if os.name != 'nt': | ||||
assert_raises_rpc_error( | assert_raises_rpc_error( | ||||
-4, | -4, | ||||
"Wallet file verification failed. Invalid -wallet path 'w8_symlink'", | "Wallet file verification failed. Invalid -wallet path 'w8_symlink'", | ||||
self.nodes[0].loadwallet, | self.nodes[0].loadwallet, | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |