Skip to content

Commit 5694f12

Browse files
DakshitBabbarDakshit Babbaraggargchinglee-iot
authored
Update the instructions in README for running integration tests (#125)
* Update the instructions in README for running integration tests * Resolve comments * Resolve CI checks * Update GettingStartedGuide.md Co-authored-by: chinglee-iot <[email protected]> --------- Co-authored-by: Dakshit Babbar <[email protected]> Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]> Co-authored-by: chinglee-iot <[email protected]>
1 parent 5413d8c commit 5694f12

File tree

5 files changed

+39
-5
lines changed

5 files changed

+39
-5
lines changed

.github/.cSpellWords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ subpubunsubconfig
7373
tsens
7474
unsubscriptions
7575
utest
76+
mosquitto

GettingStartedGuide.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,9 @@ disabled when running the qualification test. You can change the log level by
616616

617617
1. Device Advisor Test
618618
- Create a [Device Advisor test suite](https://docs.aws.amazon.com/iot/latest/developerguide/device-advisor.html)
619-
in the console.
619+
in the console. Make sure that the region you choose supports the Device Advisor Tests feature.
620+
- When asked to select a Device Role, create a new role with the following configurations:
621+
![alt text](./artifacts/device-advisor-tests-role-config.jpg)
620622
- Find the Device Advisor test endpoint for your account
621623
- Under `Featured FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Execution Test Configurations`,
622624
choose `Device Advisor Test`.
@@ -625,14 +627,30 @@ disabled when running the qualification test. You can change the log level by
625627
- Set `Thing Name for Device Advisor Test/OTA end-to-end Test` to AWS IoT Thing under test.
626628
- Build and run.
627629
- See Device Advisor test result in the console.
630+
- Example Result
631+
![alt text](./artifacts/device-advisor-tests-result.jpg)
628632

629633
2. MQTT Test
634+
- Setup an AWS account and create a new thing.
635+
- Under the "Attach policies to certificate" section create a new policy with all the MQTT related permissions as these are required for the tests:
636+
![alt text](./artifacts/mqtt-thing-cert-policy-permissions.jpg)
630637
- Under `Featured FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Execution Test Configurations`,
631638
choose `MQTT Test`.
632639
- Under `FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Parameter Configurations`
633640
- Set `Endpoint for MQTT Broker to use` to your AWS IoT endpoint
634641
- Set `Client Identifier for MQTT Test`
635642
- Build and run.
643+
- The test requires that there be no retained message associated with the test topic. If you receive memory leak reports from Unity, it could be due to retained messages. Try clearing the retained messages. Install any MQTT client library (e.g. mosquitto CLI) and publish a message to the test topic with an empty message.
644+
```
645+
mosquitto_pub.exe \
646+
--cert <device-certificate> \
647+
--key <device-private-key> \
648+
--cafile <server-root-CA> \
649+
-h <broker-endpoint> -p 8883 \
650+
-t "<test_topic>"
651+
-m ""
652+
-r
653+
```
636654
- See test result on target output.
637655
- Example output
638656
@@ -646,16 +664,31 @@ disabled when running the qualification test. You can change the log level by
646664
```
647665
648666
3. Transport Interface Test
649-
- Follow
667+
- First setup a TCP echo server. This can be done on any Linux machine but following are the instructions to do so in an AWS EC2 instance.
668+
- Create an EC2 instance and change the security group inbound rules to accept packets from all traffic.
669+
- Clone [FreeRTOS-Libraries-Integration-Tests](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests) in a directory of your choice within your EC2 file system.
670+
- Follow the instructions [here](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/tree/main/tools/echo_server) to generate the self signed certificates. Download the certificates generated for the server to your PC.
671+
- Run the go server at `FreeRTOS-Libraries-Integration-Tests/tools/echo_server` with TLS. Follow
650672
[Run The Transport Interface Test](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/tree/main/src/transport_interface#6-run-the-transport-interface-test)
651673
to start an echo server.
674+
- In the file [test_param_config.h](./components/FreeRTOS-Libraries-Integration-Tests/config/test_param_config.h) set `ECHO_SERVER_ROOT_CA` to `NULL`
675+
- Replace the file `/main/certs/root_cert_auth.crt` with your server’s root-ca certificate that you downloaded but name the file same as before (including the extension `root_cert_auth.crt`).
676+
- Use the command below to provision your board with the certificates you downloaded
677+
```
678+
python managed_components/espressif__esp_secure_cert_mgr/tools/configure_esp_secure_cert.py \
679+
-p COM18 --keep_ds_data_on_host \
680+
--ca-cert certs/server.pem \
681+
--device-cert certs/client.pem \
682+
--private-key certs/client.key \
683+
--target_chip esp32c3 \
684+
--secure_cert_type cust_flash \
685+
--priv_key_algo RSA 2048
686+
```
652687
- Under `Featured FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Execution Test Configurations`,
653688
choose `Transport Interface Test`.
654689
- Under `FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Parameter Configurations`
655-
- Set `Echo Server Domain Name/IP for Transport Interface Test`
690+
- Set `Echo Server Domain Name/IP for Transport Interface Test` (it will be the Public IPv4 DNS of the EC2 instance if you are using one.)
656691
- Set `Port for Echo Server to use`
657-
- Set ECHO_SERVER_ROOT_CA / TRANSPORT_CLIENT_CERTIFICATE and TRANSPORT_CLIENT_PRIVATE_KEY
658-
in [test_param_config.h](./components/FreeRTOS-Libraries-Integration-Tests/config/test_param_config.h).
659692
- Build and run.
660693
- See test result on target output.
661694
- Example output
143 KB
Loading
301 KB
Loading
86.7 KB
Loading

0 commit comments

Comments
 (0)