Skip to content

Commit d433f59

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#25173: test: add coverage for unknown network in -onlynet
055d94d test: add coverage for unknown network in -onlynet (brunoerg) Pull request description: This PR adds test coverage for the following init error by passing an unknown network in -onlynet https://github.com/bitcoin/bitcoin/blob/0de36941eca1bff91420dd878eb097db2b1a596c/src/init.cpp#L1311 ACKs for top commit: MarcoFalke: rACK 055d94d Tree-SHA512: 01bbb297afff371f6345889fa04117ff195b68f0bbf934878ba446049791fdbd7d2ce119ee4f9b3616cc0a81330d7055507dc81151acf68532c077f3575258e9
2 parents 6407c0e + 055d94d commit d433f59

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
@@ -36,6 +36,7 @@
3636
- Test passing invalid -i2psam
3737
- Test passing -onlynet=onion without -proxy or -onion
3838
- Test passing -onlynet=onion with -onion=0 and with -noonion
39+
- Test passing unknown -onlynet
3940
"""
4041

4142
import socket
@@ -349,6 +350,11 @@ def networks_dict(d):
349350
self.nodes[1].extra_args = ["-onlynet=onion", arg]
350351
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
351352

353+
self.log.info("Test passing unknown network to -onlynet raises expected init error")
354+
self.nodes[1].extra_args = ["-onlynet=abc"]
355+
msg = "Error: Unknown network specified in -onlynet: 'abc'"
356+
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
357+
352358

353359
if __name__ == '__main__':
354360
ProxyTest().main()

0 commit comments

Comments
 (0)