aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_proxy.py
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2022-03-01 22:47:23 +0100
committerJon Atack <jon@atack.com>2022-03-03 15:31:37 +0100
commit7000f66d367123d1de303fc15ce2ce60df379c11 (patch)
treedadd9672e2cddf607af11140998044c04dc21f5f /test/functional/feature_proxy.py
parent8332e6e4cf45455fea0bf1f7527256cdb7bb1e6d (diff)
downloadbitcoin-7000f66d367123d1de303fc15ce2ce60df379c11.tar.xz
test: passing -onlynet=onion without -proxy/-onion raises expected init error
Diffstat (limited to 'test/functional/feature_proxy.py')
-rwxr-xr-xtest/functional/feature_proxy.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/feature_proxy.py b/test/functional/feature_proxy.py
index fa047ba928..d23733c5d3 100755
--- a/test/functional/feature_proxy.py
+++ b/test/functional/feature_proxy.py
@@ -33,6 +33,7 @@ addnode connect to a CJDNS address
- Test passing invalid -proxy
- Test passing invalid -onion
+- Test passing -onlynet=onion without -proxy or -onion
"""
import socket
@@ -319,6 +320,15 @@ class ProxyTest(BitcoinTestFramework):
msg = "Error: Invalid -onion address or hostname: 'xyz:abc'"
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
+ msg = (
+ "Error: Outbound connections restricted to Tor (-onlynet=onion) but "
+ "the proxy for reaching the Tor network is not provided (no -proxy= "
+ "and no -onion= given) or it is explicitly forbidden (-onion=0)"
+ )
+ self.log.info("Test passing -onlynet=onion without -proxy or -onion raises expected init error")
+ self.nodes[1].extra_args = ["-onlynet=onion"]
+ self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
+
if __name__ == '__main__':
ProxyTest().main()