-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
On the master branch @ ebe4cac, the wallet_multiwallet.py test has several issues:
-
This code:
checks for the "Error scanning" message in thebitcoin/test/functional/wallet_multiwallet.py
Lines 132 to 140 in ebe4cac
os.mkdir(wallet_dir('no_access')) os.chmod(wallet_dir('no_access'), 0) try: with self.nodes[0].assert_debug_log(expected_msgs=['Error scanning']): walletlist = self.nodes[0].listwalletdir()['wallets'] finally: # Need to ensure access is restored for cleanup os.chmod(wallet_dir('no_access'), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) assert_equal(sorted(map(lambda w: w['name'], walletlist)), sorted(in_wallet_dir)) debug.logcaused by processing theno_accessdirectory. However, the same message can also be generated when parsing theself_walletdat_symlinkdirectory. As a result, the current implementation is prone to producing false-positive results. -
Parsing the
self_walletdat_symlinkdirectory withbitcoind.exedepends on how it was built. When cross-compiling, the parsing completes without system errors. On the other hand, when building natively, it raises an "unknown error" exception and logs the "Error scanning" message. -
This code:
is not portable due to its use ofbitcoin/test/functional/wallet_multiwallet.py
Lines 132 to 139 in ebe4cac
os.mkdir(wallet_dir('no_access')) os.chmod(wallet_dir('no_access'), 0) try: with self.nodes[0].assert_debug_log(expected_msgs=['Error scanning']): walletlist = self.nodes[0].listwalletdir()['wallets'] finally: # Need to ensure access is restored for cleanup os.chmod(wallet_dir('no_access'), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) os.chmod:
Note: Although Windows supports
chmod(), you can only set the file’s read-only flag with it (via thestat.S_IWRITEandstat.S_IREADconstants or a corresponding integer value).