[oe-commits] [openembedded-core] 08/103: oeqa/utils: added new network module

git at git.openembedded.org git at git.openembedded.org
Sun Feb 28 11:35:08 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 72b336ad0d0a2994f00c57747686111a59fa8b29
Author: Francisco Pedraza <francisco.j.pedraza.gonzalez at intel.com>
AuthorDate: Fri Feb 19 16:05:41 2016 -0600

    oeqa/utils: added new network module
    
    A network module was added, and will contain network utility funcions for now.
    with get_free_port that returns available network port in the system.
    
    Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez at intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oeqa/utils/network.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/lib/oeqa/utils/network.py b/meta/lib/oeqa/utils/network.py
new file mode 100644
index 0000000..2768f6c
--- /dev/null
+++ b/meta/lib/oeqa/utils/network.py
@@ -0,0 +1,8 @@
+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]

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list