From e79d033f1fde507079fe3c38aa2ec0eeff969f57 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 21 Apr 2025 14:28:18 -0700 Subject: [PATCH] Use explicit newline with keystore stdin test (#127094) (#127128) 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 --- .../cli/keystore/AddStringKeyStoreCommandTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java b/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java index 1b368a7c38e0..17d0abe33f69 100644 --- a/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java +++ b/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java @@ -193,7 +193,7 @@ public class AddStringKeyStoreCommandTests extends KeyStoreCommandTestCase { String password = "keystorepassword"; KeyStoreWrapper.create().save(env.configDir(), password.toCharArray()); terminal.addSecretInput(password); - terminal.addSecretInput("Typedthisandhitenter\r"); + terminal.addSecretInput("Typedthisandhitenter\r\n"); execute("-x", "foo"); assertSecureString("foo", "Typedthisandhitenter", password); }