Robot Framework Library for AWS IoT in the context of thin-edge.io
-
Install via pip
pip install git+https://github.com/thin-edge/robotframework-aws.git@main
Or add it to your
requirements.txt
filerobotframework-aws @ git+https://github.com/thin-edge/robotframework-aws.git@main
Then install it via
pip install -r requirements.txt
Alternatively you can install a specific version using:
robotframework-aws @ git+https://github.com/thin-edge/[email protected]
-
Create a
.env
file with the following environment variablesAWS_ACCESS_KEY_ID=ABCDEFGHI AWS_SECRET_ACCESS_KEY=<secret> AWS_REGION=us-east-1
-
Create a Robot test
tests/Example.robot
*** Settings *** Library AWS Library DeviceLibrary *** Test Cases *** Example ${device_name}= DeviceLibrary.Setup ${aws}= AWS.Create Thing With Self-Signed Certificate name=${device_name} DeviceLibrary.Execute Command printf -- '${aws.private_key}' > $(tedge config get device.key_path) DeviceLibrary.Execute Command printf -- '${aws.public_key}' > $(tedge config get device.cert_path) DeviceLibrary.Execute Command sudo tedge config set aws.url ${aws.url} ${stdout}= DeviceLibrary.Execute Command sudo tedge connect aws retries=0
Note
The above example uses the robotframework-devicelibrary
-
Run the test
robot tests/Example.robot
You can generate the docs yourself using:
libdoc AWS/AWS.py show > AWS/AWS.rst
Or the more interactive html documentation using:
libdoc AWS/AWS.py AWS/AWS.html
Before submitting a PR, make sure you run the formatting and linting against your code to ensure you don't have an formatting or linting errors.
You can run the formatting and linting by first installing the development dependencies, using the following just tasks:
just venv
just install_dev
After the dependencies have been installed, run the linting/formatting task and check the output.
just lint
The pylint output should rate your code as 10.00/10. Below is an example of the console output:
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)