Skip to content
Snippets Groups Projects
Commit e35286dd authored by Damian Johnson's avatar Damian Johnson
Browse files

Replace SocksListenAddress with SocksPort in tests

Tor deprecated its SocksListenAddress option a while ago and has now dropped
it, causing some integ tests to fail. Accounting for this.

The option's deprecation was noted in the maual and logs but our tests don't
present those so didn't spot the upcoming deprecation. Oops. :P
parent b2a54ada
Branches
Tags
No related merge requests found
......@@ -435,10 +435,10 @@ class TestController(unittest.TestCase):
custom_options = controller._get_custom_options()
self.assertTrue('ControlPort' in custom_options or 'ControlSocket' in custom_options)
self.assertEqual('1', custom_options['DownloadExtraInfo'])
self.assertEqual('127.0.0.1:1112', custom_options['SocksListenAddress'])
self.assertEqual('1112', custom_options['SocksPort'])
self.assertTrue(controller.is_set('DownloadExtraInfo'))
self.assertTrue(controller.is_set('SocksListenAddress'))
self.assertTrue(controller.is_set('SocksPort'))
self.assertFalse(controller.is_set('CellStatistics'))
self.assertFalse(controller.is_set('ConnLimit'))
......@@ -1070,7 +1070,7 @@ class TestController(unittest.TestCase):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(30)
s.connect(('127.0.0.1', int(controller.get_conf('SocksListenAddress').rsplit(':', 1)[1])))
s.connect(('127.0.0.1', int(controller.get_conf('SocksPort'))))
test.network.negotiate_socks(s, '1.2.1.2', 80)
s.sendall(stem.util.str_tools._to_bytes(test.network.ip_request)) # make the http request for the ip address
response = s.recv(1000)
......
......@@ -306,7 +306,7 @@ class TestProcess(unittest.TestCase):
t.start()
t.join()
if 'Invalid SocksPort/SocksListenAddress' in str(raised_exc[0]):
if 'Invalid SocksPort' in str(raised_exc[0]):
return None # got to the point of invoking tor
else:
return raised_exc[0]
......
......@@ -58,16 +58,15 @@ CONFIG = stem.util.conf.config_dict('test', {
'integ.log': './test/data/log',
})
SOCKS_HOST = '127.0.0.1'
SOCKS_PORT = 1112
BASE_TORRC = """# configuration for stem integration tests
DataDirectory %%s
SocksListenAddress %s:%i
SocksPort %i
DownloadExtraInfo 1
Log notice stdout
Log notice file %%s/tor_log
""" % (SOCKS_HOST, SOCKS_PORT)
""" % SOCKS_PORT
# singleton Runner instance
INTEG_RUNNER = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment