project-chip / certification-tool

A test harness and tooling designed to simplify development, testing, and certification for devices, guided by the Connectivity Standards Alliance.
https://csa-iot.org/
Apache License 2.0
36 stars 22 forks source link

[Feature] How to set test_parameters to pass TC-DA-1.7 #326

Open yf-fan-org opened 1 month ago

yf-fan-org commented 1 month ago

Feature description

To convey your test_parameters configuration and the issue you're facing in English, you might write:


Issue Description

I am encountering the following error in my test logs:

asserts.assert_equal(len(self.matter_test_config.discriminators), 1, "Only one device can be tested with SDK DAC")
TypeError: object of type 'NoneType' has no len()

Test Parameters

Here is the configuration for test_parameters that I am using:

{
  "bool-arg": "allow_sdk_dac:True",
  "discriminators": [
    3840
  ]
}

Request

Could you help me understand why self.matter_test_config.discriminators might be None, and how I can ensure it is properly populated with the values from test_parameters?


Use Cases

none

Test Cases

[MatterTest] 08-01 11:02:41.482 INFO [Test] test_TC_DA_1_7 [MatterTest] 08-01 11:02:41.488 ERROR Exception occurred in test_TC_DA_1_7. Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/mobly/base_test.py", line 783, in exec_one_test test_method() File "/root/python_testing/scripts/sdk/matter_testing_support.py", line 1547, in async_runner return asyncio.run(runner_with_timeout) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for return fut.result() File "/root/python_testing/scripts/sdk/TC_DA_1_7.py", line 117, in test_TC_DA_1_7 asserts.assert_equal(len(self.matter_test_config.discriminators), 1, "Only one device can be tested with SDK DAC") TypeError: object of type 'NoneType' has no len() [MatterTest] 08-01 11:02:41.498 INFO [Test] test_TC_DA_1_7 ERROR [MatterTest] 08-01 11:02:41.507 INFO Summary for test class TC_DA_1_7: Error 1, Executed 1, Failed 0, Passed 0, Requested 1, Skipped 0 [MatterTest] 08-01 11:02:41.510 INFO Summary for test run MatterTest@08-01-2024_11-02-41-363: Total time elapsed 0.09546623201458715s Artifacts are saved in "/tmp/matter_testing/logs/MatterTest/08-01-2024_11-02-41-363" Test summary saved in "/tmp/matter_testing/logs/MatterTest/08-01-2024_11-02-41-363/test_summary.yaml" Test results: Error 1, Executed 1, Failed 0, Passed 0, Requested 1, Skipped 0

Additional Information

none

yf-fan-org commented 1 month ago

@ccruzagralopes pls help

ccruzagralopes commented 1 month ago

@yf-fan-org Can you please send the full TH log and the full Project Config?

yf-fan-org commented 1 month ago

@ccruzagralopes ok DA-1-7_2024_08_01_18_07_50.log

config : { "config": { "test_parameters": { "int-arg": "use_pase_only:0", "manual_code": "34970112332" }, "network": { "wifi": { "ssid": "testharness", "password": "wifi-password" }, "thread": { "rcp_serial_path": "/dev/ttyACM0", "rcp_baudrate": 115200, "on_mesh_prefix": "fd11:22::/64", "network_interface": "eth0", "dataset": { "channel": "15", "panid": "0x1234", "extpanid": "1111111122222222", "networkkey": "00112233445566778899aabbccddeeff", "networkname": "DEMO" }, "otbr_docker_image": null } }, "dut_config": { "discriminator": "3840", "setup_code": "20202021", "pairing_mode": "onnetwork", "chip_timeout": null, "chip_use_paa_certs": false, "trace_log": true } }, "pics": { "clusters": { "Descriptor Cluster TestPlan": { "name": "Descriptor Cluster TestPlan", "items": { "DESC.S": { "number": "DESC.S", "enabled": true }, "DESC.S.A0000": { "number": "DESC.S.A0000", "enabled": true }, "DESC.S.A0001": { "number": "DESC.S.A0001", "enabled": true }, "DESC.S.A0002": { "number": "DESC.S.A0002", "enabled": true }, "DESC.S.A0003": { "number": "DESC.S.A0003", "enabled": true }, "DESC.S.A0004": { "number": "DESC.S.A0004", "enabled": false }, "DESC.S.F00": { "number": "DESC.S.F00", "enabled": false } } } } } }

ccruzagralopes commented 1 month ago

Thanks for the information!

It seems like the project config provided here is a bit different than what it was in the time of the test execution. The discriminator doesn't need to be on test_parameters, it should be provided in dut_config: discriminator. In the TH logs, it seems like the project config had discriminators: [3840, 3841] at the time of the test execution, and this test case verifies that only one discriminator is provided.

INFO       | 2024-08-01 11:01:37.999634 | Sending command to SDK container: python3 /root/python_testing/scripts/sdk/test_harness_client.py commission --trace-to json:log --discriminator 3840 --passcode 20202021 --commissioning-method on-network --bool-arg allow_sdk_dac:True --discriminators [3840, 3841]

I believe that if you remove discriminators from test_parameters, the test case should not have that issue anymore.