mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
commit
5e1d464a65
@ -214,7 +214,10 @@ def write_node_config(c, config):
|
|||||||
|
|
||||||
if config["hide-ip"]:
|
if config["hide-ip"]:
|
||||||
c.write("[connections]\n")
|
c.write("[connections]\n")
|
||||||
c.write("tcp = tor\n")
|
if tor_provider._import_txtorcon():
|
||||||
|
c.write("tcp = tor\n")
|
||||||
|
else:
|
||||||
|
c.write("tcp = disabled\n")
|
||||||
c.write("\n")
|
c.write("\n")
|
||||||
|
|
||||||
c.write("[node]\n")
|
c.write("[node]\n")
|
||||||
|
@ -109,6 +109,18 @@ class Config(unittest.TestCase):
|
|||||||
self.assertEqual(cfg.getboolean("node", "reveal-IP-address"), False)
|
self.assertEqual(cfg.getboolean("node", "reveal-IP-address"), False)
|
||||||
self.assertEqual(cfg.get("connections", "tcp"), "tor")
|
self.assertEqual(cfg.get("connections", "tcp"), "tor")
|
||||||
|
|
||||||
|
@defer.inlineCallbacks
|
||||||
|
def test_client_hide_ip_no_txtorcon(self):
|
||||||
|
txtorcon = mock.patch('allmydata.util.tor_provider._import_txtorcon',
|
||||||
|
return_value=None)
|
||||||
|
with txtorcon:
|
||||||
|
basedir = self.mktemp()
|
||||||
|
rc, out, err = yield run_cli("create-client", "--hide-ip", basedir)
|
||||||
|
self.assertEqual(0, rc)
|
||||||
|
cfg = read_config(basedir)
|
||||||
|
self.assertEqual(cfg.getboolean("node", "reveal-IP-address"), False)
|
||||||
|
self.assertEqual(cfg.get("connections", "tcp"), "disabled")
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def test_client_basedir_exists(self):
|
def test_client_basedir_exists(self):
|
||||||
basedir = self.mktemp()
|
basedir = self.mktemp()
|
||||||
|
Loading…
Reference in New Issue
Block a user