Skip to content

Commit bfa8343

Browse files
author
Dakshit Babbar
committed
Update the instructions in README for running integration tests
1 parent f4c15d5 commit bfa8343

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

GettingStartedGuide.md

Lines changed: 38 additions & 6 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 permissions (this is not suggested for Things associated with production applications, there you should choose only the required permissions):
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+
- If you have memory leaks reported 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-certifiacte> \
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,30 @@ disabled when running the qualification test. You can change the log level by
646664
```
647665
648666
3. Transport Interface Test
649-
- Follow
667+
- Create an EC2 instance and change the security group inbound rules to accept packets from all traffic.
668+
- Clone [FreeRTOS-Libraries-Integration-Tests](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests) in a directory of your choice within your EC2 file system.
669+
- 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.
670+
- Run the go server at `FreeRTOS-Libraries-Integration-Tests/tools/echo_server` with TLS. Follow
650671
[Run The Transport Interface Test](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/tree/main/src/transport_interface#6-run-the-transport-interface-test)
651672
to start an echo server.
673+
- In the file [test_param_config.h](./components/FreeRTOS-Libraries-Integration-Tests/config/test_param_config.h) set `ECHO_SERVER_ROOT_CA` to `NULL`
674+
- 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`).
675+
- Use the command below to provision your board with the certificates you downloaded
676+
```
677+
python managed_components/espressif__esp_secure_cert_mgr/tools/configure_esp_secure_cert.py \
678+
-p COM18 --keep_ds_data_on_host \
679+
--ca-cert certs/server.pem \
680+
--device-cert certs/client.pem \
681+
--private-key certs/client.key \
682+
--target_chip esp32c3 \
683+
--secure_cert_type cust_flash \
684+
--priv_key_algo RSA 2048
685+
```
652686
- Under `Featured FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Execution Test Configurations`,
653687
choose `Transport Interface Test`.
654688
- Under `FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Parameter Configurations`
655-
- Set `Echo Server Domain Name/IP for Transport Interface Test`
656-
- 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).
689+
- Set `Echo Server Domain Name/IP for Transport Interface Test` to the Public IPv4 DNS of the ec2 instance.
690+
- Set `Port for Echo Server to use` to 9000
659691
- Build and run.
660692
- See test result on target output.
661693
- Example output
143 KB
Loading
301 KB
Loading
86.7 KB
Loading

0 commit comments

Comments
 (0)