Skip to content

Commit

Permalink
Make ConfigurationTests.test20HostnameSubstitution more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Jul 23, 2024
1 parent b8da526 commit f17d75e
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import static java.nio.file.attribute.PosixFilePermissions.fromString;
import static org.elasticsearch.packaging.util.FileUtils.append;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assume.assumeFalse;

public class ConfigurationTests extends PackagingTestCase {
Expand Down Expand Up @@ -50,13 +49,15 @@ public void test20HostnameSubstitution() throws Exception {
// security auto-config requires that the archive owner and the node process user be the same
Platforms.onWindows(() -> sh.chown(confPath, installation.getOwner()));
assertWhileRunning(() -> {
final String nameResponse = ServerUtils.makeRequest(
Request.Get("https://localhost:9200/_cat/nodes?h=name"),
"test_superuser",
"test_superuser_password",
ServerUtils.getCaCert(confPath)
).strip();
assertThat(nameResponse, equalTo("mytesthost"));
assertBusy(() -> {
final String nameResponse = ServerUtils.makeRequest(
Request.Get("https://localhost:9200/_cat/nodes?h=name"),
"test_superuser",
"test_superuser_password",
ServerUtils.getCaCert(confPath)
).strip();
assertEquals("mytesthost", nameResponse);
});
});
Platforms.onWindows(() -> sh.chown(confPath));
});
Expand Down

0 comments on commit f17d75e

Please sign in to comment.