summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
3e3f54e)
The well known ports / system ports are actually only in the range
between 0 - 1023. The port 1024 should be usable. Also now handles the
max allowable port of 65535.
Change-Id: I5ec944abfe40156467ac53b9f5731a0aa6776596
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
void validate() {
checkArgument(deviceCount > 0, "Device count has to be > 0");
void validate() {
checkArgument(deviceCount > 0, "Device count has to be > 0");
- checkArgument(startingPort > 1024, "Starting port has to be > 1024");
+ checkArgument(startingPort > 1023, "Starting port has to be > 1023");
if(schemasDir != null) {
checkArgument(schemasDir.exists(), "Schemas dir has to exist");
if(schemasDir != null) {
checkArgument(schemasDir.exists(), "Schemas dir has to exist");
final NetconfDeviceSimulator netconfDeviceSimulator = new NetconfDeviceSimulator();
try {
final List<Integer> openDevices = netconfDeviceSimulator.start(params);
final NetconfDeviceSimulator netconfDeviceSimulator = new NetconfDeviceSimulator();
try {
final List<Integer> openDevices = netconfDeviceSimulator.start(params);
+ if (openDevices.size() == 0) {
+ LOG.error("Failed to start any simulated devices, exiting...");
+ System.exit(1);
+ }
if(params.distroFolder != null) {
final ConfigGenerator configGenerator = new ConfigGenerator(params.distroFolder, openDevices);
final List<File> generated = configGenerator.generate(params.ssh, params.generateConfigBatchSize, params.generateConfigsTimeout, params.generateConfigsAddress);
if(params.distroFolder != null) {
final ConfigGenerator configGenerator = new ConfigGenerator(params.distroFolder, openDevices);
final List<File> generated = configGenerator.generate(params.ssh, params.generateConfigBatchSize, params.generateConfigsTimeout, params.generateConfigsAddress);
final PEMGeneratorHostKeyProvider keyPairProvider = getPemGeneratorHostKeyProvider();
for (int i = 0; i < params.deviceCount; i++) {
final PEMGeneratorHostKeyProvider keyPairProvider = getPemGeneratorHostKeyProvider();
for (int i = 0; i < params.deviceCount; i++) {
+ if (currentPort > 65535) {
+ LOG.warn("Port cannot be greater than 65535, stopping further attempts.");
+ break;
+ }
final InetSocketAddress address = getAddress(currentPort);
final ChannelFuture server;
final InetSocketAddress address = getAddress(currentPort);
final ChannelFuture server;
if(openDevices.size() == params.deviceCount) {
LOG.info("All simulated devices started successfully from port {} to {}", params.startingPort, currentPort - 1);
if(openDevices.size() == params.deviceCount) {
LOG.info("All simulated devices started successfully from port {} to {}", params.startingPort, currentPort - 1);
+ } else if (openDevices.size() == 0) {
+ LOG.warn("No simulated devices started.");
} else {
LOG.warn("Not all simulated devices started successfully. Started devices ar on ports {}", openDevices);
}
} else {
LOG.warn("Not all simulated devices started successfully. Started devices ar on ports {}", openDevices);
}