Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bug with Install demo configuration running in cluster mode with -y #3935

Merged
merged 10 commits into from
Jan 10, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ void gatherUserInputs() {
cluster_mode = confirmAction(scanner, "Enable cluster mode?");
}
}
} else {
initsecurity = true;
cluster_mode = true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ public void testGatherInputs_withAssumeYes() {

installer.gatherUserInputs();

assertThat(installer.initsecurity, is(true));
assertThat(installer.cluster_mode, is(true));
assertThat(installer.initsecurity, is(false));
assertThat(installer.cluster_mode, is(false));
}

@Test
Expand Down
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
derek-ho marked this conversation as resolved.
Show resolved Hide resolved
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)));
derek-ho marked this conversation as resolved.
Show resolved Hide resolved
}

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