Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libraries to LTS 2.0 version. #29

Merged
merged 32 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
20c0e92
Update LTS 2.0 libraries and fix demo.
ActoryOu Aug 18, 2022
a69827b
Fix MQTT test in qualification tests.
ActoryOu Aug 18, 2022
172391d
Revert unnecessary changes. Fix qualification compile error.
ActoryOu Aug 18, 2022
ea2280a
Update integration test version.
ActoryOu Aug 19, 2022
d741fa1
Update integration test submodule pointer.
ActoryOu Aug 22, 2022
7636493
Sync PR#28 to reuse IDT config.
ActoryOu Aug 23, 2022
5ce4f00
Update GSG.md for running IDT.
ActoryOu Aug 23, 2022
610b69a
Add more descriptions for users to run qualification tests on GSG.md.
ActoryOu Aug 24, 2022
3566dfe
Add more descriptions for users to run qualification tests on GSG.md.
ActoryOu Aug 24, 2022
b95c15c
Enlarge delay time for logging to make sure unity log successfully.
ActoryOu Aug 24, 2022
4c156a6
Update LTS 2.0 libraries again
ActoryOu Aug 24, 2022
f3135ca
Add note on GSG.md.
ActoryOu Aug 25, 2022
93865a6
Fix include file names.
ActoryOu Aug 30, 2022
9369467
Update integration test main file to fit LTS2.0 integration repo.
ActoryOu Sep 12, 2022
f60da1a
Move OTA E2E task to RunOtaE2eDemo.
ActoryOu Sep 12, 2022
e76e05e
Update IDT configuration for LTSv2
jrcarbAWS Sep 20, 2022
282639e
Remove unnecessary idt_config pkcs11 labels
jrcarbAWS Sep 20, 2022
0aaddf8
Merge branch 'main' into pr/29
ActoryOu Sep 21, 2022
bb995bf
Add Joseph commit back to branch.
ActoryOu Sep 21, 2022
75e7e63
Fix spelling and formatting.
ActoryOu Sep 21, 2022
b0f2e76
Remove tailing space.
ActoryOu Sep 21, 2022
6ffa729
Update libraries version to 202210.00-LTS.
ActoryOu Oct 18, 2022
ccc99cc
Update IDT config to 202210.00-LTS.
ActoryOu Oct 18, 2022
ab36a7f
Update integration submodule pointer.
ActoryOu Oct 18, 2022
ce9f655
Fix errors after updating LTS libraries.
ActoryOu Oct 19, 2022
6f3fdc4
Fix formatting & spell-check.
ActoryOu Oct 19, 2022
814c236
Update document.
ActoryOu Oct 20, 2022
a8ef307
Update GSG doc.
ActoryOu Oct 21, 2022
e4604ff
Update GSG doc.
ActoryOu Oct 21, 2022
7aa7fc9
Add newline in .cproject
ActoryOu Oct 21, 2022
12c20b0
Update GSG doc.
ActoryOu Oct 21, 2022
3fb30d2
Revert permission.
ActoryOu Oct 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
url = https://github.com/ThrowTheSwitch/Unity.git
[submodule "Middleware/FreeRTOS/tests"]
path = Middleware/FreeRTOS/tests
url = https://github.com/FreeRTOS/Labs-FreeRTOS-Libraries-Integration-Tests.git
url = https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests.git
57 changes: 48 additions & 9 deletions GSG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ Many of these steps are automated in production environments.

[7 Run the Shadow Demo](#7-run-the-shadow-demo)<br>
[8 Run the Defender Demo](#8-run-the-defender-demo)<br>
[9 Troubleshooting Guide](#9-troubleshooting-guide)
[9 Troubleshooting Guide](#9-troubleshooting-guide)<br>
[10 Run AWS IoT Device Tester](#10-run-aws-iot-device-tester)<br>
&nbsp;&nbsp;&nbsp;&nbsp;[10.1 Download AWS IoT Device Tester](#101-download-aws-iot-device-tester)<br>
&nbsp;&nbsp;&nbsp;&nbsp;[10.2 Configure AWS IoT Device Tester](#102-configure-aws-iot-device-tester)<br>
&nbsp;&nbsp;&nbsp;&nbsp;[10.3 Configure Divice](#103-configure-device)<br>
&nbsp;&nbsp;&nbsp;&nbsp;[10.4 Running AWS IoT Device Tester](#104-running-aws-iot-device-tester)<br>

## 1 Prerequisites

Expand Down Expand Up @@ -764,11 +769,11 @@ The reference integration can be tested using [AWS IoT Device Tester for FreeRTO

IDT runs a suite of tests that include testing the device's transport interface layer implementation, PKCS11 functionality, and OTA capabilities. In IDT test cases, the IDT binary will make a copy of the source code, update the header files in the `examples/evkbmimxrt1060/test` project, then compile the project and flash the resulting image to your board. Finally, IDT will read serial output from the board and communicate with the AWS IoT cloud to ensure that test cases are passing.

### Download AWS IoT Device Tester
### 10.1 Download AWS IoT Device Tester

The latest version of IDT can be downloaded from the [public documentation page](https://docs.aws.amazon.com/freertos/latest/userguide/dev-test-versions-afr.html). This reference implementation only supports test suites of version 2.0 or later.

### Configure AWS IoT Device Tester
### 10.2 Configure AWS IoT Device Tester

After downloading and unzipping IDT onto your file system, you should extract a file structure that includes the following directories:

Expand All @@ -781,7 +786,6 @@ Before we can run IDT, we have to update the files in `configs`. In this referen
First, copy one of each file from `idt_configs` (based on host OS) in this reference repository to the `configs` directory inside the newly downloaded IDT project. This should provide you with the following files in `device_tester/configs` directory:

```
configs/dummyPublicKeyAsciiHex.txt
configs/flash.bat or flash.sh
configs/config.json
configs/userdata.json
Expand All @@ -797,14 +801,47 @@ Next, we need to update some configuration values in these files.
A few notes on the provided build and flash scripts: First, if you run into issues with the provided scripts, you can copy commands provided by the MCUXpresso IDE during a GUI build and flash to create your own build and flash scripts. Second, these scripts only work if your `test` and `bootloader` project have been built once using the MCUXpresso GUI (this creates a required files `MIMXRT1062xxxxA.xml` and `MIMXRT1062xxxxA_part.xml` at `iot-reference-nxp-rt1060/projects/evkmimxrt1060/$PROJECT/Debug`)

* In `config.json`, update the `profile` and `awsRegion` fields
* In `device.json`, update `serialPort` to the serial port of your board as from [section 2.1](https://github.com/FreeRTOS/iot-reference-nxp-rt1060/blob/main/GSG.md#21-setting-up-device). Update `publicKeyAsciiHexFilePath` to the absolute path to `dummyPublicKeyAsciiHex.txt`. Update `publicDeviceCertificateArn` to the ARN of the certificate uploaded when [provisioning the device](https://github.com/FreeRTOS/iot-reference-nxp-rt1060/blob/main/GSG.md#41-provisioning-the-device).
* In `device.json`, update `serialPort` to the serial port of your board as from [section 2.1](https://github.com/FreeRTOS/iot-reference-nxp-rt1060/blob/main/GSG.md#21-setting-up-device). Update `publicDeviceCertificateArn` to the ARN of the certificate uploaded when [provisioning the device](https://github.com/FreeRTOS/iot-reference-nxp-rt1060/blob/main/GSG.md#41-provisioning-the-device).
* In `userdata.json`, update `sourcePath` to the absolute path to the root of this reference implementation repository.
* In `userdata.json`, update `signerCertificate` with the ARN of the [application code signing certificate you created.](https://github.com/FreeRTOS/iot-reference-nxp-rt1060/blob/main/GSG.md#62-creating-an-application-code-signing-certificate)
* Run all the steps to create a [second code signing certificate](https://github.com/FreeRTOS/iot-reference-nxp-rt1060/blob/main/GSG.md#62-creating-an-application-code-signing-certificate) but do NOT provision the key onto your board. Copy the ARN for this certificate in `userdata.json` for the field `untrustedSignerCertificate`.

### Running AWS IoT Device Tester

With all the configuration out of the way, we can run IDT either from an individual test group or test case, or the entire qualification suite.
### 10.3 Configure Device

To run test cases "OTADataplaneMQTT" / OTACore / FullPKCS11_PreProvisioned_ECC successfully, we need to set our public keys manually once.

- OTADataplaneMQTT
- Follow [6.2 Creating an Application Code Signing Certificate](#62-creating-an-application-code-signing-certificate) to set code signing certificate.
- OTACore
- Set appmainPROVISIONING_MODE to 1 and appmainRUN_QUALIFICATIOn_TEST_SUITE to 0 in app_main.c
- Build and flash
- In TeraTerm or putty, `pki set pub_key sss:00223346`
- Copy and paste below content to the serial port
```
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEyza/tGLVbVxhL41iYtC8D6tGEvAH
u498gNtqDtPsKaoR3t5xQx+6zdWiCi32fgFT2vkeVAmX3pf/Gl8nIP48Zg==
-----END PUBLIC KEY-----
```
- Should print “OK”
- FullPKCS11_PreProvisioned_ECC
- Set appmainPROVISIONING_MODE to 1 and appmainRUN_QUALIFICATION_TEST_SUITE to 0 in app_main.c
- Build and flash
- Get the cert at the label in Teraterm
```
pki get cert sss:F0000001
```
- Paste that cert into a file cert.pem
- Run command `openssl x509 -pubkey -noout -in cert.pem > pubkey.pem`
- In TeraTerm or putty, `pki set pub_key sss:00223345`
- Paste the content of pubkey.pem to TeraTerm or putty
- Should print “OK”

*Note: If you fail at setting public key, try sss:00223343 and remember to change the config.*

### 10.4 Running AWS IoT Device Tester

With configuration complete, IDT can be run for an individual test group, a test case, or the entire qualification suite.

To list the available test groups, run:

Expand All @@ -826,4 +863,6 @@ To run the entire qualification suite, run:

For more information, `.\devicetester_win_x86-64.exe help` will show all available commands.

When you run IDT, a `results/uuid` directory is generated that will contain all the logs and other information associated with your test run. This allows you to debug any failures.
When you run IDT, a `results/uuid` directory is generated that will contain all the logs and other information associated with your test run. This allows you to debug any failures.

*Note: Please run qualification test without provision mode (set appmainPROVISIONING_MODE to 0 in [app_main.c](./examples/evkbmimxrt1060/test/app_main.c)).*
2 changes: 1 addition & 1 deletion Middleware/AWS/device-defender
Submodule device-defender updated 34 files
+14 −1 .github/workflows/release.yml
+0 −8 .gitmodules
+8 −0 CHANGELOG.md
+10 −18 MISRA.md
+10 −0 README.md
+1 −1 docs/doxygen/config.doxyfile
+2 −0 lexicon.txt
+1 −1 manifest.yml
+29 −0 sbom.spdx
+7 −4 source/defender.c
+3 −1 source/include/defender.h
+3 −1 source/include/defender_config_defaults.h
+3 −0 test/CMakeLists.txt
+0 −1 test/cbmc/aws-templates-for-cbmc-proofs
+0 −1 test/cbmc/include/README.md
+6 −0 test/cbmc/include/README.md
+0 −1 test/cbmc/litani
+3 −1 test/cbmc/proofs/Defender_GetTopic/Defender_GetTopic_harness.c
+1 −1 test/cbmc/proofs/Defender_GetTopic/Makefile
+3 −1 test/cbmc/proofs/Defender_MatchTopic/Defender_MatchTopic_harness.c
+1 −1 test/cbmc/proofs/Defender_MatchTopic/Makefile
+2 −2 test/cbmc/proofs/Makefile-project-defines
+1 −1 test/cbmc/proofs/Makefile-project-targets
+1 −1 test/cbmc/proofs/Makefile-project-testing
+0 −1 test/cbmc/proofs/Makefile.common
+999 −0 test/cbmc/proofs/Makefile.common
+0 −1 test/cbmc/proofs/README.md
+27 −0 test/cbmc/proofs/README.md
+0 −0 test/cbmc/proofs/lib/__init__.py
+92 −0 test/cbmc/proofs/lib/summarize.py
+0 −1 test/cbmc/proofs/run-cbmc-proofs.py
+414 −0 test/cbmc/proofs/run-cbmc-proofs.py
+0 −1 test/cbmc/sources/README.md
+6 −0 test/cbmc/sources/README.md
+0 −1 test/cbmc/stubs/README.md
+6 −0 test/cbmc/stubs/README.md
+25 −5 test/include/defender_config.h
+3 −1 test/unit-test/defender_utest.c
+79 −0 tools/coverity/README.md
+8 −15 tools/coverity/misra.config
2 changes: 1 addition & 1 deletion Middleware/AWS/device-shadow
Submodule device-shadow updated 36 files
+11 −0 .github/workflows/doxygen.yml
+0 −22 .github/workflows/memory_statistics.yml
+27 −2 .github/workflows/release.yml
+0 −8 .gitmodules
+8 −0 CHANGELOG.md
+9 −19 MISRA.md
+10 −0 README.md
+1 −1 docs/doxygen/config.doxyfile
+2 −0 lexicon.txt
+1 −1 manifest.yml
+29 −0 sbom.spdx
+3 −1 source/include/shadow.h
+3 −1 source/include/shadow_config_defaults.h
+9 −7 source/shadow.c
+2 −0 test/CMakeLists.txt
+0 −1 test/cbmc/aws-templates-for-cbmc-proofs
+0 −1 test/cbmc/include/README.md
+6 −0 test/cbmc/include/README.md
+0 −1 test/cbmc/litani
+1 −1 test/cbmc/proofs/Makefile-project-defines
+1 −1 test/cbmc/proofs/Makefile-project-targets
+1 −1 test/cbmc/proofs/Makefile-project-testing
+0 −1 test/cbmc/proofs/Makefile.common
+999 −0 test/cbmc/proofs/Makefile.common
+0 −1 test/cbmc/proofs/README.md
+27 −0 test/cbmc/proofs/README.md
+3 −1 test/cbmc/proofs/Shadow_AssembleTopicString/Shadow_AssembleTopicString_harness.c
+3 −1 test/cbmc/proofs/Shadow_MatchTopic/Shadow_MatchTopic_harness.c
+3 −1 test/cbmc/proofs/Shadow_MatchTopicString/Shadow_MatchTopicString_harness.c
+0 −0 test/cbmc/proofs/lib/__init__.py
+92 −0 test/cbmc/proofs/lib/summarize.py
+0 −1 test/cbmc/proofs/run-cbmc-proofs.py
+414 −0 test/cbmc/proofs/run-cbmc-proofs.py
+0 −1 test/cbmc/sources/README.md
+6 −0 test/cbmc/sources/README.md
+0 −1 test/cbmc/stubs/README.md
+6 −0 test/cbmc/stubs/README.md
+24 −5 test/include/shadow_config.h
+3 −1 test/unit-test/shadow_utest.c
+79 −0 tools/coverity/README.md
+26 −0 tools/coverity/misra.config
+0 −46 tools/misra.config
2 changes: 1 addition & 1 deletion Middleware/AWS/ota
Submodule ota updated 208 files
2 changes: 1 addition & 1 deletion Middleware/FreeRTOS/coreJSON
Submodule coreJSON updated 66 files
+11 −0 .github/workflows/doxygen.yml
+0 −22 .github/workflows/memory_statistics.yml
+27 −2 .github/workflows/release.yml
+0 −8 .gitmodules
+9 −0 CHANGELOG.md
+24 −19 MISRA.md
+11 −1 README.md
+729 −96 docs/doxygen/config.doxyfile
+4 −0 lexicon.txt
+1 −1 manifest.yml
+29 −0 sbom.spdx
+18 −13 source/core_json.c
+3 −1 source/include/core_json.h
+3 −0 test/CMakeLists.txt
+0 −1 test/cbmc/aws-templates-for-cbmc-proofs
+0 −1 test/cbmc/include/README.md
+6 −0 test/cbmc/include/README.md
+3 −1 test/cbmc/include/core_json_annex.h
+3 −1 test/cbmc/include/skipGeneric.h
+0 −1 test/cbmc/litani
+3 −1 test/cbmc/proofs/JSON_Iterate/JSON_Iterate_harness.c
+1 −1 test/cbmc/proofs/JSON_Iterate/Makefile
+3 −1 test/cbmc/proofs/JSON_Search/JSON_Search_harness.c
+1 −1 test/cbmc/proofs/JSON_Search/Makefile
+3 −1 test/cbmc/proofs/JSON_Validate/JSON_Validate_harness.c
+1 −1 test/cbmc/proofs/JSON_Validate/Makefile
+1 −1 test/cbmc/proofs/Makefile-json.common
+2 −2 test/cbmc/proofs/Makefile-project-defines
+1 −1 test/cbmc/proofs/Makefile-project-targets
+1 −1 test/cbmc/proofs/Makefile-project-testing
+0 −1 test/cbmc/proofs/Makefile.common
+999 −0 test/cbmc/proofs/Makefile.common
+0 −0 test/cbmc/proofs/lib/__init__.py
+92 −0 test/cbmc/proofs/lib/summarize.py
+0 −1 test/cbmc/proofs/run-cbmc-proofs.py
+414 −0 test/cbmc/proofs/run-cbmc-proofs.py
+1 −1 test/cbmc/proofs/skipAnyLiteral/Makefile
+3 −1 test/cbmc/proofs/skipAnyLiteral/skipAnyLiteral_harness.c
+1 −1 test/cbmc/proofs/skipCollection/Makefile
+3 −1 test/cbmc/proofs/skipCollection/skipCollection_harness.c
+1 −1 test/cbmc/proofs/skipEscape/Makefile
+3 −1 test/cbmc/proofs/skipEscape/skipEscape_harness.c
+1 −1 test/cbmc/proofs/skipNumber/Makefile
+3 −1 test/cbmc/proofs/skipNumber/skipNumber_harness.c
+1 −1 test/cbmc/proofs/skipSpace/Makefile
+3 −1 test/cbmc/proofs/skipSpace/skipSpace_harness.c
+1 −1 test/cbmc/proofs/skipSpaceAndComma/Makefile
+3 −1 test/cbmc/proofs/skipSpaceAndComma/skipSpaceAndComma_harness.c
+1 −1 test/cbmc/proofs/skipString/Makefile
+3 −1 test/cbmc/proofs/skipString/skipString_harness.c
+1 −1 test/cbmc/proofs/skipUTF8/Makefile
+3 −1 test/cbmc/proofs/skipUTF8/skipUTF8_harness.c
+0 −1 test/cbmc/sources/README.md
+6 −0 test/cbmc/sources/README.md
+0 −1 test/cbmc/stubs/README.md
+6 −0 test/cbmc/stubs/README.md
+3 −1 test/cbmc/stubs/skipAnyLiteral.c
+3 −1 test/cbmc/stubs/skipAnyScalar.c
+3 −1 test/cbmc/stubs/skipCollection.c
+2 −0 test/cbmc/stubs/skipDigits.c
+3 −1 test/cbmc/stubs/skipEscape.c
+3 −1 test/cbmc/stubs/skipGeneric.c
+3 −1 test/cbmc/stubs/skipNumber.c
+3 −1 test/cbmc/stubs/skipSpace.c
+3 −1 test/cbmc/stubs/skipSpaceAndComma.c
+3 −1 test/cbmc/stubs/skipString.c
+3 −1 test/cbmc/stubs/skipUTF8.c
+2 −0 test/unit-test/catch_assert.h
+19 −3 test/unit-test/core_json_utest.c
+79 −0 tools/coverity/README.md
+13 −10 tools/coverity/misra.config
2 changes: 1 addition & 1 deletion Middleware/FreeRTOS/coreMQTT
Submodule coreMQTT updated 96 files
+1 −0 .github/workflows/ci.yml
+11 −0 .github/workflows/doxygen.yml
+0 −22 .github/workflows/memory_statistics.yml
+31 −5 .github/workflows/release.yml
+3 −0 .gitignore
+0 −8 .gitmodules
+28 −0 CHANGELOG.md
+53 −0 Dockerfile
+35 −21 MISRA.md
+234 −0 MigrationGuide.md
+25 −7 README.md
+208 −180 docs/doxygen/config.doxyfile
+7 −7 docs/doxygen/include/size_table.md
+5 −9 docs/doxygen/pages.dox
+0 −1 docs/doxygen/porting.dox
+4 −6 docs/doxygen/timeouts.dox
+34 −1 lexicon.txt
+1 −1 manifest.yml
+13 −0 requirements.txt
+43 −0 sbom.spdx
+1,195 −378 source/core_mqtt.c
+343 −72 source/core_mqtt_serializer.c
+144 −44 source/core_mqtt_state.c
+172 −59 source/include/core_mqtt.h
+59 −117 source/include/core_mqtt_config_defaults.h
+132 −0 source/include/core_mqtt_default_logging.h
+133 −13 source/include/core_mqtt_serializer.h
+28 −8 source/include/core_mqtt_state.h
+55 −4 source/interface/transport_interface.h
+1 −0 test/CMakeLists.txt
+0 −1 test/cbmc/aws-templates-for-cbmc-proofs
+0 −1 test/cbmc/include/README.md
+6 −0 test/cbmc/include/README.md
+3 −1 test/cbmc/include/core_mqtt_config.h
+3 −1 test/cbmc/include/event_callback_stub.h
+3 −1 test/cbmc/include/get_time_stub.h
+4 −9 test/cbmc/include/mqtt_cbmc_state.h
+3 −1 test/cbmc/include/network_interface_stubs.h
+0 −1 test/cbmc/litani
+104 −2 test/cbmc/proofs/MQTT_Connect/MQTT_Connect_harness.c
+11 −10 test/cbmc/proofs/MQTT_Connect/Makefile
+5 −3 test/cbmc/proofs/MQTT_DeserializeAck/MQTT_DeserializeAck_harness.c
+4 −2 test/cbmc/proofs/MQTT_DeserializePublish/MQTT_DeserializePublish_harness.c
+5 −1 test/cbmc/proofs/MQTT_Disconnect/MQTT_Disconnect_harness.c
+3 −3 test/cbmc/proofs/MQTT_Disconnect/Makefile
+3 −1 test/cbmc/proofs/MQTT_GetIncomingPacketTypeAndLength/MQTT_GetIncomingPacketTypeAndLength_harness.c
+4 −2 test/cbmc/proofs/MQTT_GetPacketId/MQTT_GetPacketId_harness.c
+5 −3 test/cbmc/proofs/MQTT_GetSubAckStatusCodes/MQTT_GetSubAckStatusCodes_harness.c
+8 −6 test/cbmc/proofs/MQTT_Init/MQTT_Init_harness.c
+6 −4 test/cbmc/proofs/MQTT_MatchTopic/MQTT_MatchTopic_harness.c
+3 −1 test/cbmc/proofs/MQTT_Ping/MQTT_Ping_harness.c
+3 −3 test/cbmc/proofs/MQTT_Ping/Makefile
+4 −9 test/cbmc/proofs/MQTT_ProcessLoop/MQTT_ProcessLoop_harness.c
+9 −6 test/cbmc/proofs/MQTT_ProcessLoop/Makefile
+3 −1 test/cbmc/proofs/MQTT_ProcessLoop/cbmc-viewer.json
+33 −1 test/cbmc/proofs/MQTT_Publish/MQTT_Publish_harness.c
+5 −6 test/cbmc/proofs/MQTT_Publish/Makefile
+4 −9 test/cbmc/proofs/MQTT_ReceiveLoop/MQTT_ReceiveLoop_harness.c
+10 −7 test/cbmc/proofs/MQTT_ReceiveLoop/Makefile
+2 −1 test/cbmc/proofs/MQTT_ReceiveLoop/cbmc-viewer.json
+3 −1 test/cbmc/proofs/MQTT_SerializeAck/MQTT_SerializeAck_harness.c
+3 −1 test/cbmc/proofs/MQTT_SerializeConnect/MQTT_SerializeConnect_harness.c
+0 −7 test/cbmc/proofs/MQTT_SerializeConnect/Makefile
+3 −1 test/cbmc/proofs/MQTT_SerializeDisconnect/MQTT_SerializeDisconnect_harness.c
+3 −1 test/cbmc/proofs/MQTT_SerializePingreq/MQTT_SerializePingreq_harness.c
+3 −1 test/cbmc/proofs/MQTT_SerializePublish/MQTT_SerializePublish_harness.c
+4 −2 test/cbmc/proofs/MQTT_SerializePublishHeader/MQTT_SerializePublishHeader_harness.c
+3 −1 test/cbmc/proofs/MQTT_SerializeSubscribe/MQTT_SerializeSubscribe_harness.c
+3 −1 test/cbmc/proofs/MQTT_SerializeUnsubscribe/MQTT_SerializeUnsubscribe_harness.c
+35 −3 test/cbmc/proofs/MQTT_Subscribe/MQTT_Subscribe_harness.c
+10 −5 test/cbmc/proofs/MQTT_Subscribe/Makefile
+35 −3 test/cbmc/proofs/MQTT_Unsubscribe/MQTT_Unsubscribe_harness.c
+10 −4 test/cbmc/proofs/MQTT_Unsubscribe/Makefile
+1 −1 test/cbmc/proofs/Makefile-project-defines
+1 −1 test/cbmc/proofs/Makefile-project-targets
+1 −1 test/cbmc/proofs/Makefile-project-testing
+0 −1 test/cbmc/proofs/Makefile.common
+999 −0 test/cbmc/proofs/Makefile.common
+0 −1 test/cbmc/proofs/README.md
+27 −0 test/cbmc/proofs/README.md
+0 −0 test/cbmc/proofs/lib/__init__.py
+92 −0 test/cbmc/proofs/lib/summarize.py
+0 −1 test/cbmc/proofs/run-cbmc-proofs.py
+414 −0 test/cbmc/proofs/run-cbmc-proofs.py
+0 −1 test/cbmc/sources/README.md
+6 −0 test/cbmc/sources/README.md
+71 −64 test/cbmc/sources/mqtt_cbmc_state.c
+0 −1 test/cbmc/stubs/README.md
+6 −0 test/cbmc/stubs/README.md
+3 −1 test/cbmc/stubs/event_callback_stub.c
+3 −1 test/cbmc/stubs/get_time_stub.c
+0 −57 test/cbmc/stubs/memcpy.c
+35 −0 test/cbmc/stubs/memmove.c
+3 −1 test/cbmc/stubs/network_interface_stubs.c
+5 −1 test/unit-test/core_mqtt_config.h
+376 −4 test/unit-test/core_mqtt_serializer_utest.c
+311 −8 test/unit-test/core_mqtt_state_utest.c
+3,530 −1,109 test/unit-test/core_mqtt_utest.c
+3 −1 test/unit-test/logging/logging_levels.h
+3 −1 test/unit-test/logging/logging_stack.h
+79 −0 tools/coverity/README.md
+43 −0 tools/coverity/misra.config
2 changes: 1 addition & 1 deletion Middleware/FreeRTOS/coreMQTT-Agent
Submodule coreMQTT-Agent updated 130 files
2 changes: 1 addition & 1 deletion Middleware/FreeRTOS/corePKCS11
Submodule corePKCS11 updated 154 files
2 changes: 1 addition & 1 deletion Middleware/FreeRTOS/kernel
Submodule kernel updated 673 files
4 changes: 2 additions & 2 deletions examples/common/mqtt_agent/mqtt_agent_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#include "using_mbedtls.h"

/* Keystore APIs to fetch configuration data. */
#include "kvStore.h"
#include "kvstore.h"
ActoryOu marked this conversation as resolved.
Show resolved Hide resolved

/* Includes MQTT Agent Task management APIs. */
#include "mqtt_agent_task.h"
Expand Down Expand Up @@ -373,7 +373,7 @@ static char * pcDeviceCertID = NULL;

static MQTTStatus_t prvMQTTInit( void )
{
TransportInterface_t xTransport;
TransportInterface_t xTransport = { 0 };
MQTTStatus_t xReturn;
MQTTFixedBuffer_t xFixedBuffer = { .pBuffer = xNetworkBuffer, .size = MQTT_AGENT_NETWORK_BUFFER_SIZE };
static uint8_t staticQueueStorageArea[ MQTT_AGENT_COMMAND_QUEUE_LENGTH * sizeof( MQTTAgentCommand_t * ) ];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extern void vLoggingPrintf( const char * pcFormat,
#define configUSE_DAEMON_TASK_STARTUP_HOOK 1
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 7 )
#define configMAX_PRIORITIES ( 9 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing the maximum priority from 7 to 9?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After commit in kernel, it triggered an assertion because task priority is larger than max priorities. That's why I enlarge it here.

#define configMINIMAL_STACK_SIZE ( ( uint16_t ) 90 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 160 * 1024 ) ) /* 160 Kbytes. */
#define configMAX_TASK_NAME_LEN ( 16 )
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* An empty config file for the CBMC proofs to compile with the default
* definitions of configuration macros. */
2 changes: 1 addition & 1 deletion examples/evkbmimxrt1060/defender/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#include "ksdk_mbedtls.h"

#include "nxlog_App.h"
#include "nxLog_App.h"
ActoryOu marked this conversation as resolved.
Show resolved Hide resolved
#include "mflash_drv.h"

#include "ex_sss_boot.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/evkbmimxrt1060/pubsub/include/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extern void vLoggingPrintf( const char * pcFormat,
#define configUSE_DAEMON_TASK_STARTUP_HOOK 1
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 7 )
#define configMAX_PRIORITIES ( 9 )
#define configMINIMAL_STACK_SIZE ( ( uint16_t ) 90 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 160 * 1024 ) ) /* 160 Kbytes. */
#define configMAX_TASK_NAME_LEN ( 16 )
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* An empty config file for the CBMC proofs to compile with the default
* definitions of configuration macros. */
4 changes: 2 additions & 2 deletions examples/evkbmimxrt1060/pubsub/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#include "ksdk_mbedtls.h"

#include "nxlog_App.h"
#include "nxLog_App.h"
ActoryOu marked this conversation as resolved.
Show resolved Hide resolved
#include "mflash_drv.h"

#include "ex_sss_boot.h"
Expand All @@ -70,7 +70,7 @@
/* MAC address configuration. */
#define configMAC_ADDR \
{ \
0x02, 0x12, 0x13, 0x10, 0x15, 0x25 \
0x00, 0x11, 0x22, 0x33, 0x44, 0x41 \
}

/* Address of PHY interface. */
Expand Down
2 changes: 1 addition & 1 deletion examples/evkbmimxrt1060/shadow/include/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extern void vLoggingPrintf( const char * pcFormat,
#define configUSE_DAEMON_TASK_STARTUP_HOOK 1
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 7 )
#define configMAX_PRIORITIES ( 9 )
#define configMINIMAL_STACK_SIZE ( ( uint16_t ) 90 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 160 * 1024 ) ) /* 160 Kbytes. */
#define configMAX_TASK_NAME_LEN ( 16 )
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* An empty config file for the CBMC proofs to compile with the default
* definitions of configuration macros. */
2 changes: 1 addition & 1 deletion examples/evkbmimxrt1060/shadow/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#include "ksdk_mbedtls.h"

#include "nxlog_App.h"
#include "nxLog_App.h"
ActoryOu marked this conversation as resolved.
Show resolved Hide resolved
#include "mflash_drv.h"

#include "ex_sss_boot.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/evkbmimxrt1060/shadow/shadow_device_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
* functions. shadowexampleMS_TO_WAIT_FOR_NOTIFICATION defines the time, in ticks,
* to wait for such a callback.
*/
#define shadowexampleMS_TO_WAIT_FOR_NOTIFICATION ( 5000 )
#define shadowexampleMS_TO_WAIT_FOR_NOTIFICATION ( 15000 )

/**
* @brief The maximum amount of time in milliseconds to wait for the commands
Expand Down
2 changes: 1 addition & 1 deletion examples/evkbmimxrt1060/shadow/shadow_update_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
* functions. shadowexampleMS_TO_WAIT_FOR_NOTIFICATION defines the time, in ticks,
* to wait for such a callback.
*/
#define shadowexampleMS_TO_WAIT_FOR_NOTIFICATION ( 5000 )
#define shadowexampleMS_TO_WAIT_FOR_NOTIFICATION ( 15000 )

/**
* @brief The maximum amount of time in milliseconds to wait for the commands
Expand Down
45 changes: 26 additions & 19 deletions examples/evkbmimxrt1060/test/app_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,32 @@ int RunDeviceAdvisorDemo( void )
return ( xResult == pdPASS ) ? 0 : -1;
}

int RunOtaE2eDemo( void )
{
BaseType_t xResult = pdFAIL;

if( xGetMQTTAgentState() < MQTT_AGENT_STATE_INITIALIZED )
{
xResult = xMQTTAgentInit( appmainMQTT_AGENT_TASK_STACK_SIZE, appmainMQTT_AGENT_TASK_PRIORITY );
}
else
{
xResult = pdPASS;
}

if( xResult == pdPASS )
{
xResult = xTaskCreate( vOTAUpdateTask,
"OTA",
appmainMQTT_OTA_UPDATE_TASK_STACK_SIZE,
NULL,
appmainMQTT_OTA_UPDATE_TASK_PRIORITY,
NULL );
}

return ( xResult == pdPASS ) ? 0 : -1;
}

int app_main( void )
{
BaseType_t xResult = pdFAIL;
Expand All @@ -119,25 +145,6 @@ int app_main( void )
}
#endif /* if ( appmainPROVISIONING_MODE == 1 ) */

#if ( OTA_E2E_TEST_ENABLED == 1 )
{
if( xResult == pdPASS )
{
xResult = xMQTTAgentInit( appmainMQTT_AGENT_TASK_STACK_SIZE, appmainMQTT_AGENT_TASK_PRIORITY );
}

if( xResult == pdPASS )
{
xResult = xTaskCreate( vOTAUpdateTask,
"OTA",
appmainMQTT_OTA_UPDATE_TASK_STACK_SIZE,
NULL,
appmainMQTT_OTA_UPDATE_TASK_PRIORITY,
NULL );
}
}
#endif /* if ( OTA_E2E_TEST_ENABLED == 1 ) */

{
if( xResult == pdPASS )
{
Expand Down
2 changes: 1 addition & 1 deletion examples/evkbmimxrt1060/test/include/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extern void vLoggingPrintf( const char * pcFormat,
#define configUSE_DAEMON_TASK_STARTUP_HOOK 1
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 7 )
#define configMAX_PRIORITIES ( 9 )
#define configMINIMAL_STACK_SIZE ( ( uint16_t ) 90 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 160 * 1024 ) ) /* 160 Kbytes. */
#define configMAX_TASK_NAME_LEN ( 16 )
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* An empty config file for the CBMC proofs to compile with the default
* definitions of configuration macros. */
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
*
* #define MQTT_TEST_ENABLED (0)
*/
#define MQTT_TEST_ENABLED ( 0 )

/**
* @brief Configuration to enable the transport interface test.
Expand Down
29 changes: 27 additions & 2 deletions examples/evkbmimxrt1060/test/include/test_param_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,29 @@
*/
#define MQTT_SERVER_PORT ( 8883 )

/**
* @brief The MQTT client identifier used in MQTT test. Each client identifier
* must be unique; so edit as required to ensure that no two clients connecting to
* the same broker use the same client identifier.
*
* #define MQTT_TEST_CLIENT_IDENTIFIER "insert here."
*/

/**
* @brief Network buffer size specified in bytes. Must be large enough to hold the maximum
* anticipated MQTT payload.
*
* #define MQTT_TEST_NETWORK_BUFFER_SIZE ( 5000 )
*/
#define MQTT_TEST_NETWORK_BUFFER_SIZE ( 5000 )

/**
* @brief Endpoint of the echo server to connect to in transport interface test.
*
* #define ECHO_SERVER_ENDPOINT "PLACE_HOLDER"
*/


/**
* @brief Port of the echo server to connect to in transport interface test.
*
Expand Down Expand Up @@ -141,17 +158,25 @@
*/
#define OTA_PAL_USE_FILE_SYSTEM 0

/**
* @brief The IoT Thing name for the device for OTA test and MQTT test.
*
* #define IOT_THING_NAME "PLACE_HOLDER"
*/
#define IOT_THING_NAME "PLACE_HOLDER"

/**
* @brief 1 if using PKCS #11 to access the code sign certificate from NVM.
*/
#define OTA_PAL_READ_CERTIFICATE_FROM_NVM_WITH_PKCS11 0

#define IOT_THING_NAME "PLACE_HOLDER"

#define OTA_APP_VERSION_MAJOR 0

#define OTA_APP_VERSION_MINOR 9

#define OTA_APP_VERSION_BUILD 1

#define OUTGOING_PUBLISH_RECORD_COUNT ( 10 )
#define INCOMING_PUBLISH_RECORD_COUNT ( 10 )

#endif /* TEST_PARAM_CONFIG_H */
Loading