nit: not tested, but symlink-specific setup and checks could be skipped when symlink creation isnβt supported.
<details>
<summary>diff (just moved `os.symlink`/`w7` under `self.check_symlinks`) </summary>
def test_mixed_wallets(self, node):
self.log.info("Test mixed wallets")
- # create symlink to verify wallet directory path can be referenced
- # through symlink
- os.mkdir(wallet_dir(node, 'w7'))
- os.symlink('w7', wallet_dir(node, 'w7_symlink'))
-
if self.check_symlinks:
+ # Create symlink to verify wallet directory path can be referenced through symlink.
+ os.mkdir(wallet_dir(node, 'w7'))
- os.mkdir(wallet_dir(node, 'w7'))
- os.symlink('w7', wallet_dir(node, 'w7_symlink'))
-
if self.check_symlinks:
+ # Create symlink to verify wallet directory path can be referenced through symlink.
+ os.mkdir(wallet_dir(node, 'w7'))
+ os.symlink('w7', wallet_dir(node, 'w7_symlink'))
os.symlink('..', wallet_dir(node, 'recursive_dir_symlink'))
# rename wallet.dat to make sure plain wallet file paths (as opposed to
@@ -153,12 +147,15 @@ class MultiWalletTest(BitcoinTestFramework):
# w - to verify wallet name matching works when one wallet path is prefix of another
# sub/w5 - to verify relative wallet path is created correctly
# extern/w6 - to verify absolute wallet path is created correctly
- # w7_symlink - to verify symlinked wallet path is initialized correctly
+ # w7_symlink - to verify symlinked wallet path is initialized correctly (symlink-capable platforms only)
# w8 - to verify existing wallet file is loaded correctly. Not tested for SQLite wallets as this is a deprecated BDB behavior.
# '' - to verify default wallet file is created correctly
- to_create = ['w1', 'w2', 'w3', 'w', 'sub/w5', 'w7_symlink']
+ to_create = ['w1', 'w2', 'w3', 'w', 'sub/w5']
+ if self.check_symlinks:
+ to_create.append('w7_symlink')
in_wallet_dir = [w.replace('/', os.path.sep) for w in to_create] # Wallets in the wallet dir
- in_wallet_dir.append('w7') # w7 is not loaded or created, but will be listed by listwalletdir because w7_symlink
+ if self.check_symlinks:
+ in_wallet_dir.append('w7') # w7 is not loaded or created, but will be listed by listwalletdir because w7_symlink
to_create.append(os.path.join(self.options.tmpdir, 'extern/w6')) # External, not in the wallet dir, so we need to avoid adding it to in_wallet_dir
to_load = [self.default_wallet_name]
:
- os.mkdir(wallet_dir(node, 'w7'))
- os.symlink('w7', wallet_dir(node, 'w7_symlink'))
-
if self.check_symlinks:
+ # Create symlink to verify wallet directory path can be referenced through symlink.
+ os.mkdir(wallet_dir(node, 'w7'))
+ os.symlink('w7', wallet_dir(node, 'w7_symlink'))
os.symlink('..', wallet_dir(node, 'recursive_dir_symlink'))
# rename wallet.dat to make sure plain wallet file paths (as opposed to
@@ -153,12 +147,15 @@ class MultiWalletTest(BitcoinTestFramework):
# w - to verify wallet name matching works when one wallet path is prefix of another
# sub/w5 - to verify relative wallet path is created correctly
# extern/w6 - to verify absolute wallet path is created correctly
- # w7_symlink - to verify symlinked wallet path is initialized correctly
+ # w7_symlink - to verify symlinked wallet path is initialized correctly (symlink-capable platforms only)
# w8 - to verify existing wallet file is loaded correctly. Not tested for SQLite wallets as this is a deprecated BDB behavior.
# '' - to verify default wallet file is created correctly
- to_create = ['w1', 'w2', 'w3', 'w', 'sub/w5', 'w7_symlink']
+ to_create = ['w1', 'w2', 'w3', 'w', 'sub/w5']
+ if self.check_symlinks:
+ to_create.append('w7_symlink')
in_wallet_dir = [w.replace('/', os.path.sep) for w in to_create] # Wallets in the wallet dir
- in_wallet_dir.append('w7') # w7 is not loaded or created, but will be listed by listwalletdir because w7_symlink
+ if self.check_symlinks:
+ in_wallet_dir.append('w7') # w7 is not loaded or created, but will be listed by listwalletdir because w7_symlink
to_create.append(os.path.join(self.options.tmpdir, 'extern/w6')) # External, not in the wallet dir, so we need to avoid adding it to in_wallet_dir
to_load = [self.default_wallet_name]
</details>