diff --git a/ci-scripts/openvidu-e2e-tests.sh b/ci-scripts/openvidu-e2e-tests.sh index f4a25ff4dc..707bcdc5eb 100755 --- a/ci-scripts/openvidu-e2e-tests.sh +++ b/ci-scripts/openvidu-e2e-tests.sh @@ -49,7 +49,7 @@ function environmentLaunch { fi done elif [[ "${MEDIA_SERVER}" == "mediasoup" ]]; then - LOG_DATE=$(printf '%(%Y-%m-%d-%H:%M:%S)T') + 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 \ diff --git a/openvidu-test-browsers/src/main/java/io/openvidu/test/browsers/utils/CommandLineExecutor.java b/openvidu-test-browsers/src/main/java/io/openvidu/test/browsers/utils/CommandLineExecutor.java index a08ca7e23b..2d3ae09479 100644 --- a/openvidu-test-browsers/src/main/java/io/openvidu/test/browsers/utils/CommandLineExecutor.java +++ b/openvidu-test-browsers/src/main/java/io/openvidu/test/browsers/utils/CommandLineExecutor.java @@ -27,10 +27,17 @@ public class CommandLineExecutor { * WARNING: does not work with subshell. i.e: echo $(VARIABLE) */ public String executeCommand(String command, int secondsTimeout) { + return this.executeCommand(command, false, secondsTimeout); + } + + /** + * WARNING: does not work with subshell. i.e: echo $(VARIABLE) + */ + public String executeCommand(String command, boolean useBash, int secondsTimeout) { String output = ""; Process p = null; try { - p = Runtime.getRuntime().exec((new String[] { "/bin/sh", "-c", command })); + p = Runtime.getRuntime().exec((new String[] { "/bin/" + (useBash ? "bash" : "sh"), "-c", command })); if (!p.waitFor(secondsTimeout, TimeUnit.SECONDS)) { System.err.println("Command " + command + " did not completed in " + secondsTimeout + " seconds"); p.destroyForcibly(); 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 3bd43a80b3..39e932c5b2 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,16 +638,17 @@ 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 = "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" + 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" + " --env=OPENVIDU_PRO_LICENSE=" + OPENVIDU_PRO_LICENSE + " --env=OPENVIDU_PRO_LICENSE_API=" + OPENVIDU_PRO_LICENSE_API + " --env=WEBRTC_LISTENIPS_0_ANNOUNCEDIP=172.17.0.1 --env=WEBRTC_LISTENIPS_0_IP=172.17.0.1" - + " --volume=/opt/openvidu/recordings:/opt/openvidu/recordings " + MEDIA_SERVER_IMAGE + " >& /opt/openvidu/mediasoup-controller-${LOG_DATE}.log &"; + + " --volume=/opt/openvidu/recordings:/opt/openvidu/recordings " + MEDIA_SERVER_IMAGE + + " >& /opt/openvidu/mediasoup-controller-${LOG_DATE}.log &"; } else { log.error("Unrecognized MEDIA_SERVER_IMAGE: {}", MEDIA_SERVER_IMAGE); System.exit(1); } - commandLine.executeCommand(command, 60); + commandLine.executeCommand(command, true, 60); if (waitUntilKurentoClientReconnection) { try { Thread.sleep(5000);