@Test void testExecuteDiagnosticCollection() throws Exception { Map<String, Object> parameters = getParametersMap(); underTest.executeDiagnosticCollection(gatewayConfigs, targets, parameters, exitCriteriaModel); SaltJobIdTracker saltJobIdTracker = (SaltJobIdTracker) orchestratorBootstrapArgumentCaptor.getValue(); ConcurrentParameterizedStateRunner saltJobRunner = (ConcurrentParameterizedStateRunner) saltJobIdTracker.getSaltJobRunner(); Assertions.assertTrue(CollectionUtils.isEqualCollection(targets, saltJobRunner.getAllNode())); assertEquals(SaltTelemetryOrchestrator.FILECOLLECTOR_COLLECT, saltJobRunner.getState()); verify(callable, Mockito.times(1)).call(); }
@Override public void executeDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { runSaltState(allGateways, nodes, parameters, exitModel, FILECOLLECTOR_COLLECT, "Error occurred during diagnostics filecollector collect.", maxDiagnosticsCollectionRetry, false); }
SaltTelemetryOrchestrator implements TelemetryOrchestrator { @Override public void executeDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { runSaltState(allGateways, nodes, parameters, exitModel, FILECOLLECTOR_COLLECT, "Error occurred during diagnostics filecollector collect.", maxDiagnosticsCollectionRetry, false); } }
SaltTelemetryOrchestrator implements TelemetryOrchestrator { @Override public void executeDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { runSaltState(allGateways, nodes, parameters, exitModel, FILECOLLECTOR_COLLECT, "Error occurred during diagnostics filecollector collect.", maxDiagnosticsCollectionRetry, false); } SaltTelemetryOrchestrator(ExitCriteria exitCriteria, SaltService saltService, SaltRunner saltRunner,
            @Value("${cb.max.salt.new.service.telemetry.stop.retry:5}") int maxTelemetryStopRetry,
            @Value("${cb.max.salt.new.service.diagnostics.collection.retry:360}") int maxDiagnosticsCollectionRetry); }
SaltTelemetryOrchestrator implements TelemetryOrchestrator { @Override public void executeDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { runSaltState(allGateways, nodes, parameters, exitModel, FILECOLLECTOR_COLLECT, "Error occurred during diagnostics filecollector collect.", maxDiagnosticsCollectionRetry, false); } SaltTelemetryOrchestrator(ExitCriteria exitCriteria, SaltService saltService, SaltRunner saltRunner,
            @Value("${cb.max.salt.new.service.telemetry.stop.retry:5}") int maxTelemetryStopRetry,
            @Value("${cb.max.salt.new.service.diagnostics.collection.retry:360}") int maxDiagnosticsCollectionRetry); @Override void installAndStartMonitoring(List<GatewayConfig> allGateways, Set<Node> nodes, ExitCriteriaModel exitModel); @Override void stopTelemetryAgent(List<GatewayConfig> allGateways, Set<Node> nodes, ExitCriteriaModel exitModel); @Override void initDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel); @Override void executeDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel); @Override void uploadCollectedDiagnostics(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel); @Override void cleanupCollectedDiagnostics(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel); }
SaltTelemetryOrchestrator implements TelemetryOrchestrator { @Override public void executeDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { runSaltState(allGateways, nodes, parameters, exitModel, FILECOLLECTOR_COLLECT, "Error occurred during diagnostics filecollector collect.", maxDiagnosticsCollectionRetry, false); } SaltTelemetryOrchestrator(ExitCriteria exitCriteria, SaltService saltService, SaltRunner saltRunner,
            @Value("${cb.max.salt.new.service.telemetry.stop.retry:5}") int maxTelemetryStopRetry,
            @Value("${cb.max.salt.new.service.diagnostics.collection.retry:360}") int maxDiagnosticsCollectionRetry); @Override void installAndStartMonitoring(List<GatewayConfig> allGateways, Set<Node> nodes, ExitCriteriaModel exitModel); @Override void stopTelemetryAgent(List<GatewayConfig> allGateways, Set<Node> nodes, ExitCriteriaModel exitModel); @Override void initDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel); @Override void executeDiagnosticCollection(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel); @Override void uploadCollectedDiagnostics(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel); @Override void cleanupCollectedDiagnostics(List<GatewayConfig> allGateways, Set<Node> nodes, Map<String, Object> parameters, ExitCriteriaModel exitModel); static final String MONITORING_INIT; static final String FILECOLLECTOR_INIT; static final String FILECOLLECTOR_COLLECT; static final String FILECOLLECTOR_UPLOAD; static final String FILECOLLECTOR_CLEANUP; }