Skip to content

Commit 43a66c5

Browse files
committed
Merge bitcoin#30053: test: added test coverage to loadtxoutset could not open file
ee67bba test: added test coverage to loadtxoutset (kevkevin) Pull request description: The functional test coverage did not cover the rpc error of "Couldn't open file..." for loadtxoutset and this test adds coverage for it This adds coverage to this line https://github.com/bitcoin/bitcoin/blob/master/src/rpc/blockchain.cpp#L2777 ACKs for top commit: maflcko: ACK ee67bba davidgumberg: LGTM ACK bitcoin@ee67bba rkrux: ACK [ee67bba](bitcoin@ee67bba) alfonsoromanz: ACK ee67bba. Code looks good to me. I also ran `test/functional/feature_assumeutxo.py` to make sure all tests passes, including this one. tdb3: ACK for ee67bba Tree-SHA512: 210a7eb928f625d2a8d9acb63ee83cb4aaec9c267e5a0c52ad219c2935466e2cdc68667e30ad29566e6060981587e5bec42805d296f6e60f9b3b13f3330575f2
2 parents 74f517b + ee67bba commit 43a66c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/functional/feature_assumeutxo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ def test_invalid_mempool_state(self, dump_output_path):
155155

156156
self.restart_node(2, extra_args=self.extra_args[2])
157157

158+
def test_invalid_file_path(self):
159+
self.log.info("Test bitcoind should fail when file path is invalid.")
160+
node = self.nodes[0]
161+
path = node.datadir_path / node.chain / "invalid" / "path"
162+
assert_raises_rpc_error(-8, "Couldn't open file {} for reading.".format(path), node.loadtxoutset, path)
163+
158164
def run_test(self):
159165
"""
160166
Bring up two (disconnected) nodes, mine some new blocks on the first,
@@ -239,6 +245,7 @@ def run_test(self):
239245
self.test_invalid_mempool_state(dump_output['path'])
240246
self.test_invalid_snapshot_scenarios(dump_output['path'])
241247
self.test_invalid_chainstate_scenarios()
248+
self.test_invalid_file_path()
242249

243250
self.log.info(f"Loading snapshot into second node from {dump_output['path']}")
244251
loaded = n1.loadtxoutset(dump_output['path'])

0 commit comments

Comments
 (0)