Gitiles
Code Review
Sign In
gerrit.openbmc.org
/
stefanberger
/
openbmc
/
c68388fccb8c0b5bf4d6b8efff91203796be98b2
/
.
/
poky
/
meta
/
lib
/
oeqa
/
utils
/
network.py
blob: 59cbbc4f1bccb433ec6db3cace8d7db4c1681797 [
file
] [
log
] [
blame
]
#
# SPDX-License-Identifier: MIT
#
import
socket
def
get_free_port
():
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
bind
((
''
,
0
))
addr
=
s
.
getsockname
()
s
.
close
()
return
addr
[
1
]