Skip to content

Commit 3495b4e

Browse files
authored
Use explicit newline with keystore stdin test (#127094)
The add string keystore command accepts input on stdin. In this case, the terminal is responsible for separating input by newlines that are system dependent. The mock terminal normally adds the system dependent newline. However, we also have tests that ensure both unix and windows style newlines are tested explicitly. This commit fixes the windows style carriage returns to explicitly contain a newline. closes #127089
1 parent 65c350c commit 3495b4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public void testStdinInputWithCarriageReturn() throws Exception {
193193
String password = "keystorepassword";
194194
KeyStoreWrapper.create().save(env.configDir(), password.toCharArray());
195195
terminal.addSecretInput(password);
196-
terminal.addSecretInput("Typedthisandhitenter\r");
196+
terminal.addSecretInput("Typedthisandhitenter\r\n");
197197
execute("-x", "foo");
198198
assertSecureString("foo", "Typedthisandhitenter", password);
199199
}

0 commit comments

Comments
 (0)