From 2686489efbf6f8d3f563e5f4665b13b236bf605a Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Thu, 2 Nov 2023 01:27:12 +0530 Subject: [PATCH] Newly semi/automated tests (#30090) TC-REFALM-2.1 TC-TCCM-3.2 TC-TCCM-3.3 Modified tests: TC-MOD-3.1 TC-MOD-3.2 TC-MOD-3.3 TC-RVCRUNM-3.1 --- .../templates/tests/ciTests.json | 3 + scripts/tests/chiptest/__init__.py | 2 + .../suites/certification/Test_TC_MOD_3_1.yaml | 24 +- .../suites/certification/Test_TC_MOD_3_2.yaml | 25 +- .../suites/certification/Test_TC_MOD_3_3.yaml | 2 +- .../certification/Test_TC_REFALM_2_1.yaml | 81 ++--- .../certification/Test_TC_RVCRUNM_3_1.yaml | 2 + .../certification/Test_TC_TCCM_3_2.yaml | 306 +++++++--------- .../certification/Test_TC_TCCM_3_3.yaml | 344 ++++++++---------- src/app/tests/suites/ciTests.json | 7 +- src/app/tests/suites/manualTests.json | 10 +- .../zap-generated/test/Commands.h | 197 ++++++++++ 12 files changed, 552 insertions(+), 451 deletions(-) diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 10c1d1a63d7142..fb15c5e8e92e37 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -54,6 +54,9 @@ "Disabled because darwin-framework-tool does not support EqualityCommands pseudo-cluster", "Test_TC_S_2_2", "Test_TC_TCCM_3_1", + "Test_TC_TCCM_3_2", + "Test_TC_TCCM_3_3", + "Test_TC_RVCRUNM_3_1", "Test_TC_TCTL_2_1", "Disabled because darwin-framework-tool does not support constraints arithmetic operations", "Test_TC_FLW_2_1", diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index b665402846255f..ba266f2bde9d70 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -188,6 +188,8 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_RVCRUNM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_RVCCLEANM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_TCCM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_TCCM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_TCCM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_TCTL_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster # chip-repl and chip-tool disagree on what the YAML here should look like: https://github.com/project-chip/connectedhomeip/issues/29110 "TestClusterMultiFabric.yaml", diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml index 9a30ae38134f45..f475ac57da0c16 100755 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_1.yaml @@ -31,7 +31,7 @@ config: defaultValue: 5000 tests: - - label: "Wait for the commissioned device to be retrieved" + - label: "Step 0:Wait for the commissioned device to be retrieved" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -39,14 +39,14 @@ tests: - name: "nodeId" value: nodeId - - label: "TH reads the OnMode attribute from the DUT" + - label: "Step 1: TH reads the OnMode attribute from the DUT" PICS: MOD.S.A0005 && MOD.S.F00 command: "readAttribute" attribute: "OnMode" response: saveAs: on_mode_dut - - label: "TH reads the CurrentMode attribute from the DUT" + - label: "Step 2a: TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 && MOD.S.F00 command: "readAttribute" attribute: "CurrentMode" @@ -54,8 +54,8 @@ tests: saveAs: old_current_mode_dut - label: - "If the OnMode and CurrentMode attributes have the same value, proceed - to step 2c, Otherwise proceed to step 3a" + "Step 2b: If the OnMode and CurrentMode attributes have the same + value, proceed to step 2c, Otherwise proceed to step 3a" PICS: MOD.S.A0003 && MOD.S.A0005 && MOD.S.F00 cluster: "EqualityCommands" command: "UnsignedNumberEquals" @@ -70,7 +70,7 @@ tests: - name: "Equals" saveAs: IsExpectedValue - - label: "TH reads the SupportedModes attribute from the DUT" + - label: "Step 2c: TH reads the SupportedModes attribute from the DUT" runIf: IsExpectedValue PICS: MOD.S.A0005 && MOD.S.F00 command: "readAttribute" @@ -80,9 +80,9 @@ tests: type: list - label: - "Select a value from the list in step 2c with a different value than - the onMode value read in step 1. TH sends a ChangeToMode command to - the TH with the selected value." + "Step 2d: Select a value from the list in step 2c with a different + value than the onMode value read in step 1. TH sends a ChangeToMode + command to the TH with the selected value." runIf: IsExpectedValue PICS: MOD.S.A0002 && MOD.S.C00.Rsp && MOD.S.F00 command: "ChangeToMode" @@ -91,12 +91,12 @@ tests: - name: "NewMode" value: NewMode - - label: "TH sends an Off command to the DUT" + - label: "Step 3a: TH sends an Off command to the DUT" PICS: OO.S.C00.Rsp && MOD.S.F00 cluster: "On/Off" command: "Off" - - label: "TH sends an On command to the DUT" + - label: "Step 3b: TH sends an On command to the DUT" PICS: OO.S.C01.Rsp && MOD.S.F00 cluster: "On/Off" command: "On" @@ -109,7 +109,7 @@ tests: - name: "ms" value: WaitTime - - label: "TH reads the CurrentMode attribute from the DUT" + - label: "Step 3c: TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 && MOD.S.F00 command: "readAttribute" attribute: "CurrentMode" diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml index 09e48c70836e4d..0490c2f22949b5 100755 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_2.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 80.5.2. [TC-MOD-3.2] StartUpMode verification with DUT as Server @@ -28,7 +27,7 @@ config: defaultValue: 7 tests: - - label: "Wait for the commissioned device to be retrieved" + - label: "Step 0: Wait for the commissioned device to be retrieved" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -36,14 +35,14 @@ tests: - name: "nodeId" value: nodeId - - label: "TH reads the StartUpMode attribute from the DUT" + - label: "Step 1: TH reads the StartUpMode attribute from the DUT" PICS: MOD.S.A0004 command: "readAttribute" attribute: "StartUpMode" response: saveAs: startup_mode_dut - - label: "TH reads the CurrentMode attribute from the DUT" + - label: "Step 2a: TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 command: "readAttribute" attribute: "CurrentMode" @@ -51,8 +50,8 @@ tests: saveAs: old_current_mode_dut - label: - "If startup_mode_dut is equal to old_current_mode_dut proceed to step - 4. Else proceed to step 6" + "Step 2b: If the StartUpMode and CurrentMode attributes have the same + value, proceed to step 2c, Otherwise proceed to step 3a." PICS: MOD.S.A0003 && MOD.S.A0004 cluster: "EqualityCommands" command: "UnsignedNumberEquals" @@ -67,7 +66,7 @@ tests: - name: "Equals" saveAs: IsExpectedValue - - label: "TH reads the SupportedModes attribute from the DUT" + - label: "Step 2c: TH reads the SupportedModes attribute from the DUT" runIf: IsExpectedValue PICS: MOD.S.A0002 command: "readAttribute" @@ -77,9 +76,9 @@ tests: type: list - label: - "Select a value from the list in step 2c with a different value than - the StartUpMode value read in step 1. TH sends a ChangeToMode command - to the DUT with the selected value." + "Step 2d: Select a value from the list in step 2c with a different + value than the StartUpMode value read in step 1. TH sends a + ChangeToMode command to the DUT with the selected value." runIf: IsExpectedValue PICS: MOD.S.A0002 && MOD.S.C00.Rsp command: "ChangeToMode" @@ -88,7 +87,7 @@ tests: - name: "NewMode" value: NewMode - - label: "Physically power cycle the device." + - label: "Step 3a: Physically power cycle the device." verification: | Physically power cycle the device. cluster: "LogCommands" @@ -101,7 +100,7 @@ tests: - name: "expectedValue" value: "y" - - label: "Commission device after reboot" + - label: "Wait for the commissioned device to be retrieved" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -109,7 +108,7 @@ tests: - name: "nodeId" value: nodeId - - label: "TH reads the CurrentMode attribute from the DUT" + - label: "Step 3b: TH reads the CurrentMode attribute from the DUT" PICS: MOD.S.A0003 && MOD.S.F00 && PICS_USER_PROMPT command: "readAttribute" attribute: "CurrentMode" diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml index 172635fbba8b72..dd0f76b778635d 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml @@ -127,7 +127,7 @@ tests: - name: "expectedValue" value: "y" - - label: "Commission device after reboot" + - label: "Wait for the commissioned device to be retrieved" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_REFALM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_REFALM_2_1.yaml index a133eb9a975531..c737c6c3d19926 100644 --- a/src/app/tests/suites/certification/Test_TC_REFALM_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_REFALM_2_1.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 222.2.1. [TC-REFALM-2.1] Attributes with DUT as Server @@ -20,62 +19,58 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Refrigerator Alarm" + endpoint: 1 tests: - - label: "Note" - verification: | - This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. - disabled: true - - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)" - verification: | - - disabled: true + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: Ensure that the door alarm is not locally suppressed and the door is closed" verification: | Ensure that the door alarm is not locally suppressed and the door is closed - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Step 3: TH reads from the DUT the Mask attribute" + - label: "Step 3:TH reads from the DUT the Mask attribute" PICS: REFALM.S.A0000 - verification: | - ./chip-tool refrigeratoralarm read mask 1 1 - On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 1. - [1688447677.832882][4229:4231] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0000 DataVersion: 1795162772 - [1688447677.833165][4229:4231] CHIP:TOO: Mask: 1 - [1688447677.833494][4229:4231] CHIP:EM: <<< [E:27636i S:5449 M:199797248 (Ack:151091416)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "Mask" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] - - label: "Step 4: TH reads from the DUT the State attribute" + - label: "Step 4:TH reads from the DUT the State attribute" PICS: REFALM.S.A0002 - verification: | - ./chip-tool refrigeratoralarm read state 1 1 - On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 0. - - [1688447820.603249][4247:4249] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0002 DataVersion: 1795162772 - [1688447820.603415][4247:4249] CHIP:TOO: State: 0 - [1688447820.603708][4247:4249] CHIP:EM: <<< [E:2198i S:4260 M:156565261 (Ack:46517349)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "State" + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] - - label: "Step 5: TH reads from the DUT the Supported attribute" + - label: "Step 5:TH reads from the DUT the Supportedask attribute" PICS: REFALM.S.A0003 - verification: | - ./chip-tool refrigeratoralarm read supported 1 1 - On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 1. - - [1689677642.708638][18413:18415] CHIP:DMG: SuppressResponse = true, - [1689677642.708645][18413:18415] CHIP:DMG: InteractionModelRevision = 1 - [1689677642.708651][18413:18415] CHIP:DMG: } - [1689677642.708726][18413:18415] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0003 DataVersion: 1517282962 - [1689677642.708773][18413:18415] CHIP:TOO: Supported: 1 - [1689677642.708845][18413:18415] CHIP:EM: <<< [E:32432i S:53289 M:29829407 (Ack:142651059)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689677642.708859][18413:18415] CHIP:IN: (S) Sending msg 29829407 on secure session with LSID: 53289 - [1689677642.708900][18413:18415] CHIP:EM: Flushed pending ack for MessageCounter:142651059 on exchange 32432i - disabled: true + command: "readAttribute" + attribute: "Supported" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml index 5bb88f11b6943d..d7d9bbd37f60df 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml @@ -17,6 +17,8 @@ name: 87.4.1. [TC-RVCRUNM-3.1] On Mode functionality with DUT as Server PICS: - RVCRUNM.S.A0003 - RVCRUNM.S.F00 + - OO.S.C00.Rsp + - OO.S.C01.Rsp config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml index 29786eb28374e6..fa0db91e224883 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 219.3.2. [TC-TCCM-3.2] Startup Mode functionality with DUT as Server @@ -20,195 +19,158 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Refrigerator And Temperature Controlled Cabinet Mode" + endpoint: 1 -tests: - - label: "Preconditions" - verification: | - !TCCM.S.F00(DEPONOFF) | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL - disabled: true - - - label: "NOTE" - verification: | - To Execute the TC-TCCM-3.2 test case using reboot in raspi device we followed the below suggested way: - - To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps - - step-1: create a file using touch command , something like touch mytest.txt - step-2: chmod 777 mytest.txt - step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt - - if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. - disabled: true + new_start_up_mode_th: + type: int8u + defaultValue: 0 + new_mode_th: + type: int8u + defaultValue: 1 +tests: - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads the StartUpMode attribute from the DUT" PICS: TCCM.S.A0002 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is an integer or Null - - Save the value as startup_mode_dut, below is the sample log provided for the raspi platform: - - If startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. - - Here startup_mode_dut is null proceed to step 3. + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut + constraints: + type: int8u - [1690541247.521286][2594:2596] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0002 DataVersion: 667171525 - [1690541247.523875][2594:2596] CHIP:TOO: StartUpMode: null - disabled: true - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." + - label: + "If startup_mode_dut is null proceed to step 3. Else save + startup_mode_dut as new_start_up_mode_th and proceed to step 5" + PICS: TCCM.S.A0002 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: null + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "Step 3: TH reads the SupportedModes attribute from the DUT" + runIf: IsExpectedValue PICS: TCCM.S.A0000 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: - - [1690190590.967854][16509:16511] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0000 DataVersion: 899063585 - [1690190590.967878][16509:16511] CHIP:TOO: SupportedModes: 3 entries - [1690190590.967889][16509:16511] CHIP:TOO: [1]: { - [1690190590.967892][16509:16511] CHIP:TOO: Label: Normal - [1690190590.967895][16509:16511] CHIP:TOO: Mode: 0 - [1690190590.967899][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967904][16509:16511] CHIP:TOO: [1]: { - [1690190590.967907][16509:16511] CHIP:TOO: Value: 0 - [1690190590.967910][16509:16511] CHIP:TOO: } - [1690190590.967913][16509:16511] CHIP:TOO: } - [1690190590.967918][16509:16511] CHIP:TOO: [2]: { - [1690190590.967920][16509:16511] CHIP:TOO: Label: Rapid Cool - [1690190590.967923][16509:16511] CHIP:TOO: Mode: 1 - [1690190590.967926][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967929][16509:16511] CHIP:TOO: [1]: { - [1690190590.967932][16509:16511] CHIP:TOO: Value: 16384 - [1690190590.967934][16509:16511] CHIP:TOO: } - [1690190590.967937][16509:16511] CHIP:TOO: } - [1690190590.967942][16509:16511] CHIP:TOO: [3]: { - [1690190590.967944][16509:16511] CHIP:TOO: Label: Rapid Freeze - [1690190590.967946][16509:16511] CHIP:TOO: Mode: 2 - [1690190590.967950][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967953][16509:16511] CHIP:TOO: [1]: { - [1690190590.967956][16509:16511] CHIP:TOO: Value: 16385 - [1690190590.967958][16509:16511] CHIP:TOO: } - [1690190590.967961][16509:16511] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: supported_modes_dut + constraints: + type: list + minLength: 2 - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the + "Step 4:TH writes to the DUT the StartUpMode attribute with the new_start_up_mode_th value" + runIf: IsExpectedValue PICS: TCCM.S.A0002 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode write start-up-mode 0 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690190139.816096][16383:16385] CHIP:DMG: StatusIB = - [1690190139.816100][16383:16385] CHIP:DMG: { - [1690190139.816102][16383:16385] CHIP:DMG: status = 0x00 (SUCCESS), - [1690190139.816105][16383:16385] CHIP:DMG: }, - disabled: true + command: "writeAttribute" + attribute: "StartUpMode" + arguments: + value: new_start_up_mode_th - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." + - label: "Step 5: TH reads the CurrentMode attribute from the DUT" PICS: TCCM.S.A0001 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer - - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform: - - NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 6. Else proceed to step 8 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u - [1690190562.418843][16505:16507] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0001 DataVersion: 899063585 - [1690190562.418907][16505:16507] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." + - label: + "If startup_mode_dut is equal to old_current_mode_dut proceed to step + 6. Else proceed to step 8" + PICS: TCCM.S.A0002 && TCCM.S.A0001 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: Step5_IsExpectedValue + + - label: "Step 6: TH reads the SupportedModes attribute from the DUT" + runIf: Step5_IsExpectedValue PICS: TCCM.S.A0000 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690190590.967854][16509:16511] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0000 DataVersion: 899063585 - [1690190590.967878][16509:16511] CHIP:TOO: SupportedModes: 3 entries - [1690190590.967889][16509:16511] CHIP:TOO: [1]: { - [1690190590.967892][16509:16511] CHIP:TOO: Label: Normal - [1690190590.967895][16509:16511] CHIP:TOO: Mode: 0 - [1690190590.967899][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967904][16509:16511] CHIP:TOO: [1]: { - [1690190590.967907][16509:16511] CHIP:TOO: Value: 0 - [1690190590.967910][16509:16511] CHIP:TOO: } - [1690190590.967913][16509:16511] CHIP:TOO: } - [1690190590.967918][16509:16511] CHIP:TOO: [2]: { - [1690190590.967920][16509:16511] CHIP:TOO: Label: Rapid Cool - [1690190590.967923][16509:16511] CHIP:TOO: Mode: 1 - [1690190590.967926][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967929][16509:16511] CHIP:TOO: [1]: { - [1690190590.967932][16509:16511] CHIP:TOO: Value: 16384 - [1690190590.967934][16509:16511] CHIP:TOO: } - [1690190590.967937][16509:16511] CHIP:TOO: } - [1690190590.967942][16509:16511] CHIP:TOO: [3]: { - [1690190590.967944][16509:16511] CHIP:TOO: Label: Rapid Freeze - [1690190590.967946][16509:16511] CHIP:TOO: Mode: 2 - [1690190590.967950][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967953][16509:16511] CHIP:TOO: [1]: { - [1690190590.967956][16509:16511] CHIP:TOO: Value: 16385 - [1690190590.967958][16509:16511] CHIP:TOO: } - [1690190590.967961][16509:16511] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: Step6_supported_modes_dut + constraints: + type: list + minLength: 2 - label: "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th" - PICS: TCCM.S.C00.Rsp - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode change-to-mode 2 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690190614.263418][16516:16518] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Command 0x0000_0001 - [1690190614.263432][16516:16518] CHIP:TOO: ChangeToModeResponse: { - [1690190614.263438][16516:16518] CHIP:TOO: status: 0 - [1690190614.263441][16516:16518] CHIP:TOO: } - disabled: true - - - label: "Step 8: Physically power cycle the device" + runIf: Step5_IsExpectedValue + PICS: DISHM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + + - label: "Step 8: Physically power cycle the device." verification: | - Physically power cycle the device - disabled: true - - - label: "Step 9: TH reads from the DUT the StartUpMode attribute." - PICS: TCCM.S.A0002 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is an integer - - Save the value as new_start_up_mode_dut - - The value is equal to new_start_up_mode_th and below is the sample log provided for the raspi platform, Here StartUpMode value is 0 - - [1690541859.062480][2695:2697] CHIP:DMG: } - [1690541859.062677][2695:2697] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0002 DataVersion: 1628543926 - [1690541859.062764][2695:2697] CHIP:TOO: StartUpMode: 0 - disabled: true - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: TCCM.S.A0001 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and equal to new_start_up_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690190646.897310][16529:16531] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0001 DataVersion: 3922115677 - [1690190646.897357][16529:16531] CHIP:TOO: CurrentMode: 0 - disabled: true + Physically power cycle the device. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 9: TH reads the StartUpMode attribute from the DUT" + PICS: TCCM.S.A0002 && PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: new_start_up_mode_dut + constraints: + type: int8u + anyOf: [new_start_up_mode_th, startup_mode_dut] + + - label: "Step 10: TH reads the CurrentMode attribute from the DUT" + PICS: TCCM.S.A0001 && PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "CurrentMode" + response: + value: new_start_up_mode_dut + constraints: + type: int8u diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml index 5be0c6eba7b28d..f6f3eb978c5b0f 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 219.3.3. [TC-TCCM-3.3] On Mode and Startup Mode functionality with DUT as @@ -21,229 +20,174 @@ PICS: - TCCM.S.A0002 - TCCM.S.A0003 - TCCM.S.F00 + - OO.S.A4003 config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Refrigerator And Temperature Controlled Cabinet Mode" + endpoint: 1 -tests: - - label: "Note" - verification: | - To Execute the TC-TCC-3.3 test case using reboot in raspi device we followed the below suggested way: - - To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps + new_start_up_mode_th: + type: int8u + defaultValue: 0 + new_mode_th: + type: int8u + defaultValue: 1 - step-1: create a file using touch command , something like touch mytest.txt - step-2: chmod 777 mytest.txt - step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt - - if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. - disabled: true +tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads the StartUpMode attribute from the DUT" + PICS: TCCM.S.A0002 + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut + constraints: + type: int8u - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + "If startup_mode_dut is null proceed to step 3. Else save + startup_mode_dut as new_start_up_mode_th and proceed to step 5" PICS: TCCM.S.A0002 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is an integer or Null - - Save the value as startup_mode_dut, below is the sample log provided for the raspi platform: - - If startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. - - Here startup_mode_dut is null proceed to step 3. - - [1690541247.515223][2594:2596] CHIP:DMG: } - [1690541247.521286][2594:2596] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0002 DataVersion: 667171525 - [1690541247.523875][2594:2596] CHIP:TOO: StartUpMode: null - disabled: true - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: null + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "Step 3: TH reads the SupportedModes attribute from the DUT" + runIf: IsExpectedValue PICS: TCCM.S.A0000 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: - - [1690190590.967854][16509:16511] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0000 DataVersion: 899063585 - [1690190590.967878][16509:16511] CHIP:TOO: SupportedModes: 3 entries - [1690190590.967889][16509:16511] CHIP:TOO: [1]: { - [1690190590.967892][16509:16511] CHIP:TOO: Label: Normal - [1690190590.967895][16509:16511] CHIP:TOO: Mode: 0 - [1690190590.967899][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967904][16509:16511] CHIP:TOO: [1]: { - [1690190590.967907][16509:16511] CHIP:TOO: Value: 0 - [1690190590.967910][16509:16511] CHIP:TOO: } - [1690190590.967913][16509:16511] CHIP:TOO: } - [1690190590.967918][16509:16511] CHIP:TOO: [2]: { - [1690190590.967920][16509:16511] CHIP:TOO: Label: Rapid Cool - [1690190590.967923][16509:16511] CHIP:TOO: Mode: 1 - [1690190590.967926][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967929][16509:16511] CHIP:TOO: [1]: { - [1690190590.967932][16509:16511] CHIP:TOO: Value: 16384 - [1690190590.967934][16509:16511] CHIP:TOO: } - [1690190590.967937][16509:16511] CHIP:TOO: } - [1690190590.967942][16509:16511] CHIP:TOO: [3]: { - [1690190590.967944][16509:16511] CHIP:TOO: Label: Rapid Freeze - [1690190590.967946][16509:16511] CHIP:TOO: Mode: 2 - [1690190590.967950][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967953][16509:16511] CHIP:TOO: [1]: { - [1690190590.967956][16509:16511] CHIP:TOO: Value: 16385 - [1690190590.967958][16509:16511] CHIP:TOO: } - [1690190590.967961][16509:16511] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: supported_modes_dut + constraints: + type: list + minLength: 2 - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the + "Step 4:TH writes to the DUT the StartUpMode attribute with the new_start_up_mode_th value" + runIf: IsExpectedValue PICS: TCCM.S.A0002 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode write start-up-mode 0 1 1 + command: "writeAttribute" + attribute: "StartUpMode" + arguments: + value: new_start_up_mode_th - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690190139.816096][16383:16385] CHIP:DMG: StatusIB = - [1690190139.816100][16383:16385] CHIP:DMG: { - [1690190139.816102][16383:16385] CHIP:DMG: status = 0x00 (SUCCESS), - [1690190139.816105][16383:16385] CHIP:DMG: }, - disabled: true - - - label: "Step 5: TH reads from the DUT the OnMode attribute." + - label: "Step 5: TH reads the OnMode attribute from the DUT" PICS: TCCM.S.A0003 && TCCM.S.A0002 - verification: | - As default value of OnMode attribute is NULL. Set the OnMode to any mode value listed in the SupportedModes entries. - - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode write on-mode 0 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690190824.443367][16580:16582] CHIP:DMG: StatusIB = - [1690190824.443379][16580:16582] CHIP:DMG: { - [1690190824.443391][16580:16582] CHIP:DMG: status = 0x00 (SUCCESS), - [1690190824.443402][16580:16582] CHIP:DMG: }, - - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer - - Save the value as old_on_mode_dut, below is the sample log provided for the raspi platform, here OnMode attribute value is 0 + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: old_on_mode_dut + constraints: + type: int8u - [1690190846.367481][16585:16587] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0003 DataVersion: 978521150 - [1690190846.367522][16585:16587] CHIP:TOO: OnMode: 0 - - If startup_mode_dut is equal to old_on_mode_dut proceed to step 6. Else proceed to step 8. - disabled: true - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." + - label: + "If startup_mode_dut is equal to old_on_mode_dut proceed to step 6. + Else proceed to step 8." + PICS: TCCM.S.A0003 && TCCM.S.A0002 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: old_on_mode_dut + response: + - values: + - name: "Equals" + saveAs: Step5_IsExpectedValue + + - label: "Step 6: TH reads the SupportedModes attribute from the DUT" + runIf: Step5_IsExpectedValue PICS: TCCM.S.A0000 && TCCM.S.A0002 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690190590.967854][16509:16511] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0000 DataVersion: 899063585 - [1690190590.967878][16509:16511] CHIP:TOO: SupportedModes: 3 entries - [1690190590.967889][16509:16511] CHIP:TOO: [1]: { - [1690190590.967892][16509:16511] CHIP:TOO: Label: Normal - [1690190590.967895][16509:16511] CHIP:TOO: Mode: 0 - [1690190590.967899][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967904][16509:16511] CHIP:TOO: [1]: { - [1690190590.967907][16509:16511] CHIP:TOO: Value: 0 - [1690190590.967910][16509:16511] CHIP:TOO: } - [1690190590.967913][16509:16511] CHIP:TOO: } - [1690190590.967918][16509:16511] CHIP:TOO: [2]: { - [1690190590.967920][16509:16511] CHIP:TOO: Label: Rapid Cool - [1690190590.967923][16509:16511] CHIP:TOO: Mode: 1 - [1690190590.967926][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967929][16509:16511] CHIP:TOO: [1]: { - [1690190590.967932][16509:16511] CHIP:TOO: Value: 16384 - [1690190590.967934][16509:16511] CHIP:TOO: } - [1690190590.967937][16509:16511] CHIP:TOO: } - [1690190590.967942][16509:16511] CHIP:TOO: [3]: { - [1690190590.967944][16509:16511] CHIP:TOO: Label: Rapid Freeze - [1690190590.967946][16509:16511] CHIP:TOO: Mode: 2 - [1690190590.967950][16509:16511] CHIP:TOO: ModeTags: 1 entries - [1690190590.967953][16509:16511] CHIP:TOO: [1]: { - [1690190590.967956][16509:16511] CHIP:TOO: Value: 16385 - [1690190590.967958][16509:16511] CHIP:TOO: } - [1690190590.967961][16509:16511] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: step6_supported_modes_dut + constraints: + type: list + minLength: 2 - label: - "Step 7: TH writes to the DUT the OnMode attribute with the - new_mode_th value" + "Step 7:TH writes to the DUT the OnMode attribute with the new_mode_th + value" + runIf: Step5_IsExpectedValue PICS: TCCM.S.A0003 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode write on-mode 1 1 1 + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: new_mode_th - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690190905.134866][16594:16596] CHIP:DMG: StatusIB = - [1690190905.134869][16594:16596] CHIP:DMG: { - [1690190905.134873][16594:16596] CHIP:DMG: status = 0x00 (SUCCESS), - [1690190905.134876][16594:16596] CHIP:DMG: }, - disabled: true - - - label: "Step 8: TH reads from the DUT the OnMode attribute." + - label: "Step 8: TH reads the OnMode attribute from the DUT" PICS: TCCM.S.A0003 && TCCM.S.F00 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer - - Save the value as new_on_mode_dut and value is equal to new_mode_th, below is the sample log provided for the raspi platform, here OnMode attribute value is 1 - - [1690190846.367481][16585:16587] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0003 DataVersion: 978521150 - [1690190846.367522][16585:16587] CHIP:TOO: OnMode: 1 - disabled: true + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: new_on_mode_dut + constraints: + anyOf: [new_mode_th, old_on_mode_dut] - label: - "Step 9: TH writes to the DUT the StartUpOnOff attribute with the - value 1." + "Step 9:TH writes to the DUT the StartUpOnOff attribute with the value + 1" PICS: OO.S.A4003 - verification: | - ./chip-tool onoff write start-up-on-off 1 1 1 + cluster: "On/Off" + command: "writeAttribute" + attribute: "StartUpOnOff" + arguments: + value: 1 - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690180270.884152][14228:14230] CHIP:DMG: { - [1690180270.884156][14228:14230] CHIP:DMG: status = 0x00 (SUCCESS), - [1690180270.884158][14228:14230] CHIP:DMG: }, - disabled: true - - - label: "Step 10: Physically power cycle the device" - verification: | - Physically power cycle the device - disabled: true - - - label: "Step 11: TH reads from the DUT the StartUpMode attribute." - PICS: TCCM.S.A0002 + - label: "Step 10: Physically power cycle the device." verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is an integer value is equal to new_start_up_mode_th, below is the sample log provided for the raspi platform , here StartUpMode is 0 - - [1690541247.515223][2594:2596] CHIP:DMG: } - [1690541247.521286][2594:2596] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0002 DataVersion: 667171525 - [1690541247.523875][2594:2596] CHIP:TOO: StartUpMode: 0 - disabled: true - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: TCCM.S.A0001 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and equal to new_on_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 1 - - [1690190945.261971][16605:16607] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0001 DataVersion: 4180211608 - [1690190945.261982][16605:16607] CHIP:TOO: CurrentMode: 1 - disabled: true + Physically power cycle the device. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 11: TH reads the StartUpMode attribute from the DUT" + PICS: TCCM.S.A0002 && PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "StartUpMode" + response: + constraints: + anyOf: [new_start_up_mode_th, startup_mode_dut] + + - label: "Step 12: TH reads the CurrentMode attribute from the DUT" + PICS: TCCM.S.A0001 && PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "CurrentMode" + response: + value: new_on_mode_dut diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index d17ace003fefcb..50a0b726d5db9c 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -179,11 +179,12 @@ "Test_TC_PCC_2_4" ], "PowerSourceConfiguration": ["Test_TC_PSCFG_1_1", "Test_TC_PSCFG_2_1"], - "RefrigeratorAlarm": ["Test_TC_REFALM_1_1"], + "RefrigeratorAlarm": ["Test_TC_REFALM_1_1", "Test_TC_REFALM_2_1"], "RelativeHumidityMeasurement": ["Test_TC_RH_1_1", "Test_TC_RH_2_1"], "RoboticVacuumCleaner": [ "Test_TC_RVCCLEANM_1_1", "Test_TC_RVCRUNM_1_1", + "Test_TC_RVCRUNM_3_1", "Test_TC_RVCOPSTATE_1_1" ], "SecureChannel": [], @@ -199,7 +200,9 @@ "Switch": ["Test_TC_SWTCH_1_1", "Test_TC_SWTCH_2_1"], "TemperatureControlledCabinetMode": [ "Test_TC_TCCM_1_1", - "Test_TC_TCCM_3_1" + "Test_TC_TCCM_3_1", + "Test_TC_TCCM_3_2", + "Test_TC_TCCM_3_3" ], "TemperatureControl": [ "Test_TC_TCTL_1_1", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index a26fe6737a29c0..74e1d33ba99fdd 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -267,19 +267,13 @@ "OperationalState": ["Test_TC_OPSTATE_2_2"], "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], "SmokeCOAlarm": [], - "RefrigeratorAlarm": [ - "Test_TC_REFALM_2_1", - "Test_TC_REFALM_2_2", - "Test_TC_REFALM_2_3" - ], + "RefrigeratorAlarm": ["Test_TC_REFALM_2_2", "Test_TC_REFALM_2_3"], "RVCCleanMode": ["Test_TC_RVCCLEANM_3_3"], "RVCOperationalState": ["Test_TC_RVCOPSTATE_2_2"], "RVCRunMode": ["Test_TC_RVCRUNM_3_3"], "TemperatureControlledCabinetMode": [ "Test_TC_TCCM_1_2", - "Test_TC_TCCM_2_1", - "Test_TC_TCCM_3_2", - "Test_TC_TCCM_3_3" + "Test_TC_TCCM_2_1" ], "Switch": ["Test_TC_SWTCH_2_2", "Test_TC_SWTCH_3_2"], "TemperatureControl": ["Test_TC_TCTL_3_2", "Test_TC_TCTL_3_3"], diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index e58522377c8b60..57500767f79d90 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -195,6 +195,7 @@ class TestList : public Command { printf("Test_TC_PCC_2_3\n"); printf("Test_TC_PCC_2_4\n"); printf("Test_TC_REFALM_1_1\n"); + printf("Test_TC_REFALM_2_1\n"); printf("Test_TC_RH_1_1\n"); printf("Test_TC_RVCCLEANM_1_1\n"); printf("Test_TC_RVCRUNM_1_1\n"); @@ -88432,6 +88433,201 @@ class Test_TC_REFALM_1_1 : public TestCommandBridge { } }; +class Test_TC_REFALM_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_REFALM_2_1() + : TestCommandBridge("Test_TC_REFALM_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_REFALM_2_1() + { + } + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_REFALM_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_REFALM_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Commission DUT to TH (can be skipped if done in a preceding test)\n"); + err = TestStep1CommissionDutToThCanBeSkippedIfDoneInAPrecedingTest_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: Ensure that the door alarm is not locally suppressed and the door is closed\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep2EnsureThatTheDoorAlarmIsNotLocallySuppressedAndTheDoorIsClosed_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3:TH reads from the DUT the Mask attribute\n"); + if (ShouldSkip("REFALM.S.A0000")) { + NextTest(); + return; + } + err = TestStep3thReadsFromTheDutTheMaskAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4:TH reads from the DUT the State attribute\n"); + if (ShouldSkip("REFALM.S.A0002")) { + NextTest(); + return; + } + err = TestStep4thReadsFromTheDutTheStateAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 5:TH reads from the DUT the Supportedask attribute\n"); + if (ShouldSkip("REFALM.S.A0003")) { + NextTest(); + return; + } + err = TestStep5thReadsFromTheDutTheSupportedaskAttribute_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1CommissionDutToThCanBeSkippedIfDoneInAPrecedingTest_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2EnsureThatTheDoorAlarmIsNotLocallySuppressedAndTheDoorIsClosed_1() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep3thReadsFromTheDutTheMaskAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3:TH reads from the DUT the Mask attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("mask", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4thReadsFromTheDutTheStateAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4:TH reads from the DUT the State attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("state", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5thReadsFromTheDutTheSupportedaskAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRefrigeratorAlarm alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5:TH reads from the DUT the Supportedask attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("supported", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_RH_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -175570,6 +175766,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),