merge bitcoin#25173: add coverage for unknown network in -onlynet

This commit is contained in:
Kittywhiskers Van Gogh 2022-05-19 10:42:56 -03:00
parent 77efd36112
commit e67ed92d3d
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -36,6 +36,7 @@ addnode connect to a CJDNS address
- Test passing invalid -i2psam - Test passing invalid -i2psam
- Test passing -onlynet=onion without -proxy or -onion - Test passing -onlynet=onion without -proxy or -onion
- Test passing -onlynet=onion with -onion=0 and with -noonion - Test passing -onlynet=onion with -onion=0 and with -noonion
- Test passing unknown -onlynet
""" """
import socket import socket
@ -341,6 +342,11 @@ class ProxyTest(BitcoinTestFramework):
self.nodes[1].extra_args = ["-onlynet=onion", arg] self.nodes[1].extra_args = ["-onlynet=onion", arg]
self.nodes[1].assert_start_raises_init_error(expected_msg=msg) 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__': if __name__ == '__main__':
ProxyTest().main() ProxyTest().main()