summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/connect_remote/EchoServer.py
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2014-09-08 17:06:54 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2014-09-08 17:06:54 +0000
commitea65e37beea96207b6fa64959112dc7ba6e44b3c (patch)
tree576755ca12ab2ae5ebaa0f7ca846250cead8ae90 /lldb/test/functionalities/connect_remote/EchoServer.py
parent3d3e2c72ec17876fb1b77cf61cad2e552958c09e (diff)
downloadbcm5719-llvm-ea65e37beea96207b6fa64959112dc7ba6e44b3c.tar.gz
bcm5719-llvm-ea65e37beea96207b6fa64959112dc7ba6e44b3c.zip
Fix test failure for test/functionalities/connect_remote/TestConnectRemote.py when port 12345 is already in use
Reviewed at http://reviews.llvm.org/D5221 llvm-svn: 217388
Diffstat (limited to 'lldb/test/functionalities/connect_remote/EchoServer.py')
-rwxr-xr-xlldb/test/functionalities/connect_remote/EchoServer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/test/functionalities/connect_remote/EchoServer.py b/lldb/test/functionalities/connect_remote/EchoServer.py
index 3e6823c89d4..658690ec754 100755
--- a/lldb/test/functionalities/connect_remote/EchoServer.py
+++ b/lldb/test/functionalities/connect_remote/EchoServer.py
@@ -8,10 +8,11 @@ Taken from http://docs.python.org/library/socket.html#example.
import socket
HOST = 'localhost' # Symbolic name meaning local interfaces
-PORT = 12345 # Arbitrary non-privileged port
+PORT = 0 # Let the system give us a random free port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
-print '\nListening on %s:%d' % (HOST, PORT)
+PORT = s.getsockname()[1]
+print 'Listening on %s:%d' % (HOST, PORT)
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
OpenPOWER on IntegriCloud