aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorTomas van der Wansem <tomas@tomasvdw.nl>2017-09-21 00:10:46 +0200
committerMarcoFalke <falke.marco@gmail.com>2017-11-01 15:23:06 -0400
commitfd79ed6b202ec872aa794ba6a23d4dfc373a98f1 (patch)
tree9a8e2ce5deba2c1ba8dd4c0da0145275624d80cc /test/functional
parentd94fc336c47b5fd0f42217806faad1aa201b9d63 (diff)
downloadbitcoin-fd79ed6b202ec872aa794ba6a23d4dfc373a98f1.tar.xz
Ensure backupwallet fails when attempting to backup to source file
Previous behaviour was to destroy the wallet (to zero-length) Github-Pull: #11376 Rebased-From: 5d465e396249a0e2cc60b16984a2bdbe4c8993c3
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/walletbackup.py10
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()