-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
samples/greengrass/basic_discovery/ci_run_discovery_cfg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"language": "CPP", | ||
"runnable_file": "basic-discovery", | ||
"runnable_region": "us-east-1", | ||
"runnable_main_class": "", | ||
"arguments": [ | ||
{ | ||
"name": "--cert", | ||
"secret": "ci/PubSub/cert", | ||
"filename": "tmp_certificate.pem" | ||
}, | ||
{ | ||
"name": "--key", | ||
"secret": "ci/PubSub/key", | ||
"filename": "tmp_key.pem" | ||
}, | ||
{ | ||
"name": "--thing_name", | ||
"data": "CI_PubSub_Thing" | ||
}, | ||
{ | ||
"name": "--region", | ||
"data": "us-east-1" | ||
}, | ||
{ | ||
"name": "--message", | ||
"data": "hello" | ||
}, | ||
{ | ||
"name": "--print_discover_resp_only", | ||
"data": "true" | ||
}, | ||
{ | ||
"name": "--is_ci", | ||
"data": "true" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cp ../../../build/samples/greengrass/basic_discovery/basic-discovery . | ||
cp ../../../utils/run_in_ci.py . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"component": { | ||
"software.amazon.awssdk.sdk-gg-ipc": { | ||
"author": "iot-device-sdk", | ||
"version": "NEXT_PATCH", | ||
"build": { | ||
"build_system": "custom", | ||
"custom_build_command": ["bash", "copy_files.sh"] | ||
}, | ||
"publish": { | ||
"bucket": "<PLACEHOLDER_BUCKET>", | ||
"region": "<PLACEHOLDER_REGION>" | ||
} | ||
} | ||
}, | ||
"gdk_version": "1.3.0", | ||
"test-e2e": { | ||
"gtf_options": { | ||
"tags": "testgg" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.aws.greengrass</groupId> | ||
<artifactId>uat-features</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0.0</version> | ||
<name>OTF</name> | ||
|
||
<properties> | ||
<otf.version>1.2.0-SNAPSHOT</otf.version> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<repositories> | ||
<repository> | ||
<id>greengrass-common</id> | ||
<name>greengrass common</name> | ||
<!-- CloudFront url fronting the aws-greengrass-testing-standalone in S3--> | ||
<url>https://d2jrmugq4soldf.cloudfront.net/snapshots</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<!-- Open Testing Framework dependency - Source Code: https://github.com/aws-greengrass/aws-greengrass-testing --> | ||
<dependency> | ||
<groupId>com.aws.greengrass</groupId> | ||
<artifactId>aws-greengrass-testing-standalone</artifactId> | ||
<version>${otf.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.2.2</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | ||
<mainClass>com.aws.greengrass.testing.launcher.TestLauncher</mainClass> | ||
</transformer> | ||
</transformers> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
70 changes: 70 additions & 0 deletions
70
...ass/basic_discovery/gg-e2e-tests/src/main/resources/greengrass/features/component.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
Feature: Testing features of Greengrassv2 IPC sample | ||
|
||
@testgg | ||
Scenario: As a developer, I can create a component and deploy it on my device | ||
Given my device is registered as a Thing | ||
And my device is running Greengrass | ||
When I create a Greengrass deployment with components | ||
| aws.greengrass.clientdevices.Auth | LATEST | | ||
| aws.greengrass.clientdevices.mqtt.Moquette | LATEST | | ||
| aws.greengrass.clientdevices.mqtt.Bridge | LATEST | | ||
| aws.greengrass.clientdevices.IPDetector | LATEST | | ||
| software.amazon.awssdk.sdk-gg-ipc | file:recipe.yaml | | ||
When 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: *", | ||
"policyName": "MyPermissivePolicy" | ||
} | ||
}, | ||
"policies": { | ||
"MyPermissivePolicy": { | ||
"AllowAll": { | ||
"statementDescription": "Allow client devices to perform all actions.", | ||
"operations": [ | ||
"*" | ||
], | ||
"resources": [ | ||
"*" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
""" | ||
When I update my Greengrass deployment configuration, setting the component aws.greengrass.clientdevices.mqtt.Bridge configuration to: | ||
""" | ||
{ | ||
"MERGE": { | ||
"mqttTopicMapping": { | ||
"ClientDeviceHelloWorld": { | ||
"topic": "clients/+/hello/world", | ||
"source": "LocalMqtt", | ||
"target": "IotCore" | ||
}, | ||
"ClientDeviceEvents": { | ||
"topic": "clients/+/detections", | ||
"targetTopicPrefix": "events/input/", | ||
"source": "LocalMqtt", | ||
"target": "Pubsub" | ||
}, | ||
"ClientDeviceCloudStatusUpdate": { | ||
"topic": "clients/+/status", | ||
"targetTopicPrefix": "$aws/rules/StatusUpdateRule/", | ||
"source": "LocalMqtt", | ||
"target": "IotCore" | ||
} | ||
} | ||
} | ||
} | ||
""" | ||
And I deploy the Greengrass deployment configuration | ||
Then the Greengrass deployment is COMPLETED on the device after 120 seconds | ||
And the software.amazon.awssdk.sdk-gg-ipc log on the device contains the line "Received payload: hello" within 20 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
RecipeFormatVersion: "2020-01-25" | ||
ComponentName: software.amazon.awssdk.sdk-gg-ipc | ||
ComponentVersion: "1.0.0" | ||
ComponentDescription: "This is test for the Greengrass IPC sample" | ||
ComponentPublisher: "iot-device-sdk" | ||
ComponentConfiguration: | ||
DefaultConfiguration: | ||
accessControl: | ||
aws.greengrass.ipc.mqttproxy: | ||
software.amazon.awssdk.sdk-gg-ipc:mqttproxy:1: | ||
policyDescription: "Allows access to publish and subscribe to a Greengrass IPC test topic" | ||
operations: | ||
- aws.greengrass#PublishToIoTCore | ||
- aws.greengrass#SubscribeToIoTCore | ||
resources: | ||
- "*" | ||
Message: "World" | ||
Manifests: | ||
- Platform: | ||
os: all | ||
Artifacts: | ||
- URI: "file:basic-discovery" | ||
Permission: | ||
Read: ALL | ||
Execute: ALL | ||
- URI: "file:run_in_ci.py" | ||
- URI: "file:ci_run_discovery_cfg.json" | ||
Lifecycle: | ||
Run: | | ||
echo "GG core:" {iot:thingName} | ||
python3 {artifacts:path}/run_in_ci.py --runnable_dir {artifacts:path} --file {artifacts:path}/ci_run_discovery_cfg.json |