Add pytest to CI Fix CI
2.2 KiB
Test Optional Attributes Suite
This directory contains test scripts to verify the presence and readability of optional attributes in various Matter clusters which are migrated to be code driven.
Prerequisites
- Environment: You need to be in a Matter build environment (e.g.,
connectedhomeipSDK environment) where the python controller and testing libraries are built and available.# Example setup in connectedhomeip source ./scripts/activate.sh - Device: A Matter device must be commissioned and reachable.
Usage
-
Build the Example App:
The example application with all clusters enabled is located at
examples/test_apps/test_optional_attributes.cd examples/test_apps/test_optional_attributes idf.py build idf.py flash monitor -
Build Python Environment:
The test requires the Matter Python controller and test framework. You can build the environment using the installation script:
./install.sh --build-pythonThis will create a virtual python environment at
connectedhomeip/connectedhomeip/out/py_env. -
Run the Test:
Activate the Python environment and run the test. Below is an example command for BLE-WiFi commissioning:
source connectedhomeip/connectedhomeip/out/py_env/bin/activate python3 tools/test_optional_attributes/test_optional_attributes_framework.py \ -n 1 \ --commissioning-method ble-wifi \ --wifi-ssid <WIFI_SSID> \ --wifi-passphrase <WIFI_PASSWORD> \ --passcode 20202021 \ --discriminator 3840 \ --paa-trust-store-path connectedhomeip/connectedhomeip/credentials/development/paa-root-certsNote: Adjust passcode/discriminator as per your device configuration (default for
test_optional_attributesis usually20202021/3840).
Tested Clusters
The scripts check for optional attributes in:
- Basic Information
- Boolean State Configuration
- Descriptor
- Electrical Energy Measurement
- Electrical Power Measurement
- Ethernet Network Diagnostics
- General Diagnostics
- Occupancy Sensing
- Resource Monitoring
- Software Diagnostics
- Time Synchronization
- WiFi Network Diagnostics