Browse Source

Fix ShowKeyStoreCommand test on FIPS (#78243)

When running under FIPS a keystore must have a password
Tim Vernum 4 years ago
parent
commit
339d9f0847

+ 3 - 1
distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/ShowKeyStoreCommandTests.java

@@ -39,7 +39,9 @@ public class ShowKeyStoreCommandTests extends KeyStoreCommandTestCase {
     }
 
     public void testErrorOnMissingParameter() throws Exception {
-        createKeystore("");
+        final String password = getPossibleKeystorePassword();
+        createKeystore(password);
+        terminal.addSecretInput(password);
         final UserException e = expectThrows(UserException.class, this::execute);
         assertEquals(ExitCodes.USAGE, e.exitCode);
         assertThat(e.getMessage(), containsString("Must provide a single setting name to show"));