diff --git a/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/AutobahnTests.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/AutobahnTests.java index 9b1aaf40cfb..00bcd4e6da0 100644 --- a/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/AutobahnTests.java +++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/AutobahnTests.java @@ -41,6 +41,7 @@ public class AutobahnTests { private static final Logger LOG = LoggerFactory.getLogger(AutobahnTests.class); private static final Path USER_DIR = Paths.get(System.getProperty("user.dir")); + private static final String CHOWN_REPORTS_CMD = "[ -d /target/reports ] && chown -R `stat -c '%u' /target/reports` /target/reports/*"; private Path reportDir; private Path fuzzingServer; @@ -65,7 +66,7 @@ public class AutobahnTests { // We need to chown the generated test results so host has permissions to delete files generated by container. GenericContainer container = new GenericContainer<>("crossbario/autobahn-testsuite:latest") - .withCommand("/bin/bash", "-c", "wstest -m fuzzingserver -s /config/fuzzingserver.json ; chown -R `stat -c '%u' /target/reports` /target/reports/*") + .withCommand("/bin/bash", "-c", "wstest -m fuzzingserver -s /config/fuzzingserver.json ; " + CHOWN_REPORTS_CMD) .withExposedPorts(9001) .withLogConsumer(new Slf4jLogConsumer(LOG)); container.addFileSystemBind(fuzzingServer.toString(), "/config/fuzzingserver.json", BindMode.READ_ONLY); @@ -95,7 +96,7 @@ public class AutobahnTests // We need to chown the generated test results so host has permissions to delete files generated by container. GenericContainer container = new GenericContainer<>("crossbario/autobahn-testsuite:latest") - .withCommand("/bin/bash", "-c", "wstest -m fuzzingclient -s /config/fuzzingclient.json ; chown -R `stat -c '%u' /target/reports` /target/reports/*") + .withCommand("/bin/bash", "-c", "wstest -m fuzzingclient -s /config/fuzzingclient.json ; " + CHOWN_REPORTS_CMD) .withLogConsumer(new Slf4jLogConsumer(LOG)) .withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofHours(1))); container.addFileSystemBind(fuzzingClient.toString(), "/config/fuzzingclient.json", BindMode.READ_ONLY);