qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject qpid-proton git commit: PROTON-1133: Thou Shalt Not Mix 'localhost' and '127.0.0.1' In Thy Testing
Date Sun, 15 May 2016 22:21:20 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 01a65add6 -> b1c348889


PROTON-1133: Thou Shalt Not Mix 'localhost' and '127.0.0.1' In Thy Testing


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/b1c34888
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/b1c34888
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/b1c34888

Branch: refs/heads/master
Commit: b1c34888978096ef6da4bf64cff1bf1b18467007
Parents: 01a65ad
Author: Ken Giusti <kgiusti@apache.org>
Authored: Sun May 15 18:21:11 2016 -0400
Committer: Ken Giusti <kgiusti@apache.org>
Committed: Sun May 15 18:21:11 2016 -0400

----------------------------------------------------------------------
 tests/python/proton_tests/reactor.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b1c34888/tests/python/proton_tests/reactor.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/reactor.py b/tests/python/proton_tests/reactor.py
index 2f17bb6..1f04e5e 100644
--- a/tests/python/proton_tests/reactor.py
+++ b/tests/python/proton_tests/reactor.py
@@ -542,15 +542,16 @@ class ContainerTest(Test):
         assert test_handler.verified
 
     class _ServerHandler(MessagingHandler):
-        def __init__(self):
+        def __init__(self, host):
             super(ContainerTest._ServerHandler, self).__init__()
+            self.host = host
             port = free_tcp_port()
             self.port = free_tcp_port()
             self.client_addr = None
             self.peer_hostname = None
 
         def on_start(self, event):
-            self.listener = event.container.listen("0.0.0.0:%s" % self.port)
+            self.listener = event.container.listen("%s:%s" % (self.host, self.port))
 
         def on_connection_opened(self, event):
             self.client_addr = event.reactor.get_connection_address(event.connection)
@@ -570,7 +571,7 @@ class ContainerTest(Test):
             event.connection.close()
 
     def test_numeric_hostname(self):
-        server_handler = ContainerTest._ServerHandler()
+        server_handler = ContainerTest._ServerHandler("127.0.0.1")
         client_handler = ContainerTest._ClientHandler()
         container = Container(server_handler)
         container.connect(url=Url(host="127.0.0.1",
@@ -583,7 +584,7 @@ class ContainerTest(Test):
         assert client_handler.server_addr.rsplit(':', 1)[1] == str(server_handler.port)
 
     def test_non_numeric_hostname(self):
-        server_handler = ContainerTest._ServerHandler()
+        server_handler = ContainerTest._ServerHandler("localhost")
         client_handler = ContainerTest._ClientHandler()
         container = Container(server_handler)
         container.connect(url=Url(host="localhost",
@@ -596,7 +597,7 @@ class ContainerTest(Test):
         assert client_handler.server_addr.rsplit(':', 1)[1] == str(server_handler.port)
 
     def test_virtual_host(self):
-        server_handler = ContainerTest._ServerHandler()
+        server_handler = ContainerTest._ServerHandler("localhost")
         container = Container(server_handler)
         conn = container.connect(url=Url(host="localhost",
                                          port=server_handler.port),
@@ -613,7 +614,7 @@ class ContainerTest(Test):
             # host, so when proton-j sets up the connection the virtual host
             # seems to be unset and the URL's host is used (as expected).
             raise SkipTest("Does not apply for proton-j");
-        server_handler = ContainerTest._ServerHandler()
+        server_handler = ContainerTest._ServerHandler("localhost")
         container = Container(server_handler)
         conn = container.connect(url=Url(host="localhost",
                                          port=server_handler.port),


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message