|
@@ -107,6 +107,8 @@ public class ElasticsearchNode implements TestClusterConfiguration {
|
|
|
"is a pre-release version of Elasticsearch",
|
|
|
"max virtual memory areas vm.max_map_count"
|
|
|
);
|
|
|
+ private static final String HOSTNAME_OVERRIDE = "LinuxDarwinHostname";
|
|
|
+ private static final String COMPUTERNAME_OVERRIDE = "WindowsComputername";
|
|
|
|
|
|
private final String path;
|
|
|
private final String name;
|
|
@@ -643,6 +645,10 @@ public class ElasticsearchNode implements TestClusterConfiguration {
|
|
|
// Windows requires this as it defaults to `c:\windows` despite ES_TMPDIR
|
|
|
defaultEnv.put("TMP", tmpDir.toString());
|
|
|
|
|
|
+ // Override the system hostname variables for testing
|
|
|
+ defaultEnv.put("HOSTNAME", HOSTNAME_OVERRIDE);
|
|
|
+ defaultEnv.put("COMPUTERNAME", COMPUTERNAME_OVERRIDE);
|
|
|
+
|
|
|
Set<String> commonKeys = new HashSet<>(environment.keySet());
|
|
|
commonKeys.retainAll(defaultEnv.keySet());
|
|
|
if (commonKeys.isEmpty() == false) {
|