Skip to content

Commit 613fc95

Browse files
author
MarcoFalke
committed
Merge #14559: appveyor: Enable multiwallet tests
4dca7d0 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
2 parents 2b88f67 + 4dca7d0 commit 613fc95

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ test_script:
6161
- ps: src\bench_bitcoin.exe -evals=1 -scaling=0
6262
- ps: python test\util\bitcoin-util-test.py
6363
- cmd: python test\util\rpcauth-test.py
64-
- cmd: python test\functional\test_runner.py --force --quiet --combinedlogslen=4000 --exclude wallet_multiwallet
64+
- cmd: python test\functional\test_runner.py --force --quiet --combinedlogslen=4000
6565
deploy: off

test/functional/wallet_multiwallet.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ def wallet_file(name):
4747

4848
# create symlink to verify wallet directory path can be referenced
4949
# through symlink
50-
if os.name != 'nt':
51-
os.mkdir(wallet_dir('w7'))
52-
os.symlink('w7', wallet_dir('w7_symlink'))
50+
os.mkdir(wallet_dir('w7'))
51+
os.symlink('w7', wallet_dir('w7_symlink'))
5352

5453
# rename wallet.dat to make sure plain wallet file paths (as opposed to
5554
# directory paths) can be loaded
@@ -70,11 +69,9 @@ def wallet_file(name):
7069
# w8 - to verify existing wallet file is loaded correctly
7170
# '' - to verify default wallet file is created correctly
7271
wallet_names = ['w1', 'w2', 'w3', 'w', 'sub/w5', os.path.join(self.options.tmpdir, 'extern/w6'), 'w7_symlink', 'w8', '']
73-
if os.name == 'nt':
74-
wallet_names.remove('w7_symlink')
7572
extra_args = ['-wallet={}'.format(n) for n in wallet_names]
7673
self.start_node(0, extra_args)
77-
assert_equal(set(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), set(['', 'w3', 'w2', 'sub/w5', 'w7', 'w7', 'w1', 'w8', 'w']))
74+
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']))
7875

7976
assert_equal(set(node.listwallets()), set(wallet_names))
8077

@@ -100,9 +97,8 @@ def wallet_file(name):
10097
self.nodes[0].assert_start_raises_init_error(['-wallet=w8', '-wallet=w8_copy'], exp_stderr, match=ErrorMatch.PARTIAL_REGEX)
10198

10299
# should not initialize if wallet file is a symlink
103-
if os.name != 'nt':
104-
os.symlink('w8', wallet_dir('w8_symlink'))
105-
self.nodes[0].assert_start_raises_init_error(['-wallet=w8_symlink'], 'Error: Invalid -wallet path \'w8_symlink\'\. .*', match=ErrorMatch.FULL_REGEX)
100+
os.symlink('w8', wallet_dir('w8_symlink'))
101+
self.nodes[0].assert_start_raises_init_error(['-wallet=w8_symlink'], 'Error: Invalid -wallet path \'w8_symlink\'\. .*', match=ErrorMatch.FULL_REGEX)
106102

107103
# should not initialize if the specified walletdir does not exist
108104
self.nodes[0].assert_start_raises_init_error(['-walletdir=bad'], 'Error: Specified -walletdir "bad" does not exist')
@@ -148,7 +144,7 @@ def wallet_file(name):
148144

149145
self.restart_node(0, extra_args)
150146

151-
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']))
147+
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']))
152148

153149
wallets = [wallet(w) for w in wallet_names]
154150
wallet_bad = wallet("bad")
@@ -235,8 +231,7 @@ def wallet_file(name):
235231

236232

237233
# Fail to load if wallet file is a symlink
238-
if os.name != 'nt':
239-
assert_raises_rpc_error(-4, "Wallet file verification failed: Invalid -wallet path 'w8_symlink'", self.nodes[0].loadwallet, 'w8_symlink')
234+
assert_raises_rpc_error(-4, "Wallet file verification failed: Invalid -wallet path 'w8_symlink'", self.nodes[0].loadwallet, 'w8_symlink')
240235

241236
# Fail to load if a directory is specified that doesn't contain a wallet
242237
os.mkdir(wallet_dir('empty_wallet_dir'))
@@ -296,7 +291,7 @@ def wallet_file(name):
296291
assert_equal(self.nodes[0].listwallets(), ['w1'])
297292
assert_equal(w1.getwalletinfo()['walletname'], 'w1')
298293

299-
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']))
294+
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']))
300295

301296
# Test backing up and restoring wallets
302297
self.log.info("Test wallet backup")

0 commit comments

Comments
 (0)