diff --git a/ci-scripts/openvidu-e2e-tests.sh b/ci-scripts/openvidu-e2e-tests.sh index 707bcdc5eb..ae0d442d6a 100755 --- a/ci-scripts/openvidu-e2e-tests.sh +++ b/ci-scripts/openvidu-e2e-tests.sh @@ -26,7 +26,7 @@ function environmentLaunch { # Kurento and mediasoup needs to run as network host, so we need Docker host IP. local DOCKER_HOST_IP - DOCKER_HOST_IP="$(docker network inspect bridge | grep Subnet | cut -d'"' -f4 | cut -d'/' -f1 | sed 's/.$/1/' | grep 172)" + DOCKER_HOST_IP="$(docker inspect bridge --format '{{with index .IPAM.Config 0}}{{or .Gateway .Subnet}}{{end}}' | sed -r 's|\.0/[[:digit:]]+$|.1|')" if [[ "${MEDIA_SERVER}" == "kurento" ]]; then docker run -e KMS_UID=$(id -u) --network=host --detach=true --volume=/opt/openvidu/recordings:/opt/openvidu/recordings "${KURENTO_MEDIA_SERVER_IMAGE}" diff --git a/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java b/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java index d8391dd1f3..6e1295bba2 100644 --- a/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java +++ b/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java @@ -638,7 +638,7 @@ protected void startMediaServer(boolean waitUntilKurentoClientReconnection) { + " --volume=/opt/openvidu/recordings:/opt/openvidu/recordings " + MEDIA_SERVER_IMAGE; } else if (MEDIA_SERVER_IMAGE.startsWith(MEDIASOUP_IMAGE)) { log.info("Starting mediaSoup"); - command = "docker network inspect bridge | grep Subnet | cut -d'\"' -f4 | cut -d'/' -f1 | sed 's/.$/1/' | grep 172"; + command = "docker inspect bridge --format '{{with index .IPAM.Config 0}}{{or .Gateway .Subnet}}{{end}}' | sed -r 's|\\.0/[[:digit:]]+$|.1|'"; String dockerGatewayIp = commandLine.executeCommand(command, false, 5); log.info("Discovered docker gateway IP is {}", dockerGatewayIp); command = "LOG_DATE=$(printf '%(%Y-%m-%d-%H-%M-%S)T'); docker run --network=host --restart=always --env=KMS_MIN_PORT=40000 --env=KMS_MAX_PORT=65535"