From d9023abfd03f98d7bc10deb706bf0be92417a1ad Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Mon, 26 Jan 2015 09:55:09 +0100 Subject: [PATCH] Testing: Remove randomization on osx The randomization of the `network.host` property on OSX only could lead to connecting to the wrong HTTP port in our functional tests. As this randomization is not really needed, we can simply remove it Closes elastic/elasticsearch#586 Original commit: elastic/x-pack-elasticsearch@fb16bd864404a325207b113af07f0a0674d3312b --- .../org/elasticsearch/test/ShieldSettingsSource.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java b/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java index ea76b716154..58379992125 100644 --- a/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java +++ b/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java @@ -7,8 +7,6 @@ package org.elasticsearch.test; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.client.support.Headers; -import org.elasticsearch.common.io.FileSystemUtils; -import org.elasticsearch.common.os.OsUtils; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.plugin.LicensePlugin; @@ -25,10 +23,10 @@ import org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration; import java.io.File; import java.net.URISyntaxException; +import static com.carrotsearch.randomizedtesting.RandomizedTest.randomBoolean; import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.elasticsearch.shield.test.ShieldTestUtils.writeFile; -import static com.carrotsearch.randomizedtesting.RandomizedTest.randomBoolean; /** * {@link org.elasticsearch.test.SettingsSource} subclass that allows to set all needed settings for shield. @@ -120,12 +118,6 @@ public class ShieldSettingsSource extends ClusterDiscoveryConfiguration.UnicastZ .put("shield.authz.store.files.roles", writeFile(folder, "roles.yml", configRoles())) .put(getNodeSSLSettings()); - //the random call has to happen all the time for repeatability - String networkHost = randomBoolean() ? "127.0.0.1" : "::1"; - if (OsUtils.MAC) { - builder.put("network.host", networkHost); - } - setUser(builder, nodeClientUsername(), nodeClientPassword()); return builder.build();