- timeoutGuardFuture = executor.schedule(new TimeoutGuard(), timeout, TimeUnit.MINUTES);
- final NetconfDeviceSimulator netconfDeviceSimulator = new NetconfDeviceSimulator(params.threadAmount);
- try {
- final List<Integer> openDevices = netconfDeviceSimulator.start(params);
- if (openDevices.size() == 0) {
- root.error("Failed to start any simulated devices, exiting...");
- System.exit(1);
- }
- if (params.distroFolder != null) {
- final Main.ConfigGenerator configGenerator = new Main.ConfigGenerator(params.distroFolder, openDevices);
- final List<File> generated = configGenerator.generate(
- params.ssh, params.generateConfigBatchSize,
- params.generateConfigsTimeout, params.generateConfigsAddress,
- params.devicesPerPort);
- configGenerator.updateFeatureFile(generated);
- configGenerator.changeLoadOrder();
- }
- } catch (final Exception e) {
- root.error("Unhandled exception", e);
- netconfDeviceSimulator.close();
+ final ScheduledFuture<?> timeoutGuardFuture = EXECUTOR.schedule(new TimeoutGuard(), TIMEOUT,
+ TimeUnit.MINUTES);
+ final Configuration configuration = new ConfigurationBuilder().from(params).build();
+ final NetconfDeviceSimulator netconfDeviceSimulator = new NetconfDeviceSimulator(configuration);
+
+ final List<Integer> openDevices = netconfDeviceSimulator.start();
+ if (openDevices.size() == 0) {
+ root.error("Failed to start any simulated devices, exiting...");
+ System.exit(1);
+ }
+
+ if (params.distroFolder == null) {
+ root.error("Distro folder is not set, exiting...");