Skip to content

Commit

Permalink
feat(uat): implement T17 and T18 scenario outlines (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgklika authored Jul 21, 2023
1 parent 9744afa commit bb149d0
Show file tree
Hide file tree
Showing 12 changed files with 292 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/otf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
4 changes: 2 additions & 2 deletions uat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 9 additions & 1 deletion uat/codebuild/uat_linux_buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#

version: 0.2
env:
variables:
CUCUMBER_TAGS: '@GGMQ'
phases:
install:
runtime-versions:
Expand All @@ -12,18 +15,23 @@ 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:
uat-reports:
files:
- "TEST-greengrass-results.xml"
file-format: "JUNITXML"
uat-cucumber-reports:
files:
- "testResults/cucumber.json"
file-format: "CUCUMBERJSON"

cache:
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/


package com.aws.greengrass.steps;

import com.aws.greengrass.testing.model.ScenarioContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb149d0

Please sign in to comment.