The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/4732
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Stéphane Graber <[email protected]>
From 3024992f0bcfd7337f811efd4489954cafe769d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]> Date: Wed, 4 Jul 2018 11:50:08 -0400 Subject: [PATCH] tests: Add alternative TCP port finder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <[email protected]> --- test/includes/net.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/includes/net.sh b/test/includes/net.sh index e6e3c2757..1b5512523 100644 --- a/test/includes/net.sh +++ b/test/includes/net.sh @@ -2,6 +2,19 @@ # Return an available random local port local_tcp_port() { + if which python3 >/dev/null 2>&1; then + ( + cat << EOF +import socket +s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +s.bind(('127.0.0.1', 0)) +print(s.getsockname()[1]) +s.close() +EOF + ) | python3 + return + fi + # shellcheck disable=SC2039 local port pid
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
