aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-05-20 08:17:34 +0100
committerMacroFake <falke.marco@gmail.com>2022-05-20 08:18:02 +0100
commitd433f59f1eb815665a6b3a64d90f0b87864d6fe7 (patch)
tree9565a17746a7efab6eb2601e48cb6227a49323d2 /test/functional
parent6407c0e8a33f5a04eae4ebfb5befdcc1c2ab2b57 (diff)
parent055d94d1ab4937ed0080459fbe63568dc47b6786 (diff)
downloadbitcoin-d433f59f1eb815665a6b3a64d90f0b87864d6fe7.tar.xz
Merge bitcoin/bitcoin#25173: test: add coverage for unknown network in -onlynet
055d94d1ab4937ed0080459fbe63568dc47b6786 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 055d94d1ab4937ed0080459fbe63568dc47b6786 Tree-SHA512: 01bbb297afff371f6345889fa04117ff195b68f0bbf934878ba446049791fdbd7d2ce119ee4f9b3616cc0a81330d7055507dc81151acf68532c077f3575258e9
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/feature_proxy.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/feature_proxy.py b/test/functional/feature_proxy.py
index 8541c3ed88..50e0e2c4cc 100755
--- a/test/functional/feature_proxy.py
+++ b/test/functional/feature_proxy.py
@@ -36,6 +36,7 @@ addnode connect to a CJDNS address
- Test passing invalid -i2psam
- Test passing -onlynet=onion without -proxy or -onion
- Test passing -onlynet=onion with -onion=0 and with -noonion
+- Test passing unknown -onlynet
"""
import socket
@@ -349,6 +350,11 @@ class ProxyTest(BitcoinTestFramework):
self.nodes[1].extra_args = ["-onlynet=onion", arg]
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
+ self.log.info("Test passing unknown network to -onlynet raises expected init error")
+ self.nodes[1].extra_args = ["-onlynet=abc"]
+ msg = "Error: Unknown network specified in -onlynet: 'abc'"
+ self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
+
if __name__ == '__main__':
ProxyTest().main()