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

[CERT-TEST-FAILURE] -TC-SWTCH-2.2 - Test failed #28620

Closed
Survensa opened this issue Aug 10, 2023 · 1 comment · Fixed by #35291
Closed

[CERT-TEST-FAILURE] -TC-SWTCH-2.2 - Test failed #28620

Survensa opened this issue Aug 10, 2023 · 1 comment · Fixed by #35291
Assignees
Milestone

Comments

@Survensa
Copy link

Survensa commented Aug 10, 2023

Feature Area

Other

Test Case

TC-SWTCH-2.2

Reproduction steps

  1. Bring up the DUT (all-clusters-app).

  2. Pair the DUT using chip-tool through "onnetwork" transport.

  3. Read NumberOfPositions attribute : ./chip-tool switch read number-of-positions 1 1

[1686289367.443749][30133:30135] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0000 DataVersion: 2306185014
[1686289367.444066][30133:30135] CHIP:TOO:   NumberOfPositions: 2
  1. Change the switch to first position : echo '{"Name":"SwitchLatched","NewPosition":0}' > /tmp/chip_all_clusters_fifo_<PID> (PID of DUT)
[1686289860.323236][30125:30127] CHIP:-: Received payload: "{"Name":"SwitchLatched","NewPosition":0}"
[1686289860.323565][30125:30125] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to 89759737
[1686289860.323602][30125:30125] CHIP:-: The latching switch is moved to a new position:0
[1686289860.323618][30125:30125] CHIP:ZCL: SwitchServer: OnSwitchLatch
  1. Read CurrentPosition : ./chip-tool switch read current-position 1 1
[1646209289.746157][2617:2622] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001DataVersion: 1206711661
[1646209289.746228][2617:2622] CHIP:TOO:   CurrentPosition: 0
  1. Change the switch to second position : echo '{"Name":"SwitchLatched","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID> (PID of DUT)
[1659600080.279936][7312:7321] CHIP:-: Received payload: "{"Name":"SwitchLatched","NewPosition":1}"
[1659600080.280318][7312:7312] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to 1755409c
[1659600080.280376][7312:7312] CHIP:-: The latching switch is moved to a new position:1
[1659600080.280412][7312:7312] CHIP:ZCL: SwitchServer: OnSwitchLatch
  1. Read CurrentPosition : ./chip-tool switch read current-position 1 1
[1646209289.746157][2617:2622] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001DataVersion: 1206711661
[1646209289.746228][2617:2622] CHIP:TOO:  CurrentPosition: 1

As per SDK NumberOfPositions value is 2, it should not support more than 2 positions but currently in SDK its able change position up to 255

  1. Change the switch to greater than NumberOfPositions value(Value>2, Ex: 254) : echo '{"Name":"SwitchLatched","NewPosition":254}' > /tmp/chip_all_clusters_fifo_8057
[1691654274.324862][8057:8060] CHIP:-: Received payload: "{"Name":"SwitchLatched","NewPosition":254}"
[1691654274.325424][8057:8057] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to e39cff78
[1691654274.325516][8057:8057] CHIP:-: The latching switch is moved to a new position:254
[1691654274.325567][8057:8057] CHIP:ZCL: SwitchServer: OnSwitchLatch

9 Read CurrentPosition : ./chip-tool switch read current-position 1 1

[1691654896.228456][8330:8332] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001 DataVersion: 3818717048
[1691654896.228590][8330:8332] CHIP:TOO:   CurrentPosition: 254

Bug prevalence

Every Time

GitHub hash of the SDK that was being used

367a0c6

Platform

raspi

Anything else?

I believe that NumberOfPositions is the maximum position available in the device but the issue here is SDK is able to move the position beyond the NumberOfPositions limit with no error.

@tcarmelveilleux
Copy link
Contributor

This is an issue with the debugging trigger implementation, which is an artificial switch implementation. It's not a cert blocker per-se since a real switch would not operate via a direct setting if position value.

@yufengwangca could you please update the code to respect the limit in the cluster?

@woody-apple woody-apple modified the milestones: 1.2, Future Sep 19, 2023
tcarmelveilleux added a commit to tcarmelveilleux/connectedhomeip that referenced this issue Aug 29, 2024
- Fixes project-chip#34556 (-2.2, -2.3 and -2.4 to better match test plan)
- Fixes project-chip#28620 (Better bound checks)
- Fixes project-chip#35241
@github-project-automation github-project-automation bot moved this from Open Cert Blockers to Complete in [Certification] Blockers Sep 2, 2024
shgutte pushed a commit to shgutte/connectedhomeip that referenced this issue Sep 10, 2024
* Fix remaining post-TE2 TC-SWTCH issues

- Fixes project-chip#34556 (-2.2, -2.3 and -2.4 to better match test plan)
- Fixes project-chip#28620 (Better bound checks)
- Fixes project-chip#35241

* Restyled by clang-format

* Restyled by autopep8

* Restyled by isort

* Fix step 2 of TC-SWTCH--2.4

---------

Co-authored-by: Restyled.io <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants