Gitiles
Code Review
Sign In
gerrit.openbmc.org
/
stefanberger
/
openbmc
/
977dc1ac484e0c201b30f551e5f2d1d32e27eccf
/
.
/
poky
/
meta
/
lib
/
oeqa
/
utils
/
network.py
blob: 2768f6c5db89e060edb572a3742fb59a56f48f8b [
file
] [
log
] [
blame
]
Patrick Williams
d8c66bc
2016-06-20 12:57:21 -0500
[
diff
] [
blame
]
1
import
socket
2
3
def
get_free_port
():
4
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
5
s
.
bind
((
''
,
0
))
6
addr
=
s
.
getsockname
()
7
s
.
close
()
8
return
addr
[
1
]