diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-11-01 12:26:23 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-11-01 12:27:02 -0400 |
commit | 1b8c88451b0554502435d3883c528ad0aad1b09b (patch) | |
tree | 90cf986283ccd754f0933e669c00eee2329c1027 /test/functional | |
parent | cffa5ee132f3ef6a8d138eb98d15da2b61999ca4 (diff) | |
parent | 5d465e396249a0e2cc60b16984a2bdbe4c8993c3 (diff) |
Merge #11376: Ensure backupwallet fails when attempting to backup to source file
5d465e396 Ensure backupwallet fails when attempting to backup to source file (Tomas van der Wansem)
Pull request description:
Previous behaviour was to destroy the wallet (to zero-length)
This fixes #11375
Tree-SHA512: bfd1738659b15e3f23b6bbdf55ec12269c62c820bf701daec19500b52bd5845bb5516733c6f76f36197eb155182a8a35dc239ad4de2ef1e59bbb0f124a455759
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/walletbackup.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/walletbackup.py b/test/functional/walletbackup.py index 15ea26afa1..85a149793e 100755 --- a/test/functional/walletbackup.py +++ b/test/functional/walletbackup.py @@ -190,6 +190,16 @@ class WalletBackupTest(BitcoinTestFramework): assert_equal(self.nodes[1].getbalance(), balance1) assert_equal(self.nodes[2].getbalance(), balance2) + # Backup to source wallet file must fail + sourcePaths = [ + tmpdir + "/node0/regtest/wallet.dat", + tmpdir + "/node0/./regtest/wallet.dat", + tmpdir + "/node0/regtest/", + tmpdir + "/node0/regtest"] + + for sourcePath in sourcePaths: + assert_raises_rpc_error(-4, "backup failed", self.nodes[0].backupwallet, sourcePath) + if __name__ == '__main__': WalletBackupTest().main() |