project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.48k stars 2.01k forks source link

[ACL-2.3] Error while encoding attribute-values[0].data as a hex string for D_BAD_NONE: "" which is an octstr of length 0 #24409

Open Survensa opened 1 year ago

Survensa commented 1 year ago

Reproduction steps

In test case "TC-ACL-2.3 Extension attribute" as per test plan step 16 when TH writes DUT Endpoint 0 AccessControl cluster Extension attribute with AccessControlExtensionStruct containing none element response status should be 0x87 (CONSTRAINT_ERROR) but on V1.0.01 & V1.0.0.2 commit TH is not able to encode NONE attribute-value

Struct used : D_BAD_NONE: "" which is an octstr of length 0

Command used : ./chip-tool accesscontrol write extension '[{"data":""}]' 1 0

Expected Outcome :

[1657609694.046042][8236:8241] CHIP:DMG: [1657609694.046078][8236:8241] CHIP:DMG: StatusIB = [1657609694.046115][8236:8241] CHIP:DMG: { [1657609694.046154][8236:8241] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), [1657609694.046192][8236:8241] CHIP:DMG: },

Actual Outcome :

[1673601099.394649][21869:21869] CHIP:TOO: Error while encoding attribute-values[0].data as a hex string. Usage: ./chip-tool accesscontrol write attribute-name attribute-values destination-id endpoint-id-ignored-for-group-commands [--paa-trust-store-path] [--cd-trust-store-path] [--commissioner-name] [--commissioner-nodeid] [--use-max-sized-certs] [--only-allow-trusted-cd-keys] [--trace_file] [--trace_log] [--trace_decode] [--ble-adapter] [--timedInteractionTimeoutMs] [--data-version] [--suppressResponse] [--repeat-count] [--repeat-delay-ms] [--timeout]

Bug prevalence

Issue occurs only in V1.0.0.1 and V1.0.0.2 but not in latest master.

GitHub hash of the SDK that was being used

Platform : Raspi

Platform Version(s) : RPI 4, 8GB

Execution log :

bzbarsky-apple commented 1 year ago

Issue occurs only in V1.0.0.1 and V1.0.0.2 but not in latest master.

Presumably fixed by https://github.com/project-chip/connectedhomeip/pull/24097

lisaaaas commented 1 year ago

I have met the same problem. May I ask what type it will be changed to?

bzbarsky-apple commented 1 year ago

@lisaaaas I'm not sure what you are asking. What makes you think the type of anything will be changing?

lisaaaas commented 1 year ago

@lisaaaas I'm not sure what you are asking. What makes you think the type of anything will be changing?

What I mean is that the execution of instruction ./chip-tool accesscontrol write extension '[{"data":""}]' 1 0 is wrong. Is there any relevant modification of this command?

bzbarsky-apple commented 1 year ago

What I mean is that the execution of instruction ./chip-tool accesscontrol write extension '[{"data":""}]' 1 0 is wrong.

Wrong in what sense? The expected behavior of that instruction is:

  1. A write is sent to the server with an empty octet string for the data.
  2. The server responds with CONSTRAINT_ERROR (because empty string is not a valid extension value).

This issue was about step 1 not happening correctly.

What behavior are you seeing @lisaaaas and what behavior are you expecting to see instead and why?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.