From f261f0998446d826b09c1763175675a44314f54f Mon Sep 17 00:00:00 2001 From: Paul Seidler Date: Sun, 3 Apr 2011 15:16:37 +0200 Subject: [PATCH] tests: use localhost --- tests/twisted/connect/test-nonblocking-tls.py | 4 ++-- tests/twisted/gabbletest.py | 2 +- tests/twisted/httptest.py | 2 +- tests/twisted/tubes/tubetestutil.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/twisted/connect/test-nonblocking-tls.py b/tests/twisted/connect/test-nonblocking-tls.py index 21a37e8..8d8fbc1 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) + port1 = reactor.listenTCP(4242, factory, interface='localhost') 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) + port1 = reactor.listenTCP(4343, factory, interface='localhost') bus.add_signal_receiver( diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py index ba3c22e..669fa04 100644 --- a/tests/twisted/gabbletest.py +++ b/tests/twisted/gabbletest.py @@ -579,7 +579,7 @@ def exec_test_deferred(fun, params, protocol=None, timeout=None, resource=resource, suffix=suffix)) factory = StreamFactory(streams, jids) - port = reactor.listenTCP(4242, factory) + port = reactor.listenTCP(4242, factory, interface='localhost') def signal_receiver(*args, **kw): if kw['path'] == '/org/freedesktop/DBus' and \ diff --git a/tests/twisted/httptest.py b/tests/twisted/httptest.py index ce9040c..b7a4fe9 100644 --- a/tests/twisted/httptest.py +++ b/tests/twisted/httptest.py @@ -27,5 +27,5 @@ class HTTPFactory(http.HTTPFactory): return protocol def listen_http(q, port=0): - return reactor.listenTCP(port, HTTPFactory(q)) + return reactor.listenTCP(port, HTTPFactory(q), interface='localhost') diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py index 2420585..3c1a7ca 100644 --- a/tests/twisted/tubes/tubetestutil.py +++ b/tests/twisted/tubes/tubetestutil.py @@ -292,7 +292,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) + reactor.listenTCP(port, factory, interface='localhost') except CannotListenError: continue else: -- 1.7.4.1