diff --git a/.github/workflows/otf.yml b/.github/workflows/otf.yml index 91c8045de..2bad8ca36 100644 --- a/.github/workflows/otf.yml +++ b/.github/workflows/otf.yml @@ -18,6 +18,7 @@ env: AWS_REGION: "us-west-2" CODE_BUILD_PROJECT_LINUX: "CDAUatCodeBuildLinux" AWS_ROLE_TO_ASSUME: "arn:aws:iam::686385081908:role/aws-greengrass-client-device-auth-codebuild-uat-role-linux" + CUCUMBER_TAGS: "@GGMQ" jobs: uat-linux: @@ -41,3 +42,4 @@ jobs: with: project-name: ${{ env.CODE_BUILD_PROJECT_LINUX }} buildspec-override: uat/codebuild/uat_linux_buildspec.yaml + env-vars-for-codebuild: CUCUMBER_TAGS diff --git a/uat/README.md b/uat/README.md index 3fbe536c0..4c64ac81d 100644 --- a/uat/README.md +++ b/uat/README.md @@ -130,10 +130,10 @@ java -Dggc.archive=greengrass-nucleus-latest.zip -Dtest.log.path=logs -Dtags="@G ``` ### Run scenarios on CodeBuild -Because scenario usually requires upload/download artifacts to S3, create and delete roles, policies, do greengrass discoverty and so one please ensure codeBuild instance have enough AWS permissions to do that. +Due to scenario usually requires upload/download artifacts to S3, create and delete roles, policies, do Greengrass discovery and so one please ensure CodeBuild instance has enough AWS permissions to do that. For more information please read [Create a CodeBuild service role](https://docs.aws.amazon.com/codebuild/latest/userguide/setting-up.html#setting-up-service-role) ## Limitations MQTT clients based on IoT Device SDK for Java v2, mosquitto C, Paho Java, Paho Python do no provide API to get information from PUBREC/PUBREL/PUBCOMP packages used when messages published with QoS 2. -Not all features of MQTT v5.0 has been implemented in clients and supported by gRPC proto and the control as was requested, it is not bugs it is a design requirement. +Not all features of MQTT v5.0 have been implemented in clients and are supported by gRPC proto and the control as was requested, these are not bugs but designed by requirement. diff --git a/uat/codebuild/uat_linux_buildspec.yaml b/uat/codebuild/uat_linux_buildspec.yaml index 03687db05..b28d25262 100644 --- a/uat/codebuild/uat_linux_buildspec.yaml +++ b/uat/codebuild/uat_linux_buildspec.yaml @@ -4,6 +4,9 @@ # version: 0.2 +env: + variables: + CUCUMBER_TAGS: '@GGMQ' phases: install: runtime-versions: @@ -12,11 +15,12 @@ phases: commands: - curl -s https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip > /tmp/greengrass-nucleus-latest.zip - mvn -DskipTests=false -U -ntp clean verify -f uat/pom.xml - - java -Dggc.archive=/tmp/greengrass-nucleus-latest.zip -Dtags=GGMQ -jar uat/testing-features/target/client-devices-auth-testing-features.jar + - java -Dggc.archive=/tmp/greengrass-nucleus-latest.zip -Dtags="$CUCUMBER_TAGS" -jar uat/testing-features/target/client-devices-auth-testing-features.jar 2>&1 | tee build.log artifacts: files: - 'testResults/**/*' + - 'build.log' name: 'AuthUatLinuxLogs.zip' reports: @@ -24,6 +28,10 @@ reports: files: - "TEST-greengrass-results.xml" file-format: "JUNITXML" + uat-cucumber-reports: + files: + - "testResults/cucumber.json" + file-format: "CUCUMBERJSON" cache: paths: diff --git a/uat/custom-components/client-java-sdk/src/main/java/com/aws/greengrass/testing/mqtt5/client/sdkmqtt/MqttConnectionImpl.java b/uat/custom-components/client-java-sdk/src/main/java/com/aws/greengrass/testing/mqtt5/client/sdkmqtt/MqttConnectionImpl.java index c5d676e85..d6b653aa7 100644 --- a/uat/custom-components/client-java-sdk/src/main/java/com/aws/greengrass/testing/mqtt5/client/sdkmqtt/MqttConnectionImpl.java +++ b/uat/custom-components/client-java-sdk/src/main/java/com/aws/greengrass/testing/mqtt5/client/sdkmqtt/MqttConnectionImpl.java @@ -250,8 +250,8 @@ public MqttConnectionImpl(@NonNull MqttLib.ConnectionParams connectionParams, @N @SuppressWarnings("PMD.AvoidCatchingGenericException") @Override public ConnectResult start(long timeout, int connectionId) throws MqttException { - this.connectionId = connectionId; boolean success = false; + this.connectionId = connectionId; client.start(); try { OnConnectionDoneInfo onConnectionDoneInfo = lifecycleEvents.connectedFuture.get(timeout, TimeUnit.SECONDS); diff --git a/uat/testing-features/src/main/java/com/aws/greengrass/steps/AssertionSteps.java b/uat/testing-features/src/main/java/com/aws/greengrass/steps/AssertionSteps.java index 0c32e02a9..9df9f21d6 100644 --- a/uat/testing-features/src/main/java/com/aws/greengrass/steps/AssertionSteps.java +++ b/uat/testing-features/src/main/java/com/aws/greengrass/steps/AssertionSteps.java @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ - package com.aws.greengrass.steps; import com.aws.greengrass.testing.model.ScenarioContext; diff --git a/uat/testing-features/src/main/java/com/aws/greengrass/steps/MqttControlSteps.java b/uat/testing-features/src/main/java/com/aws/greengrass/steps/MqttControlSteps.java index 9773e9333..7689034d7 100644 --- a/uat/testing-features/src/main/java/com/aws/greengrass/steps/MqttControlSteps.java +++ b/uat/testing-features/src/main/java/com/aws/greengrass/steps/MqttControlSteps.java @@ -1201,7 +1201,7 @@ public void discoverCoreDeviceBroker(String brokerId, String clientDeviceId) * @param brokerId broker name in tests */ @And("I label IoT Core broker as {string}") - public void addCoreDeviceBroker(String brokerId) { + public void addIoTCoreBroker(String brokerId) { final String endpoint = resources.lifecycle(IotLifecycle.class) .dataEndpoint(); final String ca = registrationContext.rootCA(); diff --git a/uat/testing-features/src/main/resources/greengrass/features/ggmq-1.feature b/uat/testing-features/src/main/resources/greengrass/features/ggmq-1.feature index 43b057dae..ffaca1748 100644 --- a/uat/testing-features/src/main/resources/greengrass/features/ggmq-1.feature +++ b/uat/testing-features/src/main/resources/greengrass/features/ggmq-1.feature @@ -74,18 +74,18 @@ Feature: GGMQ-1 @mqtt3 @sdk-java Examples: - | mqtt-v | name | agent | recipe | subscribe-status-q1 | - | v3 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | GRANTED_QOS_0 | + | mqtt-v | name | agent | recipe | subscribe-status-q1 | + | v3 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | GRANTED_QOS_0 | @mqtt3 @mosquitto-c @SkipOnWindows Examples: - | mqtt-v | name | agent | recipe | subscribe-status-q1 | - | v3 | mosquitto-c | aws.greengrass.client.MqttMosquittoClient | client_mosquitto_c.yaml | GRANTED_QOS_1 | + | mqtt-v | name | agent | recipe | subscribe-status-q1 | + | v3 | mosquitto-c | aws.greengrass.client.MqttMosquittoClient | client_mosquitto_c.yaml | GRANTED_QOS_1 | @mqtt3 @paho-java Examples: - | mqtt-v | name | agent | recipe | subscribe-status-q1 | - | v3 | paho-java | aws.greengrass.client.Mqtt5JavaPahoClient | client_java_paho.yaml | GRANTED_QOS_0 | + | mqtt-v | name | agent | recipe | subscribe-status-q1 | + | v3 | paho-java | aws.greengrass.client.Mqtt5JavaPahoClient | client_java_paho.yaml | GRANTED_QOS_0 | @mqtt3 @paho-python @SkipOnWindows Examples: @@ -94,18 +94,18 @@ Feature: GGMQ-1 @mqtt5 @sdk-java Examples: - | mqtt-v | name | agent | recipe | subscribe-status-q1 | - | v5 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | GRANTED_QOS_1 | + | mqtt-v | name | agent | recipe | subscribe-status-q1 | + | v5 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | GRANTED_QOS_1 | @mqtt5 @mosquitto-c @SkipOnWindows Examples: - | mqtt-v | name | agent | recipe | subscribe-status-q1 | - | v5 | mosquitto-c | aws.greengrass.client.MqttMosquittoClient | client_mosquitto_c.yaml | GRANTED_QOS_1 | + | mqtt-v | name | agent | recipe | subscribe-status-q1 | + | v5 | mosquitto-c | aws.greengrass.client.MqttMosquittoClient | client_mosquitto_c.yaml | GRANTED_QOS_1 | @mqtt5 @paho-java Examples: - | mqtt-v | name | agent | recipe | subscribe-status-q1 | - | v5 | paho-java | aws.greengrass.client.Mqtt5JavaPahoClient | client_java_paho.yaml | GRANTED_QOS_1 | + | mqtt-v | name | agent | recipe | subscribe-status-q1 | + | v5 | paho-java | aws.greengrass.client.Mqtt5JavaPahoClient | client_java_paho.yaml | GRANTED_QOS_1 | @mqtt5 @paho-python @SkipOnWindows Examples: @@ -240,8 +240,8 @@ Feature: GGMQ-1 @mqtt3 @sdk-java Examples: - | mqtt-v | name | agent | recipe | iot_data_1-publish | subscribe-status-q1 | - | v3 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | 0 | GRANTED_QOS_0 | + | mqtt-v | name | agent | recipe | iot_data_1-publish | subscribe-status-q1 | + | v3 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | 0 | GRANTED_QOS_0 | @mqtt3 @paho-python @SkipOnWindows Examples: @@ -250,8 +250,8 @@ Feature: GGMQ-1 @mqtt5 @sdk-java Examples: - | mqtt-v | name | agent | recipe | iot_data_1-publish | subscribe-status-q1 | - | v5 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | 135 | GRANTED_QOS_1 | + | mqtt-v | name | agent | recipe | iot_data_1-publish | subscribe-status-q1 | + | v5 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | 135 | GRANTED_QOS_1 | @mqtt5 @paho-python @SkipOnWindows Examples: @@ -429,7 +429,7 @@ Feature: GGMQ-1 @GGMQ-1-T9 - Scenario Outline: GGMQ-1-T9--: As a customer,I can configure local MQTT messages to be forwarded to an IoT Core MQTT topic + Scenario Outline: GGMQ-1-T9--: As a customer, I can configure local MQTT messages to be forwarded to an IoT Core MQTT topic When I create a Greengrass deployment with components | aws.greengrass.clientdevices.Auth | LATEST | | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | @@ -724,29 +724,26 @@ Feature: GGMQ-1 When I publish from "publisher" to "iot_data_1" with qos 1 and message "Hello world 3" Then message "Hello world 3" received on "subscriber" from "iot_data_1" topic within 10 seconds - And I disconnect device "subscriber" with reason code 0 - And I disconnect device "publisher" with reason code 0 - # WARNING: AWS IoT device SDK Java v2 MQTT v3 client in software.amazon.awssdk.crt.mqtt.MqttClientConnection # missing API to getting actual reason code of SUBACK/PUBACK/UNSUBACK, client always return reason code 0 on publish and subscribe. # It makes sdk-java client useless for T13 @mqtt3 @sdk-java Examples: - | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | - | v3 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | GRANTED_QOS_0 | GRANTED_QOS_0 | 0 | + | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | + | v3 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | GRANTED_QOS_0 | GRANTED_QOS_0 | 0 | @mqtt3 @mosquitto-c @SkipOnWindows Examples: - | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | - | v3 | mosquitto-c | aws.greengrass.client.MqttMosquittoClient | client_mosquitto_c.yaml | UNSPECIFIED_ERROR | GRANTED_QOS_1 | 0 | + | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | + | v3 | mosquitto-c | aws.greengrass.client.MqttMosquittoClient | client_mosquitto_c.yaml | UNSPECIFIED_ERROR | GRANTED_QOS_1 | 0 | # WARNING: Paho Java MQTT v3 client in org.eclipse.paho.client.mqttv3.IMqttAsyncClient # missing API to getting actual reason code of SUBACK/PUBACK/UNSUBACK, client always return reason code 0 on publish and subscribe. # It makes paho-java client useless for T13 @mqtt3 @paho-java Examples: - | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | - | v3 | paho-java | aws.greengrass.client.Mqtt5JavaPahoClient | client_java_paho.yaml | GRANTED_QOS_0 | GRANTED_QOS_0 | 0 | + | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | + | v3 | paho-java | aws.greengrass.client.Mqtt5JavaPahoClient | client_java_paho.yaml | GRANTED_QOS_0 | GRANTED_QOS_0 | 0 | @mqtt3 @paho-python @SkipOnWindows Examples: @@ -755,18 +752,18 @@ Feature: GGMQ-1 @mqtt5 @sdk-java Examples: - | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | - | v5 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | NOT_AUTHORIZED | GRANTED_QOS_1 | 16 | + | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | + | v5 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | NOT_AUTHORIZED | GRANTED_QOS_1 | 16 | @mqtt5 @mosquitto-c @SkipOnWindows Examples: - | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | - | v5 | mosquitto-c | aws.greengrass.client.MqttMosquittoClient | client_mosquitto_c.yaml | NOT_AUTHORIZED | GRANTED_QOS_1 | 16 | + | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | + | v5 | mosquitto-c | aws.greengrass.client.MqttMosquittoClient | client_mosquitto_c.yaml | NOT_AUTHORIZED | GRANTED_QOS_1 | 16 | @mqtt5 @paho-java Examples: - | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | - | v5 | paho-java | aws.greengrass.client.Mqtt5JavaPahoClient | client_java_paho.yaml | NOT_AUTHORIZED | GRANTED_QOS_1 | 16 | + | mqtt-v | name | agent | recipe | subscribe-status-na | subscribe-status-good | publish-status-nms | + | v5 | paho-java | aws.greengrass.client.Mqtt5JavaPahoClient | client_java_paho.yaml | NOT_AUTHORIZED | GRANTED_QOS_1 | 16 | @mqtt5 @paho-python @SkipOnWindows Examples: @@ -879,9 +876,6 @@ Feature: GGMQ-1 When I publish from "iotCorePublisher" to "${localMqttSubscriber}topic/with/prefix" with qos 1 and message "Hello world2" Then message "Hello world2" received on "localMqttSubscriber" from "prefix/${localMqttSubscriber}topic/with/prefix" topic within 10 seconds - And I disconnect device "iotCorePublisher" with reason code 0 - And I disconnect device "localMqttSubscriber" with reason code 0 - @mqtt3 @sdk-java Examples: | mqtt-v | name | agent | recipe | @@ -1002,6 +996,7 @@ Feature: GGMQ-1 When I subscribe "subscriber" to "pubsub/topic/to/publish/on" with qos 1 When I subscribe "subscriber" to "prefix/pubsub/topic/to/publish/on" with qos 1 + And I verify greengrass-cli is available in greengrass root When I install the component LocalIpcPublisher from local store with configuration """ { @@ -1071,6 +1066,246 @@ Feature: GGMQ-1 | v5 | paho-python | aws.greengrass.client.Mqtt5PythonPahoClient | client_python_paho.yaml | + @GGMQ-1-T17 @OffTheNetwork + Scenario Outline: GGMQ-1-T17--: As a customer, I can configure IoT Core messages to be forwarded to local MQTT topic, with Greengrass in offline state + When I create a Greengrass deployment with components + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | aws.greengrass.clientdevices.mqtt.Bridge | LATEST | + | aws.greengrass.Cli | LATEST | + | | classpath:/local-store/recipes/ | + And I create client device "localMqttSubscriber" + And I create client device "iotCorePublisher" + When I associate "localMqttSubscriber" with ggc + And I update my Greengrass deployment configuration, setting the component aws.greengrass.Nucleus configuration to: + """ +{ + "MERGE":{ + "mqtt":{ + "keepAliveTimeoutMs":5000, + "pingTimeoutMs":3000, + "minimumReconnectDelaySeconds": 5, + "maximumReconnectDelaySeconds": 5, + "minimumConnectedTimeBeforeRetryResetSeconds": 1 + }, + "logging": { + "fileSizeKB": 102400, + "totalLogsSizeKB": 1024000 + } + } +} + """ + And I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.Auth configuration to: + """ +{ + "MERGE":{ + "deviceGroups":{ + "formatVersion":"2021-03-05", + "definitions":{ + "MyPermissiveDeviceGroup":{ + "selectionRule":"thingName: ${localMqttSubscriber}", + "policyName":"MyPermissivePolicy" + } + }, + "policies":{ + "MyPermissivePolicy":{ + "AllowAll":{ + "statementDescription":"Allow client devices to perform all actions.", + "operations":[ + "*" + ], + "resources":[ + "*" + ] + } + } + } + } + } +} + """ + And I update my Greengrass deployment configuration, setting the component configuration to: + """ +{ + "MERGE":{ + "controlAddresses":"${mqttControlAddresses}", + "controlPort":"${mqttControlPort}" + } +} + """ + And I deploy the Greengrass deployment configuration + Then the Greengrass deployment is COMPLETED on the device after 5 minutes + And the greengrass log on the device contains the line "com.aws.greengrass.mqtt.bridge.clients.MQTTClient: Connected to broker" within 5 minutes + And I verify greengrass-cli is available in greengrass root + + When I set device mqtt connectivity to offline + And I restart Greengrass + And the greengrass log on the device contains the line "com.aws.greengrass.mqttclient.AwsIotMqtt5Client: Failed to connect to AWS IoT Core" at least 3 times within 2 minutes + + And I update my local deployment configuration, setting the component aws.greengrass.clientdevices.mqtt.Bridge configuration to: + """ +{ + "MERGE":{ + "mqttTopicMapping":{ + "mapping1:":{ + "topic":"${localMqttSubscriber}topic/to/localmqtt", + "source":"IotCore", + "target":"LocalMqtt" + } + } + } +} + """ + Then the local Greengrass deployment is SUCCEEDED on the device after 120 seconds + + And I set device mqtt connectivity to online + And the greengrass log on the device contains the line "com.aws.greengrass.mqttclient.AwsIotMqtt5Client: Successfully connected to AWS IoT Core" at least 2 times within 1 minutes + And the greengrass log on the device contains the line "com.aws.greengrass.mqtt.bridge.clients.MQTTClient: Connected to broker" at least 2 times within 1 minutes + And I wait 30 seconds + + # Is critical to do discover after restart? + When I discover core device broker as "localBroker" from "localMqttSubscriber" in OTF + And I label IoT Core broker as "iotCoreBroker" + + And I connect device "localMqttSubscriber" on to "localBroker" using mqtt "" + And I connect device "iotCorePublisher" on to "iotCoreBroker" using mqtt "" + + And I subscribe "localMqttSubscriber" to "${localMqttSubscriber}topic/to/localmqtt" with qos 1 + + When I publish from "iotCorePublisher" to "${localMqttSubscriber}topic/to/localmqtt" with qos 1 and message "t17 message" + Then message "t17 message" received on "localMqttSubscriber" from "${localMqttSubscriber}topic/to/localmqtt" topic within 10 seconds + + @mqtt3 @sdk-java + Examples: + | mqtt-v | name | agent | recipe | + | v3 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | + + @mqtt5 @sdk-java + Examples: + | mqtt-v | name | agent | recipe | + | v5 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | + + + @GGMQ-1-T18 @OffTheNetwork + Scenario Outline: GGMQ-1-T18--: As a customer, I can configure IoT Core messages to be forwarded to local MQTT topic, with Greengrass in disconnected state + When I create a Greengrass deployment with components + | aws.greengrass.clientdevices.Auth | LATEST | + | aws.greengrass.clientdevices.mqtt.EMQX | LATEST | + | aws.greengrass.clientdevices.IPDetector | LATEST | + | aws.greengrass.clientdevices.mqtt.Bridge | LATEST | + | aws.greengrass.Cli | LATEST | + | | classpath:/local-store/recipes/ | + And I create client device "localMqttSubscriber" + And I create client device "iotCorePublisher" + When I associate "localMqttSubscriber" with ggc + And I update my Greengrass deployment configuration, setting the component aws.greengrass.Nucleus configuration to: + """ +{ + "MERGE":{ + "mqtt":{ + "keepAliveTimeoutMs":5000, + "pingTimeoutMs":3000, + "minimumReconnectDelaySeconds": 5, + "maximumReconnectDelaySeconds": 5, + "minimumConnectedTimeBeforeRetryResetSeconds": 1 + }, + "logging": { + "fileSizeKB": 102400, + "totalLogsSizeKB": 1024000 + } + } +} + """ + And I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.Auth configuration to: + """ +{ + "MERGE":{ + "deviceGroups":{ + "formatVersion":"2021-03-05", + "definitions":{ + "MyPermissiveDeviceGroup":{ + "selectionRule":"thingName: ${localMqttSubscriber}", + "policyName":"MyPermissivePolicy" + } + }, + "policies":{ + "MyPermissivePolicy":{ + "AllowAll":{ + "statementDescription":"Allow client devices to perform all actions.", + "operations":[ + "*" + ], + "resources":[ + "*" + ] + } + } + } + } + } +} + """ + And I update my Greengrass deployment configuration, setting the component configuration to: + """ +{ + "MERGE":{ + "controlAddresses":"${mqttControlAddresses}", + "controlPort":"${mqttControlPort}" + } +} + """ + And I deploy the Greengrass deployment configuration + Then the Greengrass deployment is COMPLETED on the device after 5 minutes + And the greengrass log on the device contains the line "com.aws.greengrass.mqtt.bridge.clients.MQTTClient: Connected to broker" within 5 minutes + And I verify greengrass-cli is available in greengrass root + + When I set device mqtt connectivity to offline + And the greengrass log on the device contains the line "com.aws.greengrass.mqttclient.AwsIotMqtt5Client: Failed to connect to AWS IoT Core" at least 3 times within 2 minutes + + And I update my local deployment configuration, setting the component aws.greengrass.clientdevices.mqtt.Bridge configuration to: + """ +{ + "MERGE":{ + "mqttTopicMapping":{ + "mapping1:":{ + "topic":"${localMqttSubscriber}topic/to/localmqtt", + "source":"IotCore", + "target":"LocalMqtt" + } + } + } +} + """ + Then the local Greengrass deployment is SUCCEEDED on the device after 120 seconds + + And I set device mqtt connectivity to online + And the greengrass log on the device contains the line "com.aws.greengrass.mqttclient.AwsIotMqtt5Client: Connection resumed" at least 2 times within 2 minutes + And the greengrass log on the device contains the line "com.aws.greengrass.mqtt.bridge.clients.MQTTClient: Connected to broker" at least 2 times within 1 minutes + And I wait 30 seconds + + When I discover core device broker as "localBroker" from "localMqttSubscriber" in OTF + And I label IoT Core broker as "iotCoreBroker" + + And I connect device "localMqttSubscriber" on to "localBroker" using mqtt "" + And I connect device "iotCorePublisher" on to "iotCoreBroker" using mqtt "" + + And I subscribe "localMqttSubscriber" to "${localMqttSubscriber}topic/to/localmqtt" with qos 1 + + When I publish from "iotCorePublisher" to "${localMqttSubscriber}topic/to/localmqtt" with qos 1 and message "t18 message" + Then message "t18 message" received on "localMqttSubscriber" from "${localMqttSubscriber}topic/to/localmqtt" topic within 10 seconds + + @mqtt3 @sdk-java + Examples: + | mqtt-v | name | agent | recipe | + | v3 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | + + @mqtt5 @sdk-java + Examples: + | mqtt-v | name | agent | recipe | + | v5 | sdk-java | aws.greengrass.client.Mqtt5JavaSdkClient | client_java_sdk.yaml | + + @GGMQ-1-T20 Scenario Outline: GGMQ-1-T20--: As a customer, I can associate and connect GGADs with GGC over custom port When I create a Greengrass deployment with components @@ -1227,6 +1462,7 @@ Feature: GGMQ-1 | mqtt-v | name | agent | recipe | | v5 | paho-python | aws.greengrass.client.Mqtt5PythonPahoClient | client_python_paho.yaml | + @GGMQ-1-T22 Scenario Outline: GGMQ-1-T22--: As a customer, I can send a message of size 128KiB to the MQTT broker When I create a Greengrass deployment with components @@ -1503,6 +1739,7 @@ Feature: GGMQ-1 | mqtt-v | name | agent | recipe | publish-status-na | | v5 | paho-python | aws.greengrass.client.Mqtt5PythonPahoClient | client_python_paho.yaml | 0 | + @GGMQ-1-T101 Scenario Outline: GGMQ-1-T101--: As a customer, I can use publish retain flag using MQTT V3.1.1 When I create a Greengrass deployment with components diff --git a/uat/testing-features/src/main/resources/local-store/recipes/LocalIpcPublisher.yaml b/uat/testing-features/src/main/resources/local-store/recipes/LocalIpcPublisher.yaml index f9c8393e8..72c9a6a5a 100644 --- a/uat/testing-features/src/main/resources/local-store/recipes/LocalIpcPublisher.yaml +++ b/uat/testing-features/src/main/resources/local-store/recipes/LocalIpcPublisher.yaml @@ -8,7 +8,7 @@ RecipeFormatVersion: '2020-01-25' ComponentName: LocalIpcPublisher ComponentVersion: '0.0.0' ComponentDescription: IPC publisher client for tests. -ComponentPublisher: Amazon +ComponentPublisher: AWS ComponentConfiguration: DefaultConfiguration: topicsToPublish: "pubsub/topic/to/publish/on" diff --git a/uat/testing-features/src/main/resources/local-store/recipes/LocalIpcSubscriber.yaml b/uat/testing-features/src/main/resources/local-store/recipes/LocalIpcSubscriber.yaml index b271d7f1e..871444bf6 100644 --- a/uat/testing-features/src/main/resources/local-store/recipes/LocalIpcSubscriber.yaml +++ b/uat/testing-features/src/main/resources/local-store/recipes/LocalIpcSubscriber.yaml @@ -8,7 +8,7 @@ RecipeFormatVersion: '2020-01-25' ComponentName: aws.greengrass.client.LocalIpcSubscriber ComponentVersion: '0.0.0' ComponentDescription: IPC subscribed client for tests. -ComponentPublisher: Amazon +ComponentPublisher: AWS ComponentConfiguration: DefaultConfiguration: topicsToSubscribe: "*" diff --git a/uat/testing-features/src/main/resources/local-store/recipes/client_java_paho.yaml b/uat/testing-features/src/main/resources/local-store/recipes/client_java_paho.yaml index 5bfd359a7..d8e4d8a99 100644 --- a/uat/testing-features/src/main/resources/local-store/recipes/client_java_paho.yaml +++ b/uat/testing-features/src/main/resources/local-store/recipes/client_java_paho.yaml @@ -8,7 +8,7 @@ RecipeFormatVersion: '2020-01-25' ComponentName: aws.greengrass.client.Mqtt5JavaPahoClient ComponentVersion: '1.0.0' ComponentDescription: MQTT 5.0/3.1.1 Java Client powered by Eclipse Paho -ComponentPublisher: Amazon +ComponentPublisher: AWS ComponentConfiguration: DefaultConfiguration: # agentId should be the same as ComponentName diff --git a/uat/testing-features/src/main/resources/local-store/recipes/client_java_sdk.yaml b/uat/testing-features/src/main/resources/local-store/recipes/client_java_sdk.yaml index 01843d66e..d7b9f7027 100644 --- a/uat/testing-features/src/main/resources/local-store/recipes/client_java_sdk.yaml +++ b/uat/testing-features/src/main/resources/local-store/recipes/client_java_sdk.yaml @@ -8,7 +8,7 @@ RecipeFormatVersion: '2020-01-25' ComponentName: aws.greengrass.client.Mqtt5JavaSdkClient ComponentVersion: '1.0.0' ComponentDescription: MQTT 5.0/3.1.1 Java Client powered by AWS Java SDK -ComponentPublisher: Amazon +ComponentPublisher: AWS ComponentConfiguration: DefaultConfiguration: # agentId should be the same as ComponentName diff --git a/uat/testing-features/src/main/resources/local-store/recipes/client_mosquitto_c.yaml b/uat/testing-features/src/main/resources/local-store/recipes/client_mosquitto_c.yaml index 682c2f144..db264b741 100644 --- a/uat/testing-features/src/main/resources/local-store/recipes/client_mosquitto_c.yaml +++ b/uat/testing-features/src/main/resources/local-store/recipes/client_mosquitto_c.yaml @@ -8,7 +8,7 @@ RecipeFormatVersion: '2020-01-25' ComponentName: aws.greengrass.client.MqttMosquittoClient ComponentVersion: '1.0.0' ComponentDescription: MQTT 5.0/3.1.1 client based on Mosquitto C library -ComponentPublisher: Amazon +ComponentPublisher: AWS ComponentConfiguration: DefaultConfiguration: # agentId should be the same as ComponentName