Search in sources :

Example 1 with DEPLOYMENT_ID_KEY_NAME

use of com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME in project aws-greengrass-nucleus by aws-greengrass.

the class MultiGroupDeploymentTest method GIVEN_device_belongs_to_two_groups_WHEN_device_is_removed_from_one_group_THEN_next_deployment_removes_corresponding_component.

@Test
void GIVEN_device_belongs_to_two_groups_WHEN_device_is_removed_from_one_group_THEN_next_deployment_removes_corresponding_component() throws Exception {
    CountDownLatch firstGroupCDL = new CountDownLatch(1);
    CountDownLatch secondGroupCDL = new CountDownLatch(1);
    DeploymentStatusKeeper deploymentStatusKeeper = kernel.getContext().get(DeploymentStatusKeeper.class);
    deploymentStatusKeeper.registerDeploymentStatusConsumer(Deployment.DeploymentType.IOT_JOBS, (status) -> {
        if (status.get(DEPLOYMENT_ID_KEY_NAME).equals("firstGroup") && status.get(DEPLOYMENT_STATUS_KEY_NAME).equals("SUCCEEDED")) {
            firstGroupCDL.countDown();
        }
        if (status.get(DEPLOYMENT_ID_KEY_NAME).equals("secondGroup") && status.get(DEPLOYMENT_STATUS_KEY_NAME).equals("SUCCEEDED")) {
            secondGroupCDL.countDown();
        }
        return true;
    }, "dummyValue");
    when(thingGroupHelper.listThingGroupsForDevice(anyInt())).thenReturn(Optional.of(new HashSet<>(Arrays.asList("firstGroup", "secondGroup"))));
    submitSampleJobDocument(DeploymentServiceIntegrationTest.class.getResource("FleetConfigWithRedSignalService.json").toURI(), "firstGroup", Deployment.DeploymentType.IOT_JOBS);
    assertTrue(firstGroupCDL.await(10, TimeUnit.SECONDS));
    when(thingGroupHelper.listThingGroupsForDevice(anyInt())).thenReturn(Optional.of(new HashSet<>(Arrays.asList("secondGroup"))));
    submitSampleJobDocument(DeploymentServiceIntegrationTest.class.getResource("FleetConfigWithSomeService.json").toURI(), "secondGroup", Deployment.DeploymentType.IOT_JOBS);
    assertTrue(secondGroupCDL.await(10, TimeUnit.SECONDS));
    Topics groupToRootTopic = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS, GROUP_TO_ROOT_COMPONENTS_TOPICS);
    List<String> groupNames = new ArrayList<>();
    groupToRootTopic.forEach(node -> groupNames.add(node.getName()));
    assertTrue(groupNames.containsAll(Arrays.asList("secondGroup")), "Device should belong to firstGroup and secondGroup");
    Map<GreengrassService, DependencyType> dependenciesAfter = kernel.getMain().getDependencies();
    List<String> serviceNames = dependenciesAfter.keySet().stream().map(service -> service.getName()).collect(Collectors.toList());
    assertTrue(serviceNames.containsAll(Arrays.asList("SomeService")));
    Topics componentsToGroupTopic = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS, COMPONENTS_TO_GROUPS_TOPICS);
    assertNotNull(componentsToGroupTopic.find("SomeService", "secondGroup"));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) Deployment(com.aws.greengrass.deployment.model.Deployment) GROUP_TO_ROOT_COMPONENTS_TOPICS(com.aws.greengrass.deployment.DeploymentService.GROUP_TO_ROOT_COMPONENTS_TOPICS) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) State(com.aws.greengrass.dependency.State) BaseITCase(com.aws.greengrass.integrationtests.BaseITCase) FleetStatusService(com.aws.greengrass.status.FleetStatusService) Map(java.util.Map) DeploymentStatusKeeper(com.aws.greengrass.deployment.DeploymentStatusKeeper) URI(java.net.URI) Path(java.nio.file.Path) DEPLOYMENT_SERVICE_TOPICS(com.aws.greengrass.deployment.DeploymentService.DEPLOYMENT_SERVICE_TOPICS) FLEET_STATUS_SERVICE_TOPICS(com.aws.greengrass.status.FleetStatusService.FLEET_STATUS_SERVICE_TOPICS) MockitoExtension(org.mockito.junit.jupiter.MockitoExtension) LocalOverrideRequest(com.aws.greengrass.deployment.model.LocalOverrideRequest) DEPLOYMENT_STATUS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_KEY_NAME) Utils.copyFolderRecursively(com.aws.greengrass.util.Utils.copyFolderRecursively) UUID(java.util.UUID) COMPONENTS_TO_GROUPS_TOPICS(com.aws.greengrass.deployment.DeploymentService.COMPONENTS_TO_GROUPS_TOPICS) Collectors(java.util.stream.Collectors) ExceptionLogProtector.ignoreExceptionOfType(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionOfType) SdkClientException(software.amazon.awssdk.core.exception.SdkClientException) SERVICES_NAMESPACE_TOPIC(com.aws.greengrass.lifecyclemanager.GreengrassService.SERVICES_NAMESPACE_TOPIC) Test(org.junit.jupiter.api.Test) Topics(com.aws.greengrass.config.Topics) Kernel(com.aws.greengrass.lifecyclemanager.Kernel) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Optional(java.util.Optional) PreloadComponentStoreHelper(com.aws.greengrass.helper.PreloadComponentStoreHelper) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Mock(org.mockito.Mock) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) DeploymentQueue(com.aws.greengrass.deployment.DeploymentQueue) ConfigPlatformResolver(com.aws.greengrass.integrationtests.util.ConfigPlatformResolver) HashMap(java.util.HashMap) DEPLOYMENT_STATUS_DETAILS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_DETAILS_KEY_NAME) Configuration(com.amazon.aws.iot.greengrass.configuration.common.Configuration) ExtensionContext(org.junit.jupiter.api.extension.ExtensionContext) DeviceConfiguration(com.aws.greengrass.deployment.DeviceConfiguration) Coerce(com.aws.greengrass.util.Coerce) ThingGroupHelper(com.aws.greengrass.deployment.ThingGroupHelper) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) GreengrassService(com.aws.greengrass.lifecyclemanager.GreengrassService) PackageDownloadException(com.aws.greengrass.componentmanager.exceptions.PackageDownloadException) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) REPLACE_EXISTING(java.nio.file.StandardCopyOption.REPLACE_EXISTING) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) DEPLOYMENT_ID_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) DependencyType(com.amazon.aws.iot.greengrass.component.common.DependencyType) File(java.io.File) ExceptionLogProtector.ignoreExceptionWithMessage(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionWithMessage) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Topic(com.aws.greengrass.config.Topic) AfterEach(org.junit.jupiter.api.AfterEach) Paths(java.nio.file.Paths) ServiceUpdateException(com.aws.greengrass.deployment.exceptions.ServiceUpdateException) NoOpPathOwnershipHandler(com.aws.greengrass.testcommons.testutilities.NoOpPathOwnershipHandler) DeploymentStatus(com.aws.greengrass.deployment.model.DeploymentResult.DeploymentStatus) Topics(com.aws.greengrass.config.Topics) GreengrassService(com.aws.greengrass.lifecyclemanager.GreengrassService) ArrayList(java.util.ArrayList) DependencyType(com.amazon.aws.iot.greengrass.component.common.DependencyType) DeploymentStatusKeeper(com.aws.greengrass.deployment.DeploymentStatusKeeper) CountDownLatch(java.util.concurrent.CountDownLatch) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 2 with DEPLOYMENT_ID_KEY_NAME

use of com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME in project aws-greengrass-nucleus by aws-greengrass.

the class MqttReconnectTest method GIVEN_new_deployment_while_device_online_WHEN_mqtt_disconnects_and_reconnects_THEN_job_executes_successfully.

// GG_NEEDS_REVIEW: TODO: Fix flaky test https://sim.amazon.com/issues/P40525318
@Disabled
@Timeout(value = 10, unit = TimeUnit.MINUTES)
@Test
void GIVEN_new_deployment_while_device_online_WHEN_mqtt_disconnects_and_reconnects_THEN_job_executes_successfully(ExtensionContext context) throws Exception {
    ignoreExceptionUltimateCauseOfType(context, MqttException.class);
    ignoreExceptionUltimateCauseOfType(context, TimeoutException.class);
    ignoreExceptionWithMessage(context, "No valid versions were found for this package based on provided requirement");
    CountDownLatch jobInProgress = new CountDownLatch(1);
    CountDownLatch jobCompleted = new CountDownLatch(1);
    CountDownLatch connectionInterrupted = new CountDownLatch(1);
    // Create Job
    CreateDeploymentRequest createDeploymentRequest = CreateDeploymentRequest.builder().components(Utils.immutableMap("CustomerApp", ComponentDeploymentSpecification.builder().componentVersion("1.0.0").build())).build();
    CreateDeploymentResponse result = draftAndCreateDeployment(createDeploymentRequest);
    String jobId = result.iotJobId();
    // Subscribe to persisted deployment status
    Topics deploymentServiceTopics = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS);
    Topics processedDeployments = deploymentServiceTopics.lookupTopics(RUNTIME_STORE_NAMESPACE_TOPIC, PROCESSED_DEPLOYMENTS_TOPICS);
    processedDeployments.subscribe((whatHappened, newValue) -> {
        if (!(newValue instanceof Topic)) {
            return;
        }
        if (newValue.childOf(DEPLOYMENT_STATUS_KEY_NAME)) {
            newValue = newValue.parent;
        } else {
            return;
        }
        Map<String, Object> deploymentDetails = ((Topics) newValue).toPOJO();
        if (!deploymentDetails.get(DEPLOYMENT_ID_KEY_NAME).toString().equals(jobId)) {
            return;
        }
        String status = deploymentDetails.get(DEPLOYMENT_STATUS_KEY_NAME).toString();
        if (JobStatus.IN_PROGRESS.toString().equals(status)) {
            jobInProgress.countDown();
        } else if (jobInProgress.getCount() <= 0 && JobStatus.SUCCEEDED.toString().equals(status)) {
            jobCompleted.countDown();
        }
    });
    kernel.launch();
    assertTrue(jobInProgress.await(2, TimeUnit.MINUTES));
    NetworkUtils networkUtils = NetworkUtils.getByPlatform();
    Consumer<GreengrassLogMessage> logListener = m -> {
        String message = m.getMessage();
        if (UPDATE_DEPLOYMENT_STATUS_MQTT_ERROR_LOG.equals(message) && m.getCause().getCause() instanceof MqttException || UPDATE_DEPLOYMENT_STATUS_TIMEOUT_ERROR_LOG.equals(message)) {
            connectionInterrupted.countDown();
        }
    };
    try {
        Slf4jLogAdapter.addGlobalListener(logListener);
        networkUtils.disconnectMqtt();
        // Wait for the deployment to finish offline
        assertTrue(jobCompleted.await(5, TimeUnit.MINUTES));
        assertTrue(connectionInterrupted.await(2, TimeUnit.MINUTES));
    } finally {
        networkUtils.recoverMqtt();
        Slf4jLogAdapter.removeGlobalListener(logListener);
    }
    // Wait for DNS Cache to expire
    Thread.sleep(DNS_CACHE_TTL.plus(Duration.ofSeconds(1)).toMillis());
    // Wait for the IoT job to be updated and marked as successful
    // The reason for making the timeout as 7 min is because it has been observed that if the update job status was
    // invoked just before the connection recovers it can block the call for total timeout of 5 mins,
    // without successfully updating the status of the job in cloud. After this timeout expires the status will
    // be updated again as part of the onConnectionResumed callback. Additional 2 mins are for this status
    // to get updated
    IotJobsUtils.waitForJobExecutionStatusToSatisfy(iotClient, jobId, thingInfo.getThingName(), Duration.ofMinutes(7), s -> s.equals(JobExecutionStatus.SUCCEEDED));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) UPDATE_DEPLOYMENT_STATUS_TIMEOUT_ERROR_LOG(com.aws.greengrass.deployment.IotJobsHelper.UPDATE_DEPLOYMENT_STATUS_TIMEOUT_ERROR_LOG) ComponentDeploymentSpecification(software.amazon.awssdk.services.greengrassv2.model.ComponentDeploymentSpecification) JobExecutionStatus(software.amazon.awssdk.services.iot.model.JobExecutionStatus) TimeoutException(java.util.concurrent.TimeoutException) Disabled(org.junit.jupiter.api.Disabled) ExtensionContext(org.junit.jupiter.api.extension.ExtensionContext) BaseE2ETestCase(com.aws.greengrass.integrationtests.e2e.BaseE2ETestCase) PROCESSED_DEPLOYMENTS_TOPICS(com.aws.greengrass.deployment.DeploymentStatusKeeper.PROCESSED_DEPLOYMENTS_TOPICS) CreateDeploymentResponse(software.amazon.awssdk.services.greengrassv2.model.CreateDeploymentResponse) RUNTIME_STORE_NAMESPACE_TOPIC(com.aws.greengrass.lifecyclemanager.GreengrassService.RUNTIME_STORE_NAMESPACE_TOPIC) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) GGExtension(com.aws.greengrass.testcommons.testutilities.GGExtension) Duration(java.time.Duration) Map(java.util.Map) NetworkUtils(com.aws.greengrass.integrationtests.e2e.util.NetworkUtils) Tag(org.junit.jupiter.api.Tag) JobStatus(software.amazon.awssdk.iot.iotjobs.model.JobStatus) DEPLOYMENT_SERVICE_TOPICS(com.aws.greengrass.deployment.DeploymentService.DEPLOYMENT_SERVICE_TOPICS) DEPLOYMENT_ID_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME) DEPLOYMENT_STATUS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_KEY_NAME) ExceptionLogProtector.ignoreExceptionUltimateCauseOfType(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionUltimateCauseOfType) MqttException(software.amazon.awssdk.crt.mqtt.MqttException) SERVICES_NAMESPACE_TOPIC(com.aws.greengrass.lifecyclemanager.GreengrassService.SERVICES_NAMESPACE_TOPIC) ExceptionLogProtector.ignoreExceptionWithMessage(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionWithMessage) UPDATE_DEPLOYMENT_STATUS_MQTT_ERROR_LOG(com.aws.greengrass.deployment.IotJobsHelper.UPDATE_DEPLOYMENT_STATUS_MQTT_ERROR_LOG) Test(org.junit.jupiter.api.Test) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Topic(com.aws.greengrass.config.Topic) Topics(com.aws.greengrass.config.Topics) Slf4jLogAdapter(com.aws.greengrass.logging.impl.Slf4jLogAdapter) CountDownLatch(java.util.concurrent.CountDownLatch) AfterEach(org.junit.jupiter.api.AfterEach) Utils(com.aws.greengrass.util.Utils) CreateDeploymentRequest(software.amazon.awssdk.services.greengrassv2.model.CreateDeploymentRequest) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) IotJobsUtils(com.aws.greengrass.integrationtests.e2e.util.IotJobsUtils) GreengrassLogMessage(com.aws.greengrass.logging.impl.GreengrassLogMessage) Timeout(org.junit.jupiter.api.Timeout) CreateDeploymentResponse(software.amazon.awssdk.services.greengrassv2.model.CreateDeploymentResponse) Topics(com.aws.greengrass.config.Topics) GreengrassLogMessage(com.aws.greengrass.logging.impl.GreengrassLogMessage) CreateDeploymentRequest(software.amazon.awssdk.services.greengrassv2.model.CreateDeploymentRequest) CountDownLatch(java.util.concurrent.CountDownLatch) NetworkUtils(com.aws.greengrass.integrationtests.e2e.util.NetworkUtils) MqttException(software.amazon.awssdk.crt.mqtt.MqttException) Topic(com.aws.greengrass.config.Topic) Test(org.junit.jupiter.api.Test) Timeout(org.junit.jupiter.api.Timeout) Disabled(org.junit.jupiter.api.Disabled)

Example 3 with DEPLOYMENT_ID_KEY_NAME

use of com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME in project aws-greengrass-nucleus by aws-greengrass.

the class DeploymentServiceIntegrationTest method GIVEN_cloud_deployment_has_required_capabilities_WHEN_receives_deployment_THEN_fail_with_proper_detailed_status.

@Test
void GIVEN_cloud_deployment_has_required_capabilities_WHEN_receives_deployment_THEN_fail_with_proper_detailed_status() throws Exception {
    CountDownLatch cdlDeployRedSignal = new CountDownLatch(1);
    Consumer<GreengrassLogMessage> listener = m -> {
        if (m.getMessage() != null) {
            if (m.getMessage().contains("Current deployment finished") && m.getContexts().get("DeploymentId").equals("deployRedSignal")) {
                cdlDeployRedSignal.countDown();
            }
        }
    };
    CountDownLatch deploymentCDL = new CountDownLatch(1);
    DeploymentStatusKeeper deploymentStatusKeeper = kernel.getContext().get(DeploymentStatusKeeper.class);
    deploymentStatusKeeper.registerDeploymentStatusConsumer(DeploymentType.SHADOW, (status) -> {
        if (status.get(DEPLOYMENT_ID_KEY_NAME).equals("deployRedSignal") && status.get(DEPLOYMENT_STATUS_KEY_NAME).equals("FAILED")) {
            deploymentCDL.countDown();
            assertThat(((Map) status.get(DEPLOYMENT_STATUS_DETAILS_KEY_NAME)).get(DEPLOYMENT_FAILURE_CAUSE_KEY), equalTo("The current nucleus version doesn't support one or more capabilities that are required by " + "this deployment: ANOTHER_CAPABILITY"));
        }
        return true;
    }, "dummy");
    try (AutoCloseable l = TestUtils.createCloseableLogListener(listener)) {
        submitSampleJobDocument(DeploymentServiceIntegrationTest.class.getResource("FleetConfigWithRequiredCapability.json").toURI(), "deployRedSignal", DeploymentType.SHADOW);
        assertTrue(cdlDeployRedSignal.await(30, TimeUnit.SECONDS));
        assertTrue(deploymentCDL.await(10, TimeUnit.SECONDS));
    }
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) Deployment(com.aws.greengrass.deployment.model.Deployment) TimeoutException(java.util.concurrent.TimeoutException) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) ComponentUpdatePolicyEvents(software.amazon.awssdk.aws.greengrass.model.ComponentUpdatePolicyEvents) IPCTestUtils(com.aws.greengrass.integrationtests.ipc.IPCTestUtils) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) State(com.aws.greengrass.dependency.State) BaseITCase(com.aws.greengrass.integrationtests.BaseITCase) FleetStatusService(com.aws.greengrass.status.FleetStatusService) Map(java.util.Map) EnabledOnOs(org.junit.jupiter.api.condition.EnabledOnOs) DeploymentStatusKeeper(com.aws.greengrass.deployment.DeploymentStatusKeeper) LogManager(com.aws.greengrass.logging.impl.LogManager) DeploymentDocument(com.aws.greengrass.deployment.model.DeploymentDocument) URI(java.net.URI) StreamResponseHandler(software.amazon.awssdk.eventstreamrpc.StreamResponseHandler) Path(java.nio.file.Path) DEPLOYMENT_SERVICE_TOPICS(com.aws.greengrass.deployment.DeploymentService.DEPLOYMENT_SERVICE_TOPICS) FLEET_STATUS_SERVICE_TOPICS(com.aws.greengrass.status.FleetStatusService.FLEET_STATUS_SERVICE_TOPICS) MockitoExtension(org.mockito.junit.jupiter.MockitoExtension) LocalOverrideRequest(com.aws.greengrass.deployment.model.LocalOverrideRequest) GreengrassCoreIPCClient(software.amazon.awssdk.aws.greengrass.GreengrassCoreIPCClient) DEPLOYMENT_STATUS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_KEY_NAME) Utils.copyFolderRecursively(com.aws.greengrass.util.Utils.copyFolderRecursively) TestUtils(com.aws.greengrass.testcommons.testutilities.TestUtils) DeploymentDocumentConverter.convertFromDeploymentConfiguration(com.aws.greengrass.deployment.converter.DeploymentDocumentConverter.convertFromDeploymentConfiguration) ExceptionLogProtector.ignoreExceptionOfType(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionOfType) DeferComponentUpdateRequest(software.amazon.awssdk.aws.greengrass.model.DeferComponentUpdateRequest) SdkClientException(software.amazon.awssdk.core.exception.SdkClientException) Test(org.junit.jupiter.api.Test) Kernel(com.aws.greengrass.lifecyclemanager.Kernel) CountDownLatch(java.util.concurrent.CountDownLatch) DEFAULT_IPC_API_TIMEOUT_SECONDS(com.aws.greengrass.integrationtests.ipc.IPCTestUtils.DEFAULT_IPC_API_TIMEOUT_SECONDS) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) DeploymentDocumentDownloader(com.aws.greengrass.deployment.DeploymentDocumentDownloader) Optional(java.util.Optional) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) PreloadComponentStoreHelper(com.aws.greengrass.helper.PreloadComponentStoreHelper) SYSTEM_RESOURCE_LIMITS_TOPICS(com.aws.greengrass.lifecyclemanager.GreengrassService.SYSTEM_RESOURCE_LIMITS_TOPICS) Mock(org.mockito.Mock) DeploymentQueue(com.aws.greengrass.deployment.DeploymentQueue) ConfigPlatformResolver(com.aws.greengrass.integrationtests.util.ConfigPlatformResolver) HashMap(java.util.HashMap) DEPLOYMENT_STATUS_DETAILS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_DETAILS_KEY_NAME) Configuration(com.amazon.aws.iot.greengrass.configuration.common.Configuration) ExtensionContext(org.junit.jupiter.api.extension.ExtensionContext) DeviceConfiguration(com.aws.greengrass.deployment.DeviceConfiguration) Coerce(com.aws.greengrass.util.Coerce) PackageDownloadException(com.aws.greengrass.componentmanager.exceptions.PackageDownloadException) GGExtension(com.aws.greengrass.testcommons.testutilities.GGExtension) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) REPLACE_EXISTING(java.nio.file.StandardCopyOption.REPLACE_EXISTING) DeploymentType(com.aws.greengrass.deployment.model.Deployment.DeploymentType) RUN_WITH_NAMESPACE_TOPIC(com.aws.greengrass.lifecyclemanager.GreengrassService.RUN_WITH_NAMESPACE_TOPIC) OS(org.junit.jupiter.api.condition.OS) DEPLOYMENT_FAILURE_CAUSE_KEY(com.aws.greengrass.deployment.DeploymentService.DEPLOYMENT_FAILURE_CAUSE_KEY) DEPLOYMENT_ID_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) EventStreamRPCConnection(software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection) SubscribeToComponentUpdatesRequest(software.amazon.awssdk.aws.greengrass.model.SubscribeToComponentUpdatesRequest) Mockito.when(org.mockito.Mockito.when) File(java.io.File) IsMapContaining(org.hamcrest.collection.IsMapContaining) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) AfterEach(org.junit.jupiter.api.AfterEach) Paths(java.nio.file.Paths) NoOpPathOwnershipHandler(com.aws.greengrass.testcommons.testutilities.NoOpPathOwnershipHandler) KernelConfigResolver(com.aws.greengrass.componentmanager.KernelConfigResolver) GreengrassLogMessage(com.aws.greengrass.logging.impl.GreengrassLogMessage) Collections(java.util.Collections) Logger(com.aws.greengrass.logging.api.Logger) GreengrassLogMessage(com.aws.greengrass.logging.impl.GreengrassLogMessage) DeploymentStatusKeeper(com.aws.greengrass.deployment.DeploymentStatusKeeper) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.jupiter.api.Test)

Example 4 with DEPLOYMENT_ID_KEY_NAME

use of com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME in project aws-greengrass-nucleus by aws-greengrass.

the class MultiGroupDeploymentTest method GIVEN_device_belongs_to_two_groups_WHEN_device_receives_deployments_to_both_groups_THEN_no_components_removed.

@Test
void GIVEN_device_belongs_to_two_groups_WHEN_device_receives_deployments_to_both_groups_THEN_no_components_removed() throws Exception {
    CountDownLatch firstGroupCDL = new CountDownLatch(1);
    CountDownLatch secondGroupCDL = new CountDownLatch(1);
    DeploymentStatusKeeper deploymentStatusKeeper = kernel.getContext().get(DeploymentStatusKeeper.class);
    deploymentStatusKeeper.registerDeploymentStatusConsumer(Deployment.DeploymentType.IOT_JOBS, (status) -> {
        if (status.get(DEPLOYMENT_ID_KEY_NAME).equals("firstGroup") && status.get(DEPLOYMENT_STATUS_KEY_NAME).equals("SUCCEEDED")) {
            firstGroupCDL.countDown();
        }
        if (status.get(DEPLOYMENT_ID_KEY_NAME).equals("secondGroup") && status.get(DEPLOYMENT_STATUS_KEY_NAME).equals("SUCCEEDED")) {
            secondGroupCDL.countDown();
        }
        return true;
    }, "dummyValue");
    when(thingGroupHelper.listThingGroupsForDevice(anyInt())).thenReturn(Optional.of(new HashSet<>(Arrays.asList("firstGroup", "secondGroup"))));
    submitSampleJobDocument(DeploymentServiceIntegrationTest.class.getResource("FleetConfigWithRedSignalService.json").toURI(), "firstGroup", Deployment.DeploymentType.IOT_JOBS);
    assertTrue(firstGroupCDL.await(10, TimeUnit.SECONDS));
    submitSampleJobDocument(DeploymentServiceIntegrationTest.class.getResource("FleetConfigWithSomeService.json").toURI(), "secondGroup", Deployment.DeploymentType.IOT_JOBS);
    assertTrue(secondGroupCDL.await(10, TimeUnit.SECONDS));
    Topics groupToRootTopic = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS, GROUP_TO_ROOT_COMPONENTS_TOPICS);
    List<String> groupNames = new ArrayList<>();
    groupToRootTopic.forEach(node -> groupNames.add(node.getName()));
    assertTrue(groupNames.containsAll(Arrays.asList("firstGroup", "secondGroup")), "Device should belong to firstGroup and secondGroup");
    Map<GreengrassService, DependencyType> dependenciesAfter = kernel.getMain().getDependencies();
    List<String> serviceNames = dependenciesAfter.keySet().stream().map(service -> service.getName()).collect(Collectors.toList());
    assertTrue(serviceNames.containsAll(Arrays.asList("SomeService", "RedSignal")));
    Topics componentsToGroupTopic = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS, COMPONENTS_TO_GROUPS_TOPICS);
    assertNotNull(componentsToGroupTopic.find("SomeService", "secondGroup"));
    assertNotNull(componentsToGroupTopic.find("RedSignal", "firstGroup"));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) Deployment(com.aws.greengrass.deployment.model.Deployment) GROUP_TO_ROOT_COMPONENTS_TOPICS(com.aws.greengrass.deployment.DeploymentService.GROUP_TO_ROOT_COMPONENTS_TOPICS) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) State(com.aws.greengrass.dependency.State) BaseITCase(com.aws.greengrass.integrationtests.BaseITCase) FleetStatusService(com.aws.greengrass.status.FleetStatusService) Map(java.util.Map) DeploymentStatusKeeper(com.aws.greengrass.deployment.DeploymentStatusKeeper) URI(java.net.URI) Path(java.nio.file.Path) DEPLOYMENT_SERVICE_TOPICS(com.aws.greengrass.deployment.DeploymentService.DEPLOYMENT_SERVICE_TOPICS) FLEET_STATUS_SERVICE_TOPICS(com.aws.greengrass.status.FleetStatusService.FLEET_STATUS_SERVICE_TOPICS) MockitoExtension(org.mockito.junit.jupiter.MockitoExtension) LocalOverrideRequest(com.aws.greengrass.deployment.model.LocalOverrideRequest) DEPLOYMENT_STATUS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_KEY_NAME) Utils.copyFolderRecursively(com.aws.greengrass.util.Utils.copyFolderRecursively) UUID(java.util.UUID) COMPONENTS_TO_GROUPS_TOPICS(com.aws.greengrass.deployment.DeploymentService.COMPONENTS_TO_GROUPS_TOPICS) Collectors(java.util.stream.Collectors) ExceptionLogProtector.ignoreExceptionOfType(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionOfType) SdkClientException(software.amazon.awssdk.core.exception.SdkClientException) SERVICES_NAMESPACE_TOPIC(com.aws.greengrass.lifecyclemanager.GreengrassService.SERVICES_NAMESPACE_TOPIC) Test(org.junit.jupiter.api.Test) Topics(com.aws.greengrass.config.Topics) Kernel(com.aws.greengrass.lifecyclemanager.Kernel) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Optional(java.util.Optional) PreloadComponentStoreHelper(com.aws.greengrass.helper.PreloadComponentStoreHelper) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Mock(org.mockito.Mock) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) DeploymentQueue(com.aws.greengrass.deployment.DeploymentQueue) ConfigPlatformResolver(com.aws.greengrass.integrationtests.util.ConfigPlatformResolver) HashMap(java.util.HashMap) DEPLOYMENT_STATUS_DETAILS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_DETAILS_KEY_NAME) Configuration(com.amazon.aws.iot.greengrass.configuration.common.Configuration) ExtensionContext(org.junit.jupiter.api.extension.ExtensionContext) DeviceConfiguration(com.aws.greengrass.deployment.DeviceConfiguration) Coerce(com.aws.greengrass.util.Coerce) ThingGroupHelper(com.aws.greengrass.deployment.ThingGroupHelper) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) GreengrassService(com.aws.greengrass.lifecyclemanager.GreengrassService) PackageDownloadException(com.aws.greengrass.componentmanager.exceptions.PackageDownloadException) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) REPLACE_EXISTING(java.nio.file.StandardCopyOption.REPLACE_EXISTING) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) DEPLOYMENT_ID_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) DependencyType(com.amazon.aws.iot.greengrass.component.common.DependencyType) File(java.io.File) ExceptionLogProtector.ignoreExceptionWithMessage(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionWithMessage) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Topic(com.aws.greengrass.config.Topic) AfterEach(org.junit.jupiter.api.AfterEach) Paths(java.nio.file.Paths) ServiceUpdateException(com.aws.greengrass.deployment.exceptions.ServiceUpdateException) NoOpPathOwnershipHandler(com.aws.greengrass.testcommons.testutilities.NoOpPathOwnershipHandler) DeploymentStatus(com.aws.greengrass.deployment.model.DeploymentResult.DeploymentStatus) Topics(com.aws.greengrass.config.Topics) GreengrassService(com.aws.greengrass.lifecyclemanager.GreengrassService) ArrayList(java.util.ArrayList) DependencyType(com.amazon.aws.iot.greengrass.component.common.DependencyType) DeploymentStatusKeeper(com.aws.greengrass.deployment.DeploymentStatusKeeper) CountDownLatch(java.util.concurrent.CountDownLatch) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 5 with DEPLOYMENT_ID_KEY_NAME

use of com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME in project aws-greengrass-nucleus by aws-greengrass.

the class MultiGroupDeploymentTest method GIVEN_two_groups_with_common_root_component_WHEN_device_is_removed_from_one_group_THEN_common_component_not_removed.

@Test
void GIVEN_two_groups_with_common_root_component_WHEN_device_is_removed_from_one_group_THEN_common_component_not_removed() throws Exception {
    CountDownLatch firstGroupCDL = new CountDownLatch(1);
    CountDownLatch secondGroupCDL = new CountDownLatch(1);
    CountDownLatch thirdGroupCDL = new CountDownLatch(1);
    DeploymentStatusKeeper deploymentStatusKeeper = kernel.getContext().get(DeploymentStatusKeeper.class);
    deploymentStatusKeeper.registerDeploymentStatusConsumer(Deployment.DeploymentType.IOT_JOBS, (status) -> {
        if (status.get(DEPLOYMENT_ID_KEY_NAME).equals("firstGroup") && status.get(DEPLOYMENT_STATUS_KEY_NAME).equals("SUCCEEDED")) {
            firstGroupCDL.countDown();
        }
        if (status.get(DEPLOYMENT_ID_KEY_NAME).equals("secondGroup") && status.get(DEPLOYMENT_STATUS_KEY_NAME).equals("SUCCEEDED")) {
            secondGroupCDL.countDown();
        }
        if (status.get(DEPLOYMENT_ID_KEY_NAME).equals("thirdGroup") && status.get(DEPLOYMENT_STATUS_KEY_NAME).equals("SUCCEEDED")) {
            thirdGroupCDL.countDown();
        }
        return true;
    }, "dummyValue");
    // deployment to firstGroup adds red signal and yellow signal
    when(thingGroupHelper.listThingGroupsForDevice(anyInt())).thenReturn(Optional.of(new HashSet<>(Arrays.asList("firstGroup", "secondGroup", "thirdGroup"))));
    submitSampleJobDocument(DeploymentServiceIntegrationTest.class.getResource("FleetConfigWithRedAndYellowService.json").toURI(), "firstGroup", Deployment.DeploymentType.IOT_JOBS);
    assertTrue(firstGroupCDL.await(10, TimeUnit.SECONDS));
    // deployment to secondGroup adds red signal
    submitSampleJobDocument(DeploymentServiceIntegrationTest.class.getResource("FleetConfigWithRedSignalService.json").toURI(), "secondGroup", Deployment.DeploymentType.IOT_JOBS);
    assertTrue(secondGroupCDL.await(10, TimeUnit.SECONDS));
    // verify group to root components mapping
    Topics groupToRootTopic = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS, GROUP_TO_ROOT_COMPONENTS_TOPICS);
    List<String> groupNames = new ArrayList<>();
    groupToRootTopic.forEach(node -> groupNames.add(node.getName()));
    assertTrue(groupNames.containsAll(Arrays.asList("firstGroup", "secondGroup")));
    // verify components to group mapping
    Topics componentsToGroupTopic = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS, COMPONENTS_TO_GROUPS_TOPICS);
    assertNotNull(componentsToGroupTopic.find("RedSignal", "secondGroup"));
    assertNotNull(componentsToGroupTopic.find("RedSignal", "firstGroup"));
    // device gets removed from firstGroup,
    when(thingGroupHelper.listThingGroupsForDevice(anyInt())).thenReturn(Optional.of(new HashSet<>(Arrays.asList("secondGroup", "thirdGroup"))));
    // next deployment to thirdGroup will clean up root components only associated with firstGroup
    submitSampleJobDocument(DeploymentServiceIntegrationTest.class.getResource("FleetConfigWithSomeService.json").toURI(), "thirdGroup", Deployment.DeploymentType.IOT_JOBS);
    assertTrue(thirdGroupCDL.await(10, TimeUnit.SECONDS));
    // components belonging to only first group are removed, red signal should still be present as its associated with secondGroup
    groupToRootTopic = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS, GROUP_TO_ROOT_COMPONENTS_TOPICS);
    List<String> groups = new ArrayList<>();
    groupToRootTopic.forEach(node -> groups.add(node.getName()));
    assertTrue(groups.containsAll(Arrays.asList("secondGroup", "thirdGroup")), "Device should only belong to secondGroup and thirdGroup");
    Map<GreengrassService, DependencyType> dependenciesAfter = kernel.getMain().getDependencies();
    List<String> serviceNames = dependenciesAfter.keySet().stream().map(service -> service.getName()).collect(Collectors.toList());
    assertTrue(serviceNames.containsAll(Arrays.asList("SomeService", "RedSignal")));
    assertFalse(serviceNames.containsAll(Arrays.asList("YellowSignal")));
    componentsToGroupTopic = kernel.getConfig().lookupTopics(SERVICES_NAMESPACE_TOPIC, DEPLOYMENT_SERVICE_TOPICS, COMPONENTS_TO_GROUPS_TOPICS);
    assertNotNull(componentsToGroupTopic.find("SomeService", "thirdGroup"));
    assertNotNull(componentsToGroupTopic.find("RedSignal", "secondGroup"));
    // mapping of regSignal to firstGroup is removed
    assertNull(componentsToGroupTopic.find("RedSignal", "firstGroup"));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) Deployment(com.aws.greengrass.deployment.model.Deployment) GROUP_TO_ROOT_COMPONENTS_TOPICS(com.aws.greengrass.deployment.DeploymentService.GROUP_TO_ROOT_COMPONENTS_TOPICS) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) State(com.aws.greengrass.dependency.State) BaseITCase(com.aws.greengrass.integrationtests.BaseITCase) FleetStatusService(com.aws.greengrass.status.FleetStatusService) Map(java.util.Map) DeploymentStatusKeeper(com.aws.greengrass.deployment.DeploymentStatusKeeper) URI(java.net.URI) Path(java.nio.file.Path) DEPLOYMENT_SERVICE_TOPICS(com.aws.greengrass.deployment.DeploymentService.DEPLOYMENT_SERVICE_TOPICS) FLEET_STATUS_SERVICE_TOPICS(com.aws.greengrass.status.FleetStatusService.FLEET_STATUS_SERVICE_TOPICS) MockitoExtension(org.mockito.junit.jupiter.MockitoExtension) LocalOverrideRequest(com.aws.greengrass.deployment.model.LocalOverrideRequest) DEPLOYMENT_STATUS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_KEY_NAME) Utils.copyFolderRecursively(com.aws.greengrass.util.Utils.copyFolderRecursively) UUID(java.util.UUID) COMPONENTS_TO_GROUPS_TOPICS(com.aws.greengrass.deployment.DeploymentService.COMPONENTS_TO_GROUPS_TOPICS) Collectors(java.util.stream.Collectors) ExceptionLogProtector.ignoreExceptionOfType(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionOfType) SdkClientException(software.amazon.awssdk.core.exception.SdkClientException) SERVICES_NAMESPACE_TOPIC(com.aws.greengrass.lifecyclemanager.GreengrassService.SERVICES_NAMESPACE_TOPIC) Test(org.junit.jupiter.api.Test) Topics(com.aws.greengrass.config.Topics) Kernel(com.aws.greengrass.lifecyclemanager.Kernel) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Optional(java.util.Optional) PreloadComponentStoreHelper(com.aws.greengrass.helper.PreloadComponentStoreHelper) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Mock(org.mockito.Mock) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) DeploymentQueue(com.aws.greengrass.deployment.DeploymentQueue) ConfigPlatformResolver(com.aws.greengrass.integrationtests.util.ConfigPlatformResolver) HashMap(java.util.HashMap) DEPLOYMENT_STATUS_DETAILS_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_DETAILS_KEY_NAME) Configuration(com.amazon.aws.iot.greengrass.configuration.common.Configuration) ExtensionContext(org.junit.jupiter.api.extension.ExtensionContext) DeviceConfiguration(com.aws.greengrass.deployment.DeviceConfiguration) Coerce(com.aws.greengrass.util.Coerce) ThingGroupHelper(com.aws.greengrass.deployment.ThingGroupHelper) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) GreengrassService(com.aws.greengrass.lifecyclemanager.GreengrassService) PackageDownloadException(com.aws.greengrass.componentmanager.exceptions.PackageDownloadException) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) REPLACE_EXISTING(java.nio.file.StandardCopyOption.REPLACE_EXISTING) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) DEPLOYMENT_ID_KEY_NAME(com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) DependencyType(com.amazon.aws.iot.greengrass.component.common.DependencyType) File(java.io.File) ExceptionLogProtector.ignoreExceptionWithMessage(com.aws.greengrass.testcommons.testutilities.ExceptionLogProtector.ignoreExceptionWithMessage) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Topic(com.aws.greengrass.config.Topic) AfterEach(org.junit.jupiter.api.AfterEach) Paths(java.nio.file.Paths) ServiceUpdateException(com.aws.greengrass.deployment.exceptions.ServiceUpdateException) NoOpPathOwnershipHandler(com.aws.greengrass.testcommons.testutilities.NoOpPathOwnershipHandler) DeploymentStatus(com.aws.greengrass.deployment.model.DeploymentResult.DeploymentStatus) Topics(com.aws.greengrass.config.Topics) GreengrassService(com.aws.greengrass.lifecyclemanager.GreengrassService) ArrayList(java.util.ArrayList) DependencyType(com.amazon.aws.iot.greengrass.component.common.DependencyType) DeploymentStatusKeeper(com.aws.greengrass.deployment.DeploymentStatusKeeper) CountDownLatch(java.util.concurrent.CountDownLatch) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Aggregations

DEPLOYMENT_SERVICE_TOPICS (com.aws.greengrass.deployment.DeploymentService.DEPLOYMENT_SERVICE_TOPICS)5 DEPLOYMENT_ID_KEY_NAME (com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_ID_KEY_NAME)5 DEPLOYMENT_STATUS_KEY_NAME (com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_KEY_NAME)5 Configuration (com.amazon.aws.iot.greengrass.configuration.common.Configuration)4 PackageDownloadException (com.aws.greengrass.componentmanager.exceptions.PackageDownloadException)4 Topic (com.aws.greengrass.config.Topic)4 Topics (com.aws.greengrass.config.Topics)4 State (com.aws.greengrass.dependency.State)4 DeploymentQueue (com.aws.greengrass.deployment.DeploymentQueue)4 DeploymentStatusKeeper (com.aws.greengrass.deployment.DeploymentStatusKeeper)4 DEPLOYMENT_STATUS_DETAILS_KEY_NAME (com.aws.greengrass.deployment.DeploymentStatusKeeper.DEPLOYMENT_STATUS_DETAILS_KEY_NAME)4 DeviceConfiguration (com.aws.greengrass.deployment.DeviceConfiguration)4 Deployment (com.aws.greengrass.deployment.model.Deployment)4 LocalOverrideRequest (com.aws.greengrass.deployment.model.LocalOverrideRequest)4 PreloadComponentStoreHelper (com.aws.greengrass.helper.PreloadComponentStoreHelper)4 BaseITCase (com.aws.greengrass.integrationtests.BaseITCase)4 ConfigPlatformResolver (com.aws.greengrass.integrationtests.util.ConfigPlatformResolver)4 SERVICES_NAMESPACE_TOPIC (com.aws.greengrass.lifecyclemanager.GreengrassService.SERVICES_NAMESPACE_TOPIC)4 Kernel (com.aws.greengrass.lifecyclemanager.Kernel)4 FleetStatusService (com.aws.greengrass.status.FleetStatusService)4