Skip to content

This AWS Greengrass test framework is a collection of building blocks to support end to end QA automation from the customer perspective.

License

Notifications You must be signed in to change notification settings

jiangpta/aws-greengrass-testing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Greengrass Testing Framework

This framework is a collection of building blocks to support end to end automation from the customer perspective, using Cucumber as the feature driver. AWS Greengrass uses these very same building blocks to qualify software changes on variable devices.

What's inside?

  • AWS Resource Management (aws-greengrass-testing-resources)
  • A platform abstraction over Java Process API
  • A bunch of common steps (aws-greengrass-testing-features)
  • Ability for the features to be driven through IDT.
  • Some example use-cases and components (aws-greengrass-testing-components)
  • Service discovery for extensions like other AWS resources, steps, and configuration.

How to build?

Special first time instructions

This is needed to pull in the latest StreamManger SDK and install them locally for building.

Unix Based Systems

If this directory ./aws-greengrass-testing-components/aws-greengrass-testing-components-streammanager/lib/streammanager already exists within your project, remove it by running

rm -rf ./aws-greengrass-testing-components/aws-greengrass-testing-components-streammanager/lib/streammanager

This ensures that when running the next commands you are getting a fresh version of the submodules that this project loads

From the root of the project run

git submodule update --init
mvn process-resources

Windows

In order for the git submodule update --init command to work on Windows the core.longpaths setting needs to be enabled on git. To do that:

  1. Open a command prompt as an Administrator
  2. Run git config --global core.longpaths true

This is required because Windows has a limit of 260 chars for file names and when pulling the submodules, the file names are paths that are longer than 260 characters which cause pulling the submodule to fail.

Note:

After enabling core.longpaths,

If this directory .\aws-greengrass-testing-components\aws-greengrass-testing-components-streammanager\lib\streammanager already exists within your project, remove it by running (you can also delete the folder using the UI):

rm .\aws-greengrass-testing-components\aws-greengrass-testing-components-streammanager\lib\streammanager

This ensures that when running the next commands you are getting a fresh version of the submodules that this project loads

From the root of the project run

git submodule update --init
mvn process-resources

When pulling the submodule succeeds you should be able to find this jar on aws-greengrass-testing-components/aws-greengrass-testing-components-streammanager/lib/streammanager/sdk/aws-greengrass-stream-manager-sdk-java.jar

Regular compilation instructions

Replace compile with package to build shaded jars.

mvn clean compile

Run integration tests for the example component

  • Download latest greengrass archive at the example component path
curl https://d2s8p88vqu9w66.cloudfront.net/releases/greengrass-nucleus-latest.zip -o aws-greengrass-testing-examples/aws-greengrass-testing-examples-component/greengrass-nucleus-latest.zip
  • Get credentials for AWS account. The test needs credentials to identify the AWS account to use and to be able to create test resources in the account. Here is the instruction on how to set up credentials. The credentials need to made available on the device. Some options are:

    • Copy temporary credentials and set them as env variables
    • Set AWS profile for your environment
  • Run the tests

mvn clean -DskipTests=false -pl aws-greengrass-testing-examples/aws-greengrass-testing-examples-component -am integration-test
  • Run mqtt tests
mvn clean -DskipITs=false -pl aws-greengrass-testing-features/aws-greengrass-testing-features-mqtt/ -am integration-test
  • Run cloud component tests
mvn clean -DskipTests=false -pl aws-greengrass-testing-features/aws-greengrass-testing-features-cloudcomponent/ -am integration-test

Running tests with HSM configuration

Any test can be run with HSM configuration. HSM configuration parameters are defined here. If ggc.hsm.configured is set to true, then the framework expects the other HSM parameters to be configured. When hsm is configured, this initial config file is used to start the greengrass with. Before you run the tests with HSM, following steps are pre-requisite:

  1. DUT has the HSM installed.
  2. A device certificate is created and added to the HSM along with private key. You specify the certificate ARN and hsm labels for key and cert as parameters.
  3. PKCS library is present either on the host or on the DUT. If the library is already on the DUT, specify the library path with a prefix "dut:"
  4. Similarly, the pkcs plugin jar can be on the host agent or on the DUT. If it is already on DUT, specify the path with the prefix "dut:"

Debugging test failures

The test logs path is set using the "test.log.path" property in the project. The default value for this will be "testResults". Thus, by default logs for example component test run will be found at aws-greengrass-testing-examples/aws-greengrass-testing-examples-component/testResults

Fixing licenses

mvn license:format

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Getting Help

GitHub issue is the preferred channel to interact with our team.

Resources

About

This AWS Greengrass test framework is a collection of building blocks to support end to end QA automation from the customer perspective.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 97.1%
  • Gherkin 2.8%
  • Python 0.1%