[Tests] Require exact match in assert_start_raises_init_eror()
This commit is contained in:
1 parent
0ec08a672d
commit
58122736b5
6 files changed
+35
-18
No files matched your search
@@ -60,22 +60,30 @@ class MultiWalletTest(BitcoinTestFramework):
|
||||
assert_equal(os.path.isfile(wallet_dir(wallet_name)), True)
|
||||
|
||||
# should not initialize if wallet path can't be created
|
||||
self.assert_start_raises_init_error(0, ['-wallet=wallet.dat/bad'], 'Not a directory')
|
||||
exp_stderr = "\n\n\*+\n" + \
|
||||
"EXCEPTION: .*\n" + \
|
||||
"boost::filesystem::create_directory: Not a directory:.*\n" + \
|
||||
"bitcoin in .*\n"
|
||||
self.nodes[0].assert_start_raises_init_error(['-wallet=wallet.dat/bad'], exp_stderr)
|
||||
|
||||
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" does not exist')
|
||||
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" is a relative path', cwd=data_dir())
|
||||
self.nodes[0].assert_start_raises_init_error(['-walletdir=debug.log'], 'Error: Specified -walletdir "debug.log" is not a directory', cwd=data_dir())
|
||||
|
||||
# should not initialize if there are duplicate wallets
|
||||
self.nodes[0].assert_start_raises_init_error(['-wallet=w1', '-wallet=w1'], 'Error loading wallet w1. Duplicate -wallet filename specified.')
|
||||
self.nodes[0].assert_start_raises_init_error(['-wallet=w1', '-wallet=w1'], 'Error: Error loading wallet w1. Duplicate -wallet filename specified.')
|
||||
|
||||
# should not initialize if one wallet is a copy of another
|
||||
shutil.copyfile(wallet_dir('w8'), wallet_dir('w8_copy'))
|
||||
self.nodes[0].assert_start_raises_init_error(['-wallet=w8', '-wallet=w8_copy'], 'duplicates fileid')
|
||||
exp_stderr = "\n\n\*+\n" + \
|
||||
"EXCEPTION: .*\n" + \
|
||||
"CDB: Can't open database w8_copy \(duplicates fileid \w+ from w8\)\s*\n" + \
|
||||
"bitcoin in .*\n"
|
||||
self.nodes[0].assert_start_raises_init_error(['-wallet=w8', '-wallet=w8_copy'], exp_stderr)
|
||||
|
||||
# should not initialize if wallet file is a symlink
|
||||
os.symlink('w8', wallet_dir('w8_symlink'))
|
||||
self.nodes[0].assert_start_raises_init_error(['-wallet=w8_symlink'], 'Invalid -wallet path')
|
||||
self.nodes[0].assert_start_raises_init_error(['-wallet=w8_symlink'], 'Error: Invalid -wallet path \'w8_symlink\'\. .*')
|
||||
|
||||
# should not initialize if the specified walletdir does not exist
|
||||
self.nodes[0].assert_start_raises_init_error(['-walletdir=bad'], 'Error: Specified -walletdir "bad" does not exist')
|
||||
@@ -102,8 +110,9 @@ class MultiWalletTest(BitcoinTestFramework):
|
||||
|
||||
competing_wallet_dir = os.path.join(self.options.tmpdir, 'competing_walletdir')
|
||||
os.mkdir(competing_wallet_dir)
|
||||
self.restart_node(0, ['-walletdir='+competing_wallet_dir])
|
||||
self.nodes[1].assert_start_raises_init_error(['-walletdir='+competing_wallet_dir], 'Error initializing wallet database environment')
|
||||
self.restart_node(0, ['-walletdir=' + competing_wallet_dir])
|
||||
exp_stderr = "Error: Error initializing wallet database environment \"\S+competing_walletdir\"!"
|
||||
self.nodes[1].assert_start_raises_init_error(['-walletdir=' + competing_wallet_dir], exp_stderr)
|
||||
|
||||
self.restart_node(0, extra_args)
|
||||
|
||||
|
||||
Reference in new issue
Block a user