Skip to content

Commit 161dd7e

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24687: test: Check an invalid -i2psam will raise an init error
45e67b2 test: invalid -i2psam will raise an init error (brunoerg) Pull request description: This PR adds test coverage (at `feature_proxy.py`) for the following init error: https://github.com/bitcoin/bitcoin/blob/2f0f056e08cd5a1435120592a9ecd212fcdb915b/src/init.cpp#L1791 It starts the node with an invalid -i2psam (`-i2psam=invalidhere`) and test if it raises an error when initializing. ACKs for top commit: dunxen: Code review ACK 45e67b2 Tree-SHA512: b24e3f6e7a9316b9ebc0b6c8bcf1315faff60a9e258d7bb3dbeb9f6695a728bb3083aea2f81114072fe13822bfca34d4a0f44f229825f7c97a81619d810010c0
2 parents dc0ba8c + 45e67b2 commit 161dd7e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/functional/feature_proxy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
3434
- Test passing invalid -proxy
3535
- Test passing invalid -onion
36+
- Test passing invalid -i2psam
3637
- Test passing -onlynet=onion without -proxy or -onion
3738
- Test passing -onlynet=onion with -onion=0 and with -noonion
3839
"""
@@ -329,6 +330,11 @@ def networks_dict(d):
329330
msg = "Error: Invalid -onion address or hostname: 'xyz:abc'"
330331
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
331332

333+
self.log.info("Test passing invalid -i2psam raises expected init error")
334+
self.nodes[1].extra_args = ["-i2psam=def:xyz"]
335+
msg = "Error: Invalid -i2psam address or hostname: 'def:xyz'"
336+
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
337+
332338
msg = (
333339
"Error: Outbound connections restricted to Tor (-onlynet=onion) but "
334340
"the proxy for reaching the Tor network is not provided (no -proxy= "

0 commit comments

Comments
 (0)