diff options
| author | Damian Johnson <atagar@torproject.org> | 2017-05-10 11:14:26 -0700 |
|---|---|---|
| committer | Damian Johnson <atagar@torproject.org> | 2017-05-10 11:16:22 -0700 |
| commit | e35286dd97c49c9741497fae9cc544247a6d3c9f (patch) | |
| tree | 6741e7bed85ed017b74515106832677d5b01aa89 | |
| parent | b2a54ada71c9ee1442780d8df4c8ffa892fd285f (diff) | |
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
| -rw-r--r-- | test/integ/control/controller.py | 6 | ||||
| -rw-r--r-- | test/integ/process.py | 2 | ||||
| -rw-r--r-- | test/runner.py | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py index 895d435a..2445221e 100644 --- a/test/integ/control/controller.py +++ b/test/integ/control/controller.py @@ -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) diff --git a/test/integ/process.py b/test/integ/process.py index b81a3bf1..79797ac7 100644 --- a/test/integ/process.py +++ b/test/integ/process.py @@ -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] diff --git a/test/runner.py b/test/runner.py index a494b65e..69af65d3 100644 --- a/test/runner.py +++ b/test/runner.py @@ -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 |
