[Feature] Use chip-tool fabrics for python tests#72259
Conversation
…w for shared fabrics across chip-tool and the python testing framework
There was a problem hiding this comment.
Code Review
This pull request adds support for INI-formatted chip-tool persistent storage configuration files by introducing --chip-tool-common-storage-path and --chip-tool-fabric-storage-path arguments, and updating the stack initialization to use PersistentStorageINI. The review feedback suggests: 1) adding type=pathlib.Path to the new arguments for automatic parsing, 2) explicitly erroring out if both --storage-path and the new chip-tool storage paths are provided, and 3) keeping the default value of storage_path as pathlib.Path(".") to avoid breaking backward compatibility, which also simplifies the stack initialization logic.
|
PR #72259: Size comparison from 8ad5f7b to 86aa69c Full report (25 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #72259 +/- ##
==========================================
+ Coverage 55.51% 55.52% +0.01%
==========================================
Files 1628 1630 +2
Lines 111083 111127 +44
Branches 13416 13418 +2
==========================================
+ Hits 61668 61706 +38
- Misses 49415 49421 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| LOGGER.warning( | ||
| "Didn't find any CertificateAuthorities in storage -- creating a new CertificateAuthority + FabricAdmin...") | ||
| ca = self._certificate_authority_manager.NewCertificateAuthority(caIndex=self._config.root_of_trust_index) | ||
| ca = self._certificate_authority_manager.NewCertificateAuthority() |
There was a problem hiding this comment.
This was what was causing the REPL to have to be run first: it was creating a 1-indexed certificate authority list where a 0-indexed one is expected.
|
PR #72259: Size comparison from 8ad5f7b to e33cf60 Full report (35 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
|
Summary
Allows python tests to use fabrics generated by chip-tool via the
chip_tool_config.iniandchip_tool_config.[example CA].inistorage files, as opposed to the.jsonfiles created/used by the python framework. This builds on work done here: #40588 that allowed the python REPL to use the same storage files.Adds two new arguments to base python tests:
Example usage:
First, commission a device using the chip-tool:
Start device:
In a separate shell:
Note
Just commissioning the device is not sufficient to fully populate the two
.inifiles for loading by python tests. It is recommended to run a YAML test against the device, after which thechip_tool_config.iniwill contain the necessary caList section:Example of running a YAML test:
After these steps, you can then run a python test on the same fabric on which you previously commissioned the device.
Example:
Testing
The above steps were used to verify the behavior. Python tests without the new arguments were used to verify a lack of regressions.