Skip to content

Commit 6e2152d

Browse files
authored
[8.x] Use unsecure entropy source in docker packaging tests (elastic#119598) (elastic#119610)
1 parent 446c756 commit 6e2152d

File tree

1 file changed

+8
-0
lines changed
  • qa/packaging/src/test/java/org/elasticsearch/packaging/util/docker

1 file changed

+8
-0
lines changed

qa/packaging/src/test/java/org/elasticsearch/packaging/util/docker/DockerRun.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
*/
3030
public class DockerRun {
3131

32+
// Use less secure entropy source to avoid hanging when generating certificates
33+
private static final String DEFAULT_JAVA_OPTS = "-Djava.security.egd=file:/dev/urandom";
34+
3235
private Distribution distribution;
3336
private final Map<String, String> envVars = new HashMap<>();
3437
private final Map<Path, Path> volumes = new HashMap<>();
@@ -112,6 +115,11 @@ String build() {
112115
// Limit container memory
113116
cmd.add("--memory " + memory);
114117

118+
// Add default java opts
119+
for (String envVar : List.of("CLI_JAVA_OPTS", "ES_JAVA_OPTS")) {
120+
this.envVars.put(envVar, this.envVars.getOrDefault(envVar, "") + " " + DEFAULT_JAVA_OPTS);
121+
}
122+
115123
this.envVars.forEach((key, value) -> cmd.add("--env " + key + "=\"" + value + "\""));
116124

117125
// Map ports in the container to the host, so that we can send requests

0 commit comments

Comments
 (0)