Commit 0ac3ca8
[Create Test] Creating IDM_3_2 python3 test module (project-chip#41066)
* [Create Test] Creating IDM_3_2 python3 test module
- Creating test module for Task #[322](project-chip/matter-test-scripts#322)
- Created updated test plan to remove test step 1 here: [5539](CHIP-Specifications/chip-test-plans#5539)
* Update src/python_testing/TC_IDM_3_2.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Update src/python_testing/TC_IDM_3_2.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Restyled by autopep8
* Removing unneeded imports
* Resolving linting errors
* Restyled by autopep8
* Resolving linting errors part 2
* Updating docstrings to be more logical and understandable
* Updating docstrings further for clarity
* Adding plumbing for TIMED_REQUEST_MISMATCH validation, changed to node label if check for test steps 5 and 6, and added commissioning test step 0:
- Added plumbing for TIMED_REQUEST_MISMATCH validation in test step 7: Following similar logic as noticed in TestOnlySendCommandTimedRequestFlagWithNoTimedInvoke function
- Added commissioning test step 0
- Added if check for exist of node label attribute to see if we should run test step 5 and 6, else we currently skip these test steps (Until follow-up is implemented)
* Restyled by whitespace
* Restyled by clang-format
* Restyled by autopep8
* Update TC_IDM_3_2.py
Adding todo follow-up task: project-chip/matter-test-scripts#693 for test steps 5 and 6 logic
* Resolving linting errors and added some additional comments to test step 7
* Resolving code dups in ChipDeviceCtrl.py, Attribute.py, and attribute.cpp
* Restyled by whitespace
* Restyled by clang-format
* Restyled by autopep8
* Refactored timed request logic and improve attribute discovery
- Updated WriteClient.cpp/h to use mForceTimedRequestFlag instead of mTimedWriteTimeoutMs.HasValue() for timed request control
- Created new find_timed_write_attribute function which uses ClusterAttributeDescriptor.must_use_timed_write to find timed write attributes dynamically for use in test step 7
* Restyled by autopep8
* Implement SuppressResponse functionality and fix WriteHandler bug per Cecille's request
- Add suppressResponse parameter to Python WriteAttribute APIs in ChipDeviceCtrl.py
- Update Python bindings in Attribute.py to pass suppressResponse flag to C++
- Modify WriteClient to properly set SuppressResponse in WriteRequest messages
- Fix critical bug in WriteHandler.cpp: HandleWriteRequestMessage() was not
checking SuppressResponse flag before sending WriteResponse messages
- Update TC_IDM_3_2.py step 4 to test SuppressResponse with proper exception handling:
* Use assert_raises(ChipStackError) pattern instead of broad exception catching
* Expect CHIP Error 0x00000032 (Timeout) when suppressResponse=True works correctly
* Verify write operation succeeds despite timeout by reading attribute back
- Consolidate NodeLabel attribute guard for steps 4-6 to reduce duplication
- Add ChipStackError import from matter.exceptions
* Restyled by whitespace
* Restyled by clang-format
* Restyled by autopep8
* Restyled by isort
* Update WriteHandler.cpp
Removing check for SuppressResponse flag in HandleWriteRequestMessage()
* Update TC_IDM_3_2.py
Adding skip test step 4 until SuppressResponse implementation can be implemented on the SDK server side.
Once implemented the code in test step 4 should work and the commented out block of code can then be uncommented.
* Update TC_IDM_3_2.py
Moved the self.skip_test(4) to above the commented out code block for test step 4 for easier reading and understanding of why it is currently being skipped.
* Update TC_IDM_3_2.py
Removed unnecessary comment for why test step 4 is being skipped
* Applying autopep8
* Recovering lost variable
* Restyled by autopep8
* resolving lint error
* Restyled by autopep8
* Update src/controller/python/matter/ChipDeviceCtrl.py
Co-authored-by: C Freeman <[email protected]>
* Address PR feedback from Cecille: improve type safety and simplify attribute detection
- Change suppressResponse from Optional[bool] to bool in WriteAttribute methods
- Add type hints to find_timed_write_attribute method
- Access must_use_timed_write as class property directly
- Use wildcard read data instead of attribute_guard for better performance
* Restyled by autopep8
* Resolving linting error and removing some unneeded comments
* Apply suggestions from code review by Cecille
Applying suggested code changes from Cecille
Co-authored-by: C Freeman <[email protected]>
* Improve TC_IDM_3_2 and add type hint to Attribute.py's _prepare_write_attributes_data function:
TC_IDM_3_2.py changes:
- Exclude test cluster (kTest) from timed write attribute search
- Log warning instead of failing when no unsupported attributes found
- Enable step 4 suppressResponse test (accepts response or no response)
- Add note referencing Issue project-chip#41227 for future spec enforcement
- Remove unneeded return if not unsupported_cluster_ids
Attribute.py changes:
- Add return type hint to _prepare_write_attributes_data()
* Restyled by autopep8
* Improve timed write documentation and add missing edge case test scenario:
- Adds detailed docs explaining Timed Request ACTION vs TimedRequest FLAG relationship
- Documents why timed writes and chunking are incompatible in StartNewMessage()
- Adds test-only constructor for "action present, flag false" scenario (3rd edge case)
- Adds Python bindings and controller method for new test scenario
- Adds test case in TC_IDM_3_2.py step 7 for TIMED_REQUEST_MISMATCH validation
- Fixes find_timed_write_attribute() to properly handle kStandard and kTest cluster types
- Registers new binding function in Attribute.py Init()
* Restyled by whitespace
* Restyled by clang-format
* Restyled by autopep8
* Apply suggestions for timed request field value name change from Boris
Co-authored-by: Boris Zbarsky <[email protected]>
* Rename mForceTimedRequestFlag to mTimedRequestFieldValue and improve clarity:
- Rename mForceTimedRequestFlag to mTimedRequestFieldValue for clarity
- Update all documentation to use 'field' instead of 'flag' consistently
- Rename TestOnlyOverrideTimedRequestFlagTag to TestOnlyOverrideTimedRequestFieldTag
- Simplify member variable documentation to avoid redundant details
- Update parameter names in test constructors for consistency
* Removed SuppressResponse enablement from current python framework changes and fixed minor timed request issue caused during renaming
* Correcting test step 4 comment to provide issue link and more context
* Restyled by whitespace
* Restyled by clang-format
* Restyled by autopep8
* Remove leftover SuppressResponse reference and revert unintended file mode changes back to 644
* Consolidate redundant test-only Timed Request code per Boris's feedback:
- Remove redundant WriteClient constructor taking only bool parameter
- Merge pychip_WriteClient_TestOnlyWriteAttributesTimedRequestNoTimedAction
and pychip_WriteClient_TestOnlyWriteAttributesTimedActionNoTimedRequestFlag
into single pychip_WriteClient_TestOnlyWriteAttributesWithMismatchedTimedRequestField
- Update Python bindings and tests to use unified API
The single test function now takes both timedRequestTimeoutMs and timedRequestFieldValue parameters,
allowing callers to specify exactly what combination they need for each test scenario.
* Restyled by clang-format
* Restyled by autopep8
* Refactor attribute write helpers per code review from Cecille:
- Add parameter names to AttributeWriteRequest calls in ChipDeviceCtrl.py for clarity
- Update type hints to show union of 2-tuple and 3-tuple formats
- Refactor ProcessWriteAttributesData in attribute.cpp to accept forceLegacyListEncoding parameter, eliminating code duplication between legacy and normal encoding paths
* Resolving minor noticed change aftter merging master
* Restyled by clang-format
* Restyled by autopep8
* Resolving linting errors
* Restyled by autopep8
* Resolving mypy issues
* Restyled by autopep8
* Resolving further mypy issues in ChipDeviceCtrl python3 module
* attribute.cpp merge fix
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: C Freeman <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>1 parent 046531a commit 0ac3ca8
File tree
8 files changed
+707
-452
lines changed- src
- app
- tests/suites
- certification
- controller/python/matter
- clusters
- python_testing
8 files changed
+707
-452
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
142 | 188 | | |
143 | 189 | | |
144 | 190 | | |
| |||
525 | 571 | | |
526 | 572 | | |
527 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
528 | 583 | | |
529 | 584 | | |
530 | 585 | | |
| |||
0 commit comments