Merge changes I4ec0efd7,Ia2619921
[controller.git] / opendaylight / netconf / netconf-testtool / src / main / java / org / opendaylight / controller / netconf / test / tool / Main.java
index e36d58591e2ad8a1b2f757ca475ec7f41aa392ae..e52fce7ae03372cb676b7ed6b9fe813682ef34c3 100644 (file)
@@ -46,7 +46,7 @@ public final class Main {
 
     private static final Logger LOG = LoggerFactory.getLogger(Main.class);
 
-    static class Params {
+    public static class Params {
 
         @Arg(dest = "schemas-dir")
         public File schemasDir;
@@ -147,7 +147,7 @@ public final class Main {
 
         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");
@@ -167,6 +167,10 @@ public final class Main {
         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);