mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
SQL: Fix CLI tests with security on Windows
We test on Windows with the terminal in unix mode, so we need to make sure we send `\n` instead of `\r\n`. In this case the extra `\n` after password was causing an extra new line in tests breaking them on Windows. Original commit: elastic/x-pack-elasticsearch@721ba32bd6
This commit is contained in:
parent
4df10bbd78
commit
9f71100bac
@ -101,16 +101,21 @@ public class RemoteCli implements Closeable {
|
|||||||
if (false == checkConnectionOnStartup) {
|
if (false == checkConnectionOnStartup) {
|
||||||
command += " -check false";
|
command += " -check false";
|
||||||
}
|
}
|
||||||
out.println(command);
|
/* Don't use println because it emits \r\n on windows but we put the
|
||||||
|
* terminal in unix mode to make the tests consistent. */
|
||||||
|
out.print(command + "\n");
|
||||||
|
out.flush();
|
||||||
|
|
||||||
// Feed it passwords if needed
|
// Feed it passwords if needed
|
||||||
if (security != null && security.keystoreLocation != null) {
|
if (security != null && security.keystoreLocation != null) {
|
||||||
assertEquals("keystore password: ", readUntil(s -> s.endsWith(": ")));
|
assertEquals("keystore password: ", readUntil(s -> s.endsWith(": ")));
|
||||||
out.println(security.keystorePassword);
|
out.print(security.keystorePassword + "\n");
|
||||||
|
out.flush();
|
||||||
}
|
}
|
||||||
if (security != null) {
|
if (security != null) {
|
||||||
assertEquals("password: ", readUntil(s -> s.endsWith(": ")));
|
assertEquals("password: ", readUntil(s -> s.endsWith(": ")));
|
||||||
out.println(security.password);
|
out.print(security.password + "\n");
|
||||||
|
out.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Throw out the logo and warnings about making a dumb terminal
|
// Throw out the logo and warnings about making a dumb terminal
|
||||||
@ -152,7 +157,7 @@ public class RemoteCli implements Closeable {
|
|||||||
public String command(String command) throws IOException {
|
public String command(String command) throws IOException {
|
||||||
assertThat("; automatically added", command, not(endsWith(";")));
|
assertThat("; automatically added", command, not(endsWith(";")));
|
||||||
logger.info("out: {};", command);
|
logger.info("out: {};", command);
|
||||||
/* Don't use println because it enits \r\n on windows but we put the
|
/* Don't use println because it emits \r\n on windows but we put the
|
||||||
* terminal in unix mode to make the tests consistent. */
|
* terminal in unix mode to make the tests consistent. */
|
||||||
out.print(command + ";\n");
|
out.print(command + ";\n");
|
||||||
out.flush();
|
out.flush();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user