From 55c6cba8d22663b2847087d3d085cf9e7f5a0c5b Mon Sep 17 00:00:00 2001 From: Alban Crequy Date: Wed, 1 Feb 2012 16:21:21 +0000 Subject: [PATCH 2/2] Don't use "localhost" for listening: name resolution is not working --- tests/twisted/bytestream.py | 2 +- tests/twisted/connect/test-nonblocking-tls.py | 4 ++-- tests/twisted/gabbletest.py | 2 +- tests/twisted/httptest.py | 2 +- tests/twisted/tubes/tubetestutil.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/twisted/bytestream.py b/tests/twisted/bytestream.py index e88c677..6686674 100644 --- a/tests/twisted/bytestream.py +++ b/tests/twisted/bytestream.py @@ -145,7 +145,7 @@ class Bytestream(object): def listen_socks5(q): for port in range(5000, 5100): try: - reactor.listenTCP(port, S5BFactory(q.append), interface='localhost') + reactor.listenTCP(port, S5BFactory(q.append), interface='127.0.0.1') except CannotListenError: continue else: diff --git a/tests/twisted/connect/test-nonblocking-tls.py b/tests/twisted/connect/test-nonblocking-tls.py index 1ca64a3..0b190f0 100644 --- a/tests/twisted/connect/test-nonblocking-tls.py +++ b/tests/twisted/connect/test-nonblocking-tls.py @@ -104,7 +104,7 @@ if __name__ == '__main__': factory = twisted.internet.protocol.Factory() factory.protocol = lambda:stream1 - port1 = reactor.listenTCP(4242, factory, interface='localhost') + port1 = reactor.listenTCP(4242, factory, interface='127.0.0.1') params = { 'account': 'test2@localhost/Resource', @@ -119,7 +119,7 @@ if __name__ == '__main__': factory = twisted.internet.protocol.Factory() factory.protocol = lambda:stream2 - port1 = reactor.listenTCP(4343, factory, interface='localhost') + port1 = reactor.listenTCP(4343, factory, interface='127.0.0.1') bus.add_signal_receiver( diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py index ba9004c..a4a46fd 100644 --- a/tests/twisted/gabbletest.py +++ b/tests/twisted/gabbletest.py @@ -593,7 +593,7 @@ def exec_test_deferred(fun, params, protocol=None, timeout=None, factory = StreamFactory(streams, jids) try: - port = reactor.listenTCP(tcpport, factory, interface='localhost') + port = reactor.listenTCP(tcpport, factory, interface='127.0.0.1') listen_success = True break except Exception, e: diff --git a/tests/twisted/httptest.py b/tests/twisted/httptest.py index 1ca1b6d..80602c8 100644 --- a/tests/twisted/httptest.py +++ b/tests/twisted/httptest.py @@ -28,5 +28,5 @@ class HTTPFactory(http.HTTPFactory): return protocol def listen_http(q, port=0): - return reactor.listenTCP(port, HTTPFactory(q), interface='localhost') + return reactor.listenTCP(port, HTTPFactory(q), interface='127.0.0.1') diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py index 9aeb89e..0158253 100644 --- a/tests/twisted/tubes/tubetestutil.py +++ b/tests/twisted/tubes/tubetestutil.py @@ -306,7 +306,7 @@ def create_server(q, address_type, factory=None, block_reading=False, elif address_type == cs.SOCKET_ADDRESS_TYPE_IPV4: for port in range(5000,6000): try: - reactor.listenTCP(port, factory, interface='localhost') + reactor.listenTCP(port, factory, interface='127.0.0.1') except CannotListenError: continue else: -- 1.7.7.3