Skip to content

Commit 7000f66

Browse files
committed
test: passing -onlynet=onion without -proxy/-onion raises expected init error
1 parent 8332e6e commit 7000f66

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/functional/feature_proxy.py

Lines changed: 10 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 -onlynet=onion without -proxy or -onion
3637
"""
3738

3839
import socket
@@ -319,6 +320,15 @@ def networks_dict(d):
319320
msg = "Error: Invalid -onion address or hostname: 'xyz:abc'"
320321
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
321322

323+
msg = (
324+
"Error: Outbound connections restricted to Tor (-onlynet=onion) but "
325+
"the proxy for reaching the Tor network is not provided (no -proxy= "
326+
"and no -onion= given) or it is explicitly forbidden (-onion=0)"
327+
)
328+
self.log.info("Test passing -onlynet=onion without -proxy or -onion raises expected init error")
329+
self.nodes[1].extra_args = ["-onlynet=onion"]
330+
self.nodes[1].assert_start_raises_init_error(expected_msg=msg)
331+
322332

323333
if __name__ == '__main__':
324334
ProxyTest().main()

0 commit comments

Comments
 (0)