X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-testtool%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Ftest%2Ftool%2FMain.java;h=e4cc80fa749a8c6d8e20a9f54a39507049c98998;hb=e3998d55e33da9f6ecb69da75ecc71a047b6362b;hp=e36d58591e2ad8a1b2f757ca475ec7f41aa392ae;hpb=d6192be382b5d40aa25f350a4141b48ebf2ab561;p=controller.git diff --git a/opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/Main.java b/opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/Main.java index e36d58591e..e4cc80fa74 100644 --- a/opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/Main.java +++ b/opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/Main.java @@ -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; @@ -78,6 +78,9 @@ public final class Main { @Arg(dest = "debug") public boolean debug; + @Arg(dest = "notification-file") + public File notificationFile; + static ArgumentParser getParser() { final ArgumentParser parser = ArgumentParsers.newArgumentParser("netconf testool"); @@ -95,6 +98,11 @@ public final class Main { .help("Directory containing yang schemas to describe simulated devices. Some schemas e.g. netconf monitoring and inet types are included by default") .dest("schemas-dir"); + parser.addArgument("--notification-file") + .type(File.class) + .help("Xml file containing notifications that should be sent to clients after create subscription is called") + .dest("notification-file"); + parser.addArgument("--starting-port") .type(Integer.class) .setDefault(17830) @@ -147,7 +155,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 +175,10 @@ public final class Main { final NetconfDeviceSimulator netconfDeviceSimulator = new NetconfDeviceSimulator(); try { final List 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 generated = configGenerator.generate(params.ssh, params.generateConfigBatchSize, params.generateConfigsTimeout, params.generateConfigsAddress);