Skip to content

Commit

Permalink
Remove packaging tests for the x-pack command line tools. (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
adnapibar authored Feb 9, 2021
1 parent 94301ea commit 2a901cc
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 456 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,27 +334,6 @@ public void test80RelativePathConf() throws Exception {
});
}

public void test90SecurityCliPackaging() throws Exception {
final Installation.Executables bin = installation.executables();

if (distribution().isDefault()) {
assertThat(installation.lib.resolve("tools").resolve("security-cli"), fileExists());
final Platforms.PlatformAction action = () -> {
Result result = sh.run(bin.certutilTool + " --help");
assertThat(result.stdout, containsString("Simplifies certificate creation for use with the Elastic Stack"));

// Ensure that the exit code from the java command is passed back up through the shell script
result = sh.runIgnoreExitCode(bin.certutilTool + " invalid-command");
assertThat(result.exitCode, is(not(0)));
assertThat(result.stderr, containsString("Unknown command [invalid-command]"));
};
Platforms.onLinux(action);
Platforms.onWindows(action);
} else {
assertThat(installation.lib.resolve("tools").resolve("security-cli"), fileDoesNotExist());
}
}

public void test91ElasticsearchShardCliPackaging() throws Exception {
final Installation.Executables bin = installation.executables();

Expand Down Expand Up @@ -397,28 +376,4 @@ public void test93ElasticsearchNodeCustomDataPathAndNotEsHomeWorkDir() throws Ex
Result result = sh.run("echo y | " + installation.executables().nodeTool + " unsafe-bootstrap");
assertThat(result.stdout, containsString("Master node was successfully bootstrapped"));
}

public void test94ElasticsearchNodeExecuteCliNotEsHomeWorkDir() throws Exception {
final Installation.Executables bin = installation.executables();
// Run the cli tools from the tmp dir
sh.setWorkingDirectory(getRootTempDir());

Platforms.PlatformAction action = () -> {
Result result = sh.run(bin.certutilTool + " -h");
assertThat(result.stdout, containsString("Simplifies certificate creation for use with the Elastic Stack"));
result = sh.run(bin.syskeygenTool + " -h");
assertThat(result.stdout, containsString("system key tool"));
result = sh.run(bin.setupPasswordsTool + " -h");
assertThat(result.stdout, containsString("Sets the passwords for reserved users"));
result = sh.run(bin.usersTool + " -h");
assertThat(result.stdout, containsString("Manages elasticsearch file users"));
};

// TODO: this should be checked on all distributions
if (distribution().isDefault()) {
Platforms.onLinux(action);
Platforms.onWindows(action);
}
}

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -449,30 +449,6 @@ public void test085EnvironmentVariablesAreRespectedUnderDockerExec() {
assertThat(result.stdout, containsString("java.net.UnknownHostException: this.is.not.valid: Name or service not known"));
}

/**
* Check whether the elasticsearch-certutil tool has been shipped correctly,
* and if present then it can execute.
*/
public void test090SecurityCliPackaging() {
final Installation.Executables bin = installation.executables();

final Path securityCli = installation.lib.resolve("tools").resolve("security-cli");

if (distribution().isDefault()) {
assertTrue(existsInContainer(securityCli));

Result result = sh.run(bin.certutilTool + " --help");
assertThat(result.stdout, containsString("Simplifies certificate creation for use with the Elastic Stack"));

// Ensure that the exit code from the java command is passed back up through the shell script
result = sh.runIgnoreExitCode(bin.certutilTool + " invalid-command");
assertThat(result.isSuccess(), is(false));
assertThat(result.stdout, containsString("Unknown command [invalid-command]"));
} else {
assertFalse(existsInContainer(securityCli));
}
}

/**
* Check that the elasticsearch-shard tool is shipped in the Docker image and is executable.
*/
Expand Down
Loading

0 comments on commit 2a901cc

Please sign in to comment.