Skip to content

Commit

Permalink
Adds tests to verify -c and -i behvarior when only -y is passed
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Jan 10, 2024
1 parent 4372cb9 commit 447740d
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,18 @@ public void testIsStringAlreadyPresentInFile_isPresent() throws IOException {
assertThat(isKeyPresentInYMLFile(installer.OPENSEARCH_CONF_FILE, str2), is(equalTo(false)));
}

@Test
public void testAssumeYesDoesNotInitializeClusterMode() throws IOException {
String str1 = "node.name"; // cluster_mode
String str2 = "plugins.security.allow_default_init_securityindex"; // init_security

installer.assumeyes = true;
securitySettingsConfigurer.writeSecurityConfigToOpenSearchYML();

assertThat(isKeyPresentInYMLFile(installer.OPENSEARCH_CONF_FILE, str1), is(equalTo(false)));
assertThat(isKeyPresentInYMLFile(installer.OPENSEARCH_CONF_FILE, str2), is(equalTo(false)));
}

@Test
public void testCreateSecurityAdminDemoScriptAndGetSecurityAdminCommands() throws IOException {
String demoPath = installer.OPENSEARCH_CONF_DIR + "securityadmin_demo" + installer.FILE_EXTENSION;
Expand Down

0 comments on commit 447740d

Please sign in to comment.