Merge #14559: appveyor: Enable multiwallet tests

4dca7d0a98 appveyor: Enable multiwallet test (Chun Kuan Lee)

Pull request description:

  Based on #14320

  This PR enable multiwallet test on appveyor. Also re-enable symlink tests on Windows which is available after Windows Vista.

  I disable these tests in #13964 because I suppose that Windows does not support symlink, but I was wrong.

Tree-SHA512: 852cd4dedf36ec9c34aff8926cb34e6a560aea0bb9170c7a2264fc292dbb605622d561568d8df39aeb90d3d2bb700901d218ea7e7c5e21d84827c40d6370b369
pull/643/head
MarcoFalke 6 years ago
commit 613fc95ee4
No known key found for this signature in database
GPG Key ID: D2EA4850E7528B25

@ -61,5 +61,5 @@ test_script:
- ps: src\bench_bitcoin.exe -evals=1 -scaling=0 - ps: src\bench_bitcoin.exe -evals=1 -scaling=0
- ps: python test\util\bitcoin-util-test.py - ps: python test\util\bitcoin-util-test.py
- cmd: python test\util\rpcauth-test.py - cmd: python test\util\rpcauth-test.py
- cmd: python test\functional\test_runner.py --force --quiet --combinedlogslen=4000 --exclude wallet_multiwallet - cmd: python test\functional\test_runner.py --force --quiet --combinedlogslen=4000
deploy: off deploy: off

@ -47,9 +47,8 @@ class MultiWalletTest(BitcoinTestFramework):
# create symlink to verify wallet directory path can be referenced # create symlink to verify wallet directory path can be referenced
# through symlink # through symlink
if os.name != 'nt': os.mkdir(wallet_dir('w7'))
os.mkdir(wallet_dir('w7')) os.symlink('w7', wallet_dir('w7_symlink'))
os.symlink('w7', wallet_dir('w7_symlink'))
# rename wallet.dat to make sure plain wallet file paths (as opposed to # rename wallet.dat to make sure plain wallet file paths (as opposed to
# directory paths) can be loaded # directory paths) can be loaded
@ -70,11 +69,9 @@ class MultiWalletTest(BitcoinTestFramework):
# w8 - to verify existing wallet file is loaded correctly # w8 - to verify existing wallet file is loaded correctly
# '' - to verify default wallet file is created correctly # '' - to verify default wallet file is created correctly
wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', ''] wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', '']
if os.name == 'nt':
wallet_names.remove('w7_symlink')
extra_args = ['-wallet={}'.format(n) for n in wallet_names] extra_args = ['-wallet={}'.format(n) for n in wallet_names]
self.start_node(0, extra_args) self.start_node(0, extra_args)
assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', 'sub/w5', 'w7', 'w7', 'w1', 'w8', 'w'])) assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', os.path.join('sub', 'w5'), 'w7', 'w7', 'w1', 'w8', 'w']))
assert_equal(set(node.listwallets()), set(wallet_names)) assert_equal(set(node.listwallets()), set(wallet_names))
@ -100,9 +97,8 @@ class MultiWalletTest(BitcoinTestFramework):
self.nodes[0].assert_start_raises_init_error(['-wallet=w8', '-wallet=w8_copy'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX) self.nodes[0].assert_start_raises_init_error(['-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': os.symlink('w8', wallet_dir('w8_symlink'))
os.symlink('w8', wallet_dir('w8_symlink')) self.nodes[0].assert_start_raises_init_error(['-wallet=w8_symlink'], 'Error: Invalid -wallet path \'w8_symlink\'\. .*', match=ErrorMatch.FULL_REGEX)
self.nodes[0].assert_start_raises_init_error(['-wallet=w8_symlink'], 'Error: Invalid -wallet path \'w8_symlink\'\. .*', match=ErrorMatch.FULL_REGEX)
# should not initialize if the specified walletdir does not exist # 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') self.nodes[0].assert_start_raises_init_error(['-walletdir=bad'], 'Error: Specified -walletdir "bad" does not exist')
@ -148,7 +144,7 @@ class MultiWalletTest(BitcoinTestFramework):
self.restart_node(0, extra_args) self.restart_node(0, extra_args)
assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', 'sub/w5', 'w7', 'w7', 'w8_copy', 'w1', 'w8', 'w'])) assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', os.path.join('sub', 'w5'), 'w7', 'w7', 'w8_copy', 'w1', 'w8', 'w']))
wallets = [wallet(w) for w in wallet_names] wallets = [wallet(w) for w in wallet_names]
wallet_bad = wallet("bad") wallet_bad = wallet("bad")
@ -235,8 +231,7 @@ class MultiWalletTest(BitcoinTestFramework):
# Fail to load if wallet file is a symlink # Fail to load if wallet file is a symlink
if os.name != 'nt': assert_raises_rpc_error(-4, "Wallet file verification failed: Invalid -wallet path 'w8_symlink'", self.nodes[0].loadwallet, 'w8_symlink')
assert_raises_rpc_error(-4, "Wallet file verification failed: Invalid -wallet path 'w8_symlink'", self.nodes[0].loadwallet, 'w8_symlink')
# Fail to load if a directory is specified that doesn't contain a wallet # Fail to load if a directory is specified that doesn't contain a wallet
os.mkdir(wallet_dir('empty_wallet_dir')) os.mkdir(wallet_dir('empty_wallet_dir'))
@ -296,7 +291,7 @@ class MultiWalletTest(BitcoinTestFramework):
assert_equal(self.nodes[0].listwallets(), ['w1']) assert_equal(self.nodes[0].listwallets(), ['w1'])
assert_equal(w1.getwalletinfo()['walletname'], 'w1') assert_equal(w1.getwalletinfo()['walletname'], 'w1')
assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', 'sub/w5', 'w7', 'w9', 'w7', 'w8_copy', 'w1', 'w8', 'w'])) assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', os.path.join('sub', 'w5'), 'w7', 'w9', 'w7', 'w8_copy', 'w1', 'w8', 'w']))
# Test backing up and restoring wallets # Test backing up and restoring wallets
self.log.info("Test wallet backup") self.log.info("Test wallet backup")

Loading…
Cancel
Save