Skip to content

qa: Broken wallet_multiwallet.py #31409

@hebasto

Description

@hebasto

On the master branch @ ebe4cac, the wallet_multiwallet.py test has several issues:

  1. This code:

    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))
    checks for the "Error scanning" message in the debug.log caused by processing the no_access directory. However, the same message can also be generated when parsing the self_walletdat_symlink directory. As a result, the current implementation is prone to producing false-positive results.

  2. Parsing the self_walletdat_symlink directory with bitcoind.exe depends 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.

  3. This code:

    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)
    is not portable due to its use of os.chmod:

Note: Although Windows supports chmod(), you can only set the file’s read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD constants or a corresponding integer value).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions