|
|
@ -1023,7 +1023,7 @@ public class PantheonCommandTest extends CommandTestAbstract { |
|
|
|
"false", |
|
|
|
"false", |
|
|
|
"--max-peers", |
|
|
|
"--max-peers", |
|
|
|
"42", |
|
|
|
"42", |
|
|
|
"--max-remote-connections-percentage", |
|
|
|
"--remote-connections-max-percentage", |
|
|
|
"50", |
|
|
|
"50", |
|
|
|
"--banned-node-id", |
|
|
|
"--banned-node-id", |
|
|
|
String.join(",", nodes), |
|
|
|
String.join(",", nodes), |
|
|
@ -1036,7 +1036,7 @@ public class PantheonCommandTest extends CommandTestAbstract { |
|
|
|
"--bootnodes", |
|
|
|
"--bootnodes", |
|
|
|
"--max-peers", |
|
|
|
"--max-peers", |
|
|
|
"--banned-node-ids", |
|
|
|
"--banned-node-ids", |
|
|
|
"--max-remote-connections-percentage"); |
|
|
|
"--remote-connections-max-percentage"); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(commandOutput.toString()).isEmpty(); |
|
|
|
assertThat(commandOutput.toString()).isEmpty(); |
|
|
|
assertThat(commandErrorOutput.toString()).isEmpty(); |
|
|
|
assertThat(commandErrorOutput.toString()).isEmpty(); |
|
|
@ -1247,7 +1247,7 @@ public class PantheonCommandTest extends CommandTestAbstract { |
|
|
|
final int remoteConnectionsPercentage = 12; |
|
|
|
final int remoteConnectionsPercentage = 12; |
|
|
|
parseCommand( |
|
|
|
parseCommand( |
|
|
|
"--remote-connections-limit-enabled", |
|
|
|
"--remote-connections-limit-enabled", |
|
|
|
"--max-remote-connections-percentage", |
|
|
|
"--remote-connections-max-percentage", |
|
|
|
String.valueOf(remoteConnectionsPercentage)); |
|
|
|
String.valueOf(remoteConnectionsPercentage)); |
|
|
|
|
|
|
|
|
|
|
|
verify(mockRunnerBuilder).fractionRemoteConnectionsAllowed(floatCaptor.capture()); |
|
|
|
verify(mockRunnerBuilder).fractionRemoteConnectionsAllowed(floatCaptor.capture()); |
|
|
@ -1265,12 +1265,12 @@ public class PantheonCommandTest extends CommandTestAbstract { |
|
|
|
public void remoteConnectionsPercentageWithInvalidFormatMustFail() { |
|
|
|
public void remoteConnectionsPercentageWithInvalidFormatMustFail() { |
|
|
|
|
|
|
|
|
|
|
|
parseCommand( |
|
|
|
parseCommand( |
|
|
|
"--remote-connections-limit-enabled", "--max-remote-connections-percentage", "invalid"); |
|
|
|
"--remote-connections-limit-enabled", "--remote-connections-max-percentage", "invalid"); |
|
|
|
verifyZeroInteractions(mockRunnerBuilder); |
|
|
|
verifyZeroInteractions(mockRunnerBuilder); |
|
|
|
assertThat(commandOutput.toString()).isEmpty(); |
|
|
|
assertThat(commandOutput.toString()).isEmpty(); |
|
|
|
assertThat(commandErrorOutput.toString()) |
|
|
|
assertThat(commandErrorOutput.toString()) |
|
|
|
.contains( |
|
|
|
.contains( |
|
|
|
"Invalid value for option '--max-remote-connections-percentage'", |
|
|
|
"Invalid value for option '--remote-connections-max-percentage'", |
|
|
|
"should be a number between 0 and 100 inclusive"); |
|
|
|
"should be a number between 0 and 100 inclusive"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1278,12 +1278,12 @@ public class PantheonCommandTest extends CommandTestAbstract { |
|
|
|
public void remoteConnectionsPercentageWithOutOfRangeMustFail() { |
|
|
|
public void remoteConnectionsPercentageWithOutOfRangeMustFail() { |
|
|
|
|
|
|
|
|
|
|
|
parseCommand( |
|
|
|
parseCommand( |
|
|
|
"--remote-connections-limit-enabled", "--max-remote-connections-percentage", "150"); |
|
|
|
"--remote-connections-limit-enabled", "--remote-connections-max-percentage", "150"); |
|
|
|
verifyZeroInteractions(mockRunnerBuilder); |
|
|
|
verifyZeroInteractions(mockRunnerBuilder); |
|
|
|
assertThat(commandOutput.toString()).isEmpty(); |
|
|
|
assertThat(commandOutput.toString()).isEmpty(); |
|
|
|
assertThat(commandErrorOutput.toString()) |
|
|
|
assertThat(commandErrorOutput.toString()) |
|
|
|
.contains( |
|
|
|
.contains( |
|
|
|
"Invalid value for option '--max-remote-connections-percentage'", |
|
|
|
"Invalid value for option '--remote-connections-max-percentage'", |
|
|
|
"should be a number between 0 and 100 inclusive"); |
|
|
|
"should be a number between 0 and 100 inclusive"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|