This commit is contained in:
Hennadii Stepanov 2025-04-29 11:49:19 +02:00 committed by GitHub
commit 755f3747c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 13 deletions

View file

@ -374,10 +374,8 @@ jobs:
- name: Run functional tests
env:
# TODO: Fix the excluded test and re-enable it.
EXCLUDE: '--exclude wallet_multiwallet.py'
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
run: py -3 test/functional/test_runner.py --jobs $NUMBER_OF_PROCESSORS --ci --quiet --tmpdirprefix="$RUNNER_TEMP" --combinedlogslen=99999999 --timeout-factor=$TEST_RUNNER_TIMEOUT_FACTOR $EXCLUDE $TEST_RUNNER_EXTRA
run: py -3 test/functional/test_runner.py --jobs $NUMBER_OF_PROCESSORS --ci --quiet --tmpdirprefix="$RUNNER_TEMP" --combinedlogslen=99999999 --timeout-factor=$TEST_RUNNER_TIMEOUT_FACTOR $TEST_RUNNER_EXTRA
asan-lsan-ubsan-integer-no-depends-usdt:
name: 'ASan + LSan + UBSan + integer, no depends, USDT'

View file

@ -85,9 +85,6 @@ class MultiWalletTest(BitcoinTestFramework):
os.symlink('..', wallet_dir('recursive_dir_symlink'))
os.mkdir(wallet_dir('self_walletdat_symlink'))
os.symlink('wallet.dat', wallet_dir('self_walletdat_symlink/wallet.dat'))
# rename wallet.dat to make sure plain wallet file paths (as opposed to
# directory paths) can be loaded
# create another dummy wallet for use in testing backups later
@ -126,6 +123,16 @@ class MultiWalletTest(BitcoinTestFramework):
for wallet_name in to_load:
self.nodes[0].loadwallet(wallet_name)
# Tests for possible scanning errors:
# 0. Baseline, no errors.
with self.nodes[0].assert_debug_log(expected_msgs=[], unexpected_msgs=['Error scanning']):
walletlist = self.nodes[0].listwalletdir()['wallets']
assert_equal(sorted(map(lambda w: w['name'], walletlist)), sorted(in_wallet_dir))
# 1. "Permission denied" error.
if platform.system() != 'Windows':
if os.geteuid() == 0:
self.log.warning('Skipping "permission denied"-test requiring non-root user.')
else:
os.mkdir(wallet_dir('no_access'))
os.chmod(wallet_dir('no_access'), 0)
try:
@ -135,6 +142,17 @@ class MultiWalletTest(BitcoinTestFramework):
# 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))
# 2. "Too many levels of symbolic links" error.
# This test cannot be conducted robustly on Windows
# because it depends on the build toolchain:
# - A cross-compiled bitcoind.exe parses self_walletdat_symlink without errors.
# - A natively compiled bitcoind.exe logs the "Error scanning" message.
if platform.system() != 'Windows':
os.mkdir(wallet_dir('self_walletdat_symlink'))
os.symlink('wallet.dat', wallet_dir('self_walletdat_symlink/wallet.dat'))
with self.nodes[0].assert_debug_log(expected_msgs=['Error scanning']):
walletlist = self.nodes[0].listwalletdir()['wallets']
assert_equal(sorted(map(lambda w: w['name'], walletlist)), sorted(in_wallet_dir))
assert_equal(set(node.listwallets()), set(wallet_names))