Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Discrepancy between write-only attributes for returned attributes and AttributeList #505

Open
austina-csa opened this issue Dec 2, 2024 · 0 comments
Labels
Bug Something isn't working SDK

Comments

@austina-csa
Copy link

Describe the bug

When reading all clusters from all endpoints, when there is a write-only attribute on the device, there is a discrepancy between what is read and what shows up on AttributeList. Specifically, Clusters.UnitTesting.Attributes.WriteOnlyInt8u shows up on the former list but not the latter list.

How do I address this when testing? Ignore all write-only attributes when doing a comparison?

Steps to reproduce the behavior

Use code that looks similar to this to reproduce the issue:

The following code returns all clusters on all endpoints:

read_request = await self.default_controller.ReadAttribute(self.dut_node_id, [()])

When looping through the returned list of attributes like this, the first list contains Clusters.UnitTesting.Attributes.WriteOnlyInt8u, but the second list doesn't:

for endpoint in read_request:
    for cluster in read_request[endpoint]:
        returned_attrs = sorted([x.attribute_id for x in read_request[endpoint][cluster].keys() if x != Clusters.Attribute.DataVersion])
        attr_list = sorted(read_request[endpoint][cluster][cluster.Attributes.AttributeList])
        asserts.assert_equal(returned_attrs, attr_list, f"Mismatch for {cluster} at endpoint {endpoint}")

(The sorted function is there to make it easier to perform an assert statement later, to ensure that the lists try to match.)

Expected behavior

The expected behavior is there is a parity between both lists; i.e. either write-only attributes are present in the returned list and AttributeList, or neither of them are.

Log files

Write_only_log.txt

PICS file

No response

Screenshots

No response

Environment

Used:

  • Windows 11 with WSL2
  • Built linux-x64-all-clusters/chip-all-clusters-app
    Other test apps are untested.

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working SDK
Projects
None yet
Development

No branches or pull requests

2 participants