From 6aefe30a9644cc62679d01faa4de1ebc63c94cc5 Mon Sep 17 00:00:00 2001 From: beckerzito Date: Sat, 20 Jan 2024 01:25:48 -0300 Subject: [PATCH] Add oven mode yaml (#31547) * Oven mode yaml scripts and updated ciTests.json file * format checked * Restyled by whitespace * Restyled by prettier-json * Restyled by prettier-yaml * Updated ciTests.json * added and modified the files * Delete src/app/tests/suites/certification/Test_TC_OM_1_1.yml * Delete src/app/tests/suites/certification/Test_TC_OM_1_2.yml * Delete src/app/tests/suites/certification/Test_TC_OM_2_1.yml * Delete src/app/tests/suites/certification/Test_TC_OM_3_1.yml * Delete src/app/tests/suites/certification/Test_TC_OM_3_2.yml * Delete src/app/tests/suites/certification/Test_TC_OM_3_3.yml * Restyled by whitespace * Restyled by prettier-json * Restyled by prettier-yaml * Restyled by autopep8 * Update src/app/tests/suites/certification/Test_TC_OM_1_1.yaml Co-authored-by: C Freeman * Update src/app/tests/suites/certification/Test_TC_OM_2_1.yaml Co-authored-by: C Freeman * upadted based on the comments from Cecille * updated TC_2_1 * Restyled by whitespace * Restyled by prettier-yaml * updated the files based on correct PICS code * Restyled by whitespace * Restyled by prettier-json * Restyled by prettier-yaml * Delete src/app/tests/suites/certification/Test_TC_OM_1_1.yaml * Delete src/app/tests/suites/certification/Test_TC_OM_2_1.yaml * Delete src/app/tests/suites/certification/Test_TC_OM_3_1.yaml * Delete src/app/tests/suites/certification/Test_TC_OM_3_2.yaml * Delete src/app/tests/suites/certification/Test_TC_OM_3_3.yaml * Delete src/app/tests/suites/certification/Test_TC_OM_1_2.yaml Deleting coz new 1_2 has been created * updated Test_TC_OTCCM_2_1.yaml * updated test scripts and PICS values * Restyled by whitespace * updating init.py * updated PICS.yaml * updated init.py * updated init.py * Restyled by whitespace * updated files and ran zap_regen * Restyled by whitespace * Restyled by prettier-json * Restyled by prettier-yaml * Restyled by autopep8 * updated ci-pics-values * updated __init__.py * commented 4b 4c in TC_1_1 and ran zap * updated 1_1 * Restyled by prettier-yaml * updated manualtest.json and ran zapregen * Restyled by prettier-json * Restyled by prettier-yaml * updated ci-pics-values * updated pics-value file * upidated ci-pics-values * Fixes for test cases * Restyled by prettier-yaml --------- Co-authored-by: Prakash Ravi Co-authored-by: Restyled.io Co-authored-by: Prakash Ravi <68609205+prakashece@users.noreply.github.com> Co-authored-by: C Freeman --- .../all-clusters-app.matter | 3 + .../all-clusters-common/all-clusters-app.zap | 18 + .../templates/tests/ciTests.json | 4 + scripts/tests/chiptest/__init__.py | 3 + src/app/tests/suites/certification/PICS.yaml | 57 +++ .../certification/Test_TC_OTCCM_1_1.yaml | 151 ++++--- .../certification/Test_TC_OTCCM_1_2.yaml | 110 ++--- .../certification/Test_TC_OTCCM_2_1.yaml | 218 +++++++++ .../certification/Test_TC_OTCCM_3_1.yaml | 130 ++++++ .../certification/Test_TC_OTCCM_3_2.yaml | 171 +++++++ .../certification/Test_TC_OTCCM_3_3.yaml | 187 ++++++++ .../tests/suites/certification/ci-pics-values | 20 + src/app/tests/suites/ciTests.json | 9 +- src/app/tests/suites/manualTests.json | 2 + .../python/chip/clusters/__init__.py | 4 +- .../zap-generated/test/Commands.h | 426 ++++++++++++++++++ 16 files changed, 1368 insertions(+), 145 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_OTCCM_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OTCCM_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OTCCM_3_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OTCCM_3_3.yaml diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index c2924b07468b28..d2e33e86376e59 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -7707,6 +7707,9 @@ endpoint 1 { callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; + + handle command ChangeToMode; + handle command ChangeToModeResponse; } server cluster LaundryDryerControls { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 167a75e838fc42..7206a9da14d7aa 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -8603,6 +8603,24 @@ "side": "server", "enabled": 1, "apiMaturity": "provisional", + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], "attributes": [ { "name": "SupportedModes", diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index a9c54d4bb43193..66886c7d769ff5 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -63,6 +63,10 @@ "Test_TC_LWM_3_1", "Test_TC_LWM_3_2", "Test_TC_LWM_3_3", + "Test_TC_OTCCM_2_1", + "Test_TC_OTCCM_3_1", + "Test_TC_OTCCM_3_2", + "Test_TC_OTCCM_3_3", "Disabled because darwin-framework-tool does not support constraints arithmetic operations", "Test_TC_FLW_2_1", "Test_TC_RH_2_1", diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 1adf7de8efe3d8..ad2cc6a4782df0 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -187,6 +187,9 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_LWM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_LWM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_LWM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_OTCCM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_OTCCM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_OTCCM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_G_2_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "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 diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 2affde1181c68c..af29b4df7a37b9 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -9037,6 +9037,63 @@ PICS: - label: "Can the device be controlled manually?" id: DRYERCTRL.S.M.ManuallyControlled + # Oven Mode Cluster + + - label: "Does the device implement the OM cluster as a server?" + id: OTCCM.S + + - label: "Does the DUT support testing the failed ChangeToMode command?" + id: OTCCM.S.M.CAN_TEST_MODE_FAILURE + + - label: + "Id of mode the device will fail to transition to, given its current + state" + id: PIXIT.OTCCM.MODE_CHANGE_FAIL + + - label: + "Id of mode the device will successfully transition to, given its + current state" + id: PIXIT.OTCCM.MODE_CHANGE_OK + + # + # server / features + # + - label: + "Does the device support depending on an On/Off cluster implemented on + the same endpoint?" + id: OTCCM.S.F00 + + # + # server / attributes + # + - label: "Does the device implement the SupportedModes attribute?" + id: OTCCM.S.A0000 + + - label: "Does the device implement the CurrentMode attribute?" + id: OTCCM.S.A0001 + + - label: "Does the device implement the StartUpMode attribute?" + id: OTCCM.S.A0002 + + - label: "Does the device implement the OnMode attribute?" + id: OTCCM.S.A0003 + + # + # server / Commands received + # + - label: "Does the device implement receiving the ChangeToMode command?" + id: OTCCM.S.C00.Rsp + + # + # server / Commands generated + # + - label: + "Does the device implement sending the ChangeToModeResponse command?" + id: OTCCM.S.C01.Tx + + - label: "Can the device be controlled manually?" + id: OTCCM.S.M.CAN_MANUALLY_CONTROLLED + # RVC Clean Mode Cluster - label: "Does the device implement the RVCCLEANM cluster as a server?" diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_1_1.yaml index 4cfdaf04f41c97..180490a567c742 100644 --- a/src/app/tests/suites/certification/Test_TC_OTCCM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OTCCM_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Project CHIP Authors +# Copyright (c) 2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,75 +20,106 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Oven Mode" + endpoint: 1 tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true + - 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 from the DUT the ClusterRevision attribute." - verification: | - ./chip-tool ovenmode read cluster-revision 1 1 + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u - [1705647221.295875][50041:50047] CHIP:DMG: } - [1705647221.296007][50041:50047] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0049 Attribute 0x0000_FFFD DataVersion: 3240184500 - [1705647221.296039][50041:50047] CHIP:TOO: ClusterRevision: 1 - disabled: true + - label: + "Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL + be 1 if and only if OTCCM.S.F00(DEPONOFF)" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OTCCM.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - verification: | - ./chip-tool ovenmode read feature-map 1 1 - - [1705647273.001229][53151:53158] CHIP:DMG: } - [1705647273.001266][53151:53158] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0049 Attribute 0x0000_FFFC DataVersion: 3240184500 - [1705647273.001279][53151:53158] CHIP:TOO: FeatureMap: 1 - disabled: true - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - verification: | - ./chip-tool ovenmode read attribute-list 1 1 - - [1705647386.476019][60066:60072] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0049 Attribute 0x0000_FFFB DataVersion: 3240184500 - [1705647386.476098][60066:60072] CHIP:TOO: AttributeList: 7 entries - [1705647386.476117][60066:60072] CHIP:TOO: [1]: 0 - [1705647386.476130][60066:60072] CHIP:TOO: [2]: 1 - [1705647386.476139][60066:60072] CHIP:TOO: [3]: 65528 - [1705647386.476151][60066:60072] CHIP:TOO: [4]: 65529 - [1705647386.476162][60066:60072] CHIP:TOO: [5]: 65531 - [1705647386.476171][60066:60072] CHIP:TOO: [6]: 65532 - [1705647386.476183][60066:60072] CHIP:TOO: [7]: 65533 - disabled: true - - - label: "Step 5*: TH reads from the DUT the EventList attribute." - verification: | - ./chip-tool ovenmode read event-list 1 1 + command: "readAttribute" + attribute: "FeatureMap" + PICS: "!OTCCM.S.F00" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65531, 65532, 65533] + - label: + "Step 4b: Read the optional attribute(StartUpMode) in AttributeList" + PICS: OTCCM.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] - [1705647422.713386][62252:62257] CHIP:DMG: StatusIB = - [1705647422.713399][62252:62257] CHIP:DMG: { - [1705647422.713411][62252:62257] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1705647422.713420][62252:62257] CHIP:DMG: }, - disabled: true + - label: + "Step 4c: Read the Feature dependent attribute(DEPONOFF) in + AttributeList" + PICS: OTCCM.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + + - label: "Step 5: TH reads from the DUT the EventList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - verification: | - ./chip-tool ovenmode read accepted-command-list 1 1 - - [1705647458.520722][64406:64412] CHIP:DMG: } - [1705647458.520764][64406:64412] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0049 Attribute 0x0000_FFF9 DataVersion: 3240184500 - [1705647458.520776][64406:64412] CHIP:TOO: AcceptedCommandList: 0 entries - disabled: true + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - verification: | - ./chip-tool ovenmode read generated-command-list 1 1 - - [1705647658.986480][76560:76567] CHIP:DMG: } - [1705647658.986529][76560:76567] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0049 Attribute 0x0000_FFF8 DataVersion: 3240184500 - [1705647658.986540][76560:76567] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [1] diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_1_2.yaml index abf17d55b35633..7b793c9694fe10 100644 --- a/src/app/tests/suites/certification/Test_TC_OTCCM_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OTCCM_1_2.yaml @@ -20,8 +20,8 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Oven Mode" + endpoint: 1 tests: - label: @@ -34,90 +34,38 @@ tests: - label: "Step 2: TH reads from the DUT the SupportedModes attribute." PICS: OTCCM.S.A0000 verification: | - ./chip-tool ovenmode read supported-modes 1 1 + ./chip-tool Ovenmode read supported-modes 1 1 - [1705647707.587205][79487:79492] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0049 Attribute 0x0000_0000 DataVersion: 3240184500 - [1705647707.587250][79487:79492] CHIP:TOO: SupportedModes: 9 entries - [1705647707.587265][79487:79492] CHIP:TOO: [1]: { - [1705647707.587268][79487:79492] CHIP:TOO: Label: Bake - [1705647707.587275][79487:79492] CHIP:TOO: Mode: 0 - [1705647707.587282][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587287][79487:79492] CHIP:TOO: [1]: { - [1705647707.587290][79487:79492] CHIP:TOO: Value: 16384 - [1705647707.587294][79487:79492] CHIP:TOO: } - [1705647707.587297][79487:79492] CHIP:TOO: } - [1705647707.587303][79487:79492] CHIP:TOO: [2]: { - [1705647707.587305][79487:79492] CHIP:TOO: Label: Convection - [1705647707.587308][79487:79492] CHIP:TOO: Mode: 1 - [1705647707.587311][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587316][79487:79492] CHIP:TOO: [1]: { - [1705647707.587318][79487:79492] CHIP:TOO: Value: 16385 - [1705647707.587321][79487:79492] CHIP:TOO: } - [1705647707.587324][79487:79492] CHIP:TOO: } - [1705647707.587330][79487:79492] CHIP:TOO: [3]: { - [1705647707.587333][79487:79492] CHIP:TOO: Label: Grill - [1705647707.587335][79487:79492] CHIP:TOO: Mode: 2 - [1705647707.587338][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587342][79487:79492] CHIP:TOO: [1]: { - [1705647707.587345][79487:79492] CHIP:TOO: Value: 16386 - [1705647707.587348][79487:79492] CHIP:TOO: } - [1705647707.587351][79487:79492] CHIP:TOO: } - [1705647707.587356][79487:79492] CHIP:TOO: [4]: { - [1705647707.587359][79487:79492] CHIP:TOO: Label: Roast - [1705647707.587361][79487:79492] CHIP:TOO: Mode: 3 - [1705647707.587364][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587369][79487:79492] CHIP:TOO: [1]: { - [1705647707.587371][79487:79492] CHIP:TOO: Value: 16387 - [1705647707.587374][79487:79492] CHIP:TOO: } - [1705647707.587376][79487:79492] CHIP:TOO: } - [1705647707.587382][79487:79492] CHIP:TOO: [5]: { - [1705647707.587384][79487:79492] CHIP:TOO: Label: Clean - [1705647707.587387][79487:79492] CHIP:TOO: Mode: 4 - [1705647707.587390][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587394][79487:79492] CHIP:TOO: [1]: { - [1705647707.587397][79487:79492] CHIP:TOO: Value: 16388 - [1705647707.587400][79487:79492] CHIP:TOO: } - [1705647707.587402][79487:79492] CHIP:TOO: } - [1705647707.587408][79487:79492] CHIP:TOO: [6]: { - [1705647707.587410][79487:79492] CHIP:TOO: Label: Convection Bake - [1705647707.587413][79487:79492] CHIP:TOO: Mode: 5 - [1705647707.587416][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587420][79487:79492] CHIP:TOO: [1]: { - [1705647707.587423][79487:79492] CHIP:TOO: Value: 16389 - [1705647707.587425][79487:79492] CHIP:TOO: } - [1705647707.587428][79487:79492] CHIP:TOO: } - [1705647707.587434][79487:79492] CHIP:TOO: [7]: { - [1705647707.587436][79487:79492] CHIP:TOO: Label: Convection Roast - [1705647707.587439][79487:79492] CHIP:TOO: Mode: 6 - [1705647707.587442][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587446][79487:79492] CHIP:TOO: [1]: { - [1705647707.587449][79487:79492] CHIP:TOO: Value: 16390 - [1705647707.587451][79487:79492] CHIP:TOO: } - [1705647707.587454][79487:79492] CHIP:TOO: } - [1705647707.587460][79487:79492] CHIP:TOO: [8]: { - [1705647707.587462][79487:79492] CHIP:TOO: Label: Warming - [1705647707.587465][79487:79492] CHIP:TOO: Mode: 7 - [1705647707.587468][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587472][79487:79492] CHIP:TOO: [1]: { - [1705647707.587475][79487:79492] CHIP:TOO: Value: 16391 - [1705647707.587477][79487:79492] CHIP:TOO: } - [1705647707.587480][79487:79492] CHIP:TOO: } - [1705647707.587485][79487:79492] CHIP:TOO: [9]: { - [1705647707.587488][79487:79492] CHIP:TOO: Label: Proofing - [1705647707.587490][79487:79492] CHIP:TOO: Mode: 8 - [1705647707.587493][79487:79492] CHIP:TOO: ModeTags: 1 entries - [1705647707.587497][79487:79492] CHIP:TOO: [1]: { - [1705647707.587500][79487:79492] CHIP:TOO: Value: 16392 - [1705647707.587502][79487:79492] CHIP:TOO: } - [1705647707.587505][79487:79492] CHIP:TOO: } + Verify that the DUT response contains list of ModeOptionsStruct entries. + - Verify that the list has at least 2 and at most 255 entries + - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value + - If ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the mode tag value a defined common tag value ( Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster derived tag value ( Normal, Delicate, Heavy, Whites) or in the MfgTags (0x8000 to 0xBFFF) range + - If the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 + - Verify that at least one ModeOptionsStruct entry includes the Normal mode tag + - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) disabled: true - label: "Step 3: TH reads from the DUT the CurrentMode attribute." PICS: OTCCM.S.A0001 verification: | - ./chip-tool ovenmode read current-mode 1 1 + ./chip-tool Ovenmode read current-mode 1 1 - [1705647748.316225][81944:81949] CHIP:DMG: } - [1705647748.316354][81944:81949] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0049 Attribute 0x0000_0001 DataVersion: 3240184500 - [1705647748.316395][81944:81949] CHIP:TOO: CurrentMode: 0 + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value from supported_modes_dut + + disabled: true + + - label: "Step 4: TH reads from the DUT the OnMode attribute." + PICS: OTCCM.S.A0003 + verification: | + ./chip-tool Ovenmode read on-mode 1 1 + + Verify on TH(chip-tool) logs, OnMode attribute value is an integer value from supported_modes_dut or null + disabled: true + + - label: "Step 5: TH reads from the DUT the StartUpMode attribute." + PICS: OTCCM.S.A0002 + verification: | + ./chip-tool Ovenmode read start-up-mode 1 1 + + Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer value from supported_modes_dut or null disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_2_1.yaml new file mode 100644 index 00000000000000..1e6d17ff71679f --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OTCCM_2_1.yaml @@ -0,0 +1,218 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +name: 3.3 [TC-OTCCM-2.1] Change to Mode functionality with DUT as Server + +PICS: + - OTCCM.S + +config: + nodeId: 0x12344321 + cluster: "Oven Mode" + endpoint: 1 + + #PIXIT.OVEN.MODE_CHANGE_OK + NewMode_CHANGE_OK: + type: int8u + defaultValue: 2 + #PIXIT.OVEN.MODE_CHANGE_FAIL + NewMode_CHANGE_FAIL: + type: int8u + defaultValue: 10 + invalid_mode_th: + type: int8u + defaultValue: 15 + +tests: + - label: + "Step 1:Commission DUT to TH (can be skipped if done in a preceding + test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the SupportedModes attribute." + PICS: OTCCM.S.A0000 + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: "supported_mode_dut" + constraints: + type: list + minLength: 2 + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + - label: + "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set + to old_current_mode_dut" + PICS: OTCCM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: old_current_mode_dut + response: + values: + - name: "Status" + value: 0x00 + + - label: + "Step 5: Manually put the device in a state from which it will FAIL to + transition to PIXIT.OTCCM.MODE_CHANGE_FAIL" + PICS: OTCCM.S.M.CAN_TEST_MODE_FAILURE && PICS_SKIP_SAMPLE_APP + verification: | + Manual operation required + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 6: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: Step6_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + #Skipping test-7 because SDK is not enabled with this failure response + - label: + "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.OTCCM.MODE_CHANGE_FAIL" + PICS: + OTCCM.S.M.CAN_TEST_MODE_FAILURE && OTCCM.S.C00.Rsp && + PICS_SKIP_SAMPLE_APP + verification: | + Note : Please skip this step as SDK is not enabled with this failure response + + ./chip-tool ovenmode change-to-mode 2 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a GenericFailure(0x02) status response and below is the sample log provided for the raspi platform: + + [1690270057.274893][31185:31187] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0051 Command=0x0000_0001 + [1690270057.274901][31185:31187] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Command 0x0000_0001 + [1690270057.274915][31185:31187] CHIP:TOO: ChangeToModeResponse: { + [1690270057.274921][31185:31187] CHIP:TOO: status: 0 + [1690270057.274924][31185:31187] CHIP:TOO: } + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 8: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: Step6_current_mode_dut + constraints: + type: int16u + + - label: + "Step 9: Manually put the device in a state from which it will + SUCCESSFULLY transition to PIXIT.OTCCM.MODE_CHANGE_OK" + PICS: PICS_SKIP_SAMPLE_APP + verification: | + Manual operation required + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: Step10_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + - label: + "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.OTCCM.MODE_CHANGE_OK" + PICS: OTCCM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: NewMode_CHANGE_OK + response: + values: + - name: "Status" + value: 0x00 + + - label: + "Step 12: TH reads from the DUT the CurrentMode attribute. Verify that + the DUT response contains an integer value equal to + PIXIT.OTCCM.MODE_CHANGE_OK" + PICS: OTCCM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: NewMode_CHANGE_OK + + - label: + "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set + to invalid_mode_th" + PICS: OTCCM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: invalid_mode_th + response: + values: + - name: "Status" + value: 0x01 + + - label: + "Step 14: TH reads from the DUT the CurrentMode attribute. Verify that + the DUT response contains an integer value equal to + PIXIT.OTCCM.MODE_CHANGE_OK" + PICS: OTCCM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: NewMode_CHANGE_OK diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_3_1.yaml new file mode 100644 index 00000000000000..9f805fb0dd8101 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OTCCM_3_1.yaml @@ -0,0 +1,130 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +name: 3.4 [TC-OTCCM-3.1] On Mode functionality with DUT as Server + +PICS: + - OTCCM.S.A0003 + - OTCCM.S.F00 + - OO.S.C00.Rsp + - OO.S.C01.Rsp + +config: + nodeId: 0x12344321 + cluster: "Oven Mode" + endpoint: 1 + + ConfigureOnMode: + type: int8u + defaultValue: 0 + new_mode_th: + type: int8u + defaultValue: 2 + +tests: + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Precondition: TH writes from the DUT the OnMode attribute.NOTE: To + execute this test case set onmode to any integer value because as + default it value has null." + PICS: OTCCM.S.A0003 && OTCCM.S.F00 + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: ConfigureOnMode + + - label: "Step 2: TH reads from the DUT the OnMode attribute." + PICS: OTCCM.S.A0003 && OTCCM.S.F00 + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: on_mode_dut + constraints: + type: int8u + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 && OTCCM.S.F00 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + + - label: + "If on_mode_dut is equal to old_current_mode_dut proceed to step 4. + Else proceed to step 6." + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: on_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "Step 4: TH reads from the DUT the SupportedModes attribute." + runIf: IsExpectedValue + PICS: OTCCM.S.A0000 && OTCCM.S.F00 + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list + minLength: 2 + + - label: + "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set + to new_mode_th" + runIf: IsExpectedValue + PICS: OTCCM.S.C00.Rsp && OTCCM.S.F00 + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + response: + values: + - name: "Status" + value: 0x00 + + - label: "Step 6:TH sends a Off command to the DUT" + PICS: OO.S.C00.Rsp && OTCCM.S.F00 + cluster: "On/Off" + command: "Off" + + - label: "Step 7:TH sends a On command to the DUT" + PICS: OO.S.C01.Rsp && OTCCM.S.F00 + cluster: "On/Off" + command: "On" + + - label: "Step 8: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 && OTCCM.S.F00 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_3_2.yaml new file mode 100644 index 00000000000000..e1220de758e875 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OTCCM_3_2.yaml @@ -0,0 +1,171 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +name: 3.5 [TC-OTCCM-3.2] Startup Mode functionality with DUT as Server + +PICS: + - OTCCM.S.A0002 + +config: + nodeId: 0x12344321 + cluster: "Oven Mode" + endpoint: 1 + + 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)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + PICS: OTCCM.S.A0002 + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut + + - label: + "Step 2: 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: OTCCM.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 from the DUT the SupportedModes attribute." + runIf: IsExpectedValue + PICS: OTCCM.S.A0000 + 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 + new_start_up_mode_th value" + PICS: OTCCM.S.A0002 + runIf: IsExpectedValue + command: "writeAttribute" + attribute: "StartUpMode" + arguments: + value: new_start_up_mode_th + + - label: "Step 5: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + + - label: + "Step 5: If startup_mode_dut is equal to old_current_mode_dut proceed + to step 6. Else proceed to step 8." + PICS: OTCCM.S.A0001 && OTCCM.S.A0002 + 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 from the DUT the SupportedModes attribute." + PICS: OTCCM.S.A0000 + runIf: Step5_IsExpectedValue + 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: OTCCM.S.C00.Rsp + runIf: Step5_IsExpectedValue + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + response: + values: + - name: "Status" + value: 0x00 + + - label: "Step 8: Physically power cycle the device" + verification: | + Physically power cycle the device. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + 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 from the DUT the StartUpMode attribute." + PICS: OTCCM.S.A0002 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: new_start_up_mode_dut + value: new_start_up_mode_th + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "CurrentMode" + response: + value: new_start_up_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_OTCCM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_OTCCM_3_3.yaml new file mode 100644 index 00000000000000..bb1e8edf932f16 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OTCCM_3_3.yaml @@ -0,0 +1,187 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +name: + 3.6 [TC-OTCCM-3.3] On Mode and Startup Mode functionality with DUT as Server + +PICS: + - OTCCM.S.A0002 + - OTCCM.S.A0003 + - OTCCM.S.F00 + - OO.S.A4003 + +config: + nodeId: 0x12344321 + cluster: "Oven Mode" + endpoint: 1 + + 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)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + PICS: OTCCM.S.A0002 + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut + + - label: + "Step 2: 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: OTCCM.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 from the DUT the SupportedModes attribute." + runIf: IsExpectedValue + PICS: OTCCM.S.A0000 + 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 + new_start_up_mode_th value" + PICS: OTCCM.S.A0002 + runIf: IsExpectedValue + command: "writeAttribute" + attribute: "StartUpMode" + arguments: + value: new_start_up_mode_th + + - label: "Step 5: TH reads from the DUT the OnMode attribute." + PICS: OTCCM.S.A0003 && OTCCM.S.A0002 + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: old_on_mode_dut + + - label: + "Step 5: If startup_mode_dut is equal to old_on_mode_dut proceed to + step 6. Else proceed to step 8." + PICS: OTCCM.S.A0002 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: old_on_mode_dut + - name: "Value2" + value: startup_mode_dut + response: + - values: + - name: "Equals" + saveAs: Step5_IsExpectedValue + + - label: "Step 6: TH reads from the DUT the SupportedModes attribute." + PICS: OTCCM.S.A0000 && OTCCM.S.A0002 + runIf: Step5_IsExpectedValue + 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" + PICS: OTCCM.S.A0003 + runIf: Step5_IsExpectedValue + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: new_mode_th + + - label: "Step 8: TH reads from the DUT the OnMode attribute." + PICS: OTCCM.S.A0003 && OTCCM.S.F00 + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: new_on_mode_dut + + - label: + "Step 9: TH writes to the DUT the StartUpOnOff attribute with the + value 1." + PICS: OO.S.A4003 + cluster: "On/Off" + command: "writeAttribute" + attribute: "StartUpOnOff" + arguments: + value: 1 + + - label: "Step 10: Physically power cycle the device" + verification: | + Physically power cycle the device. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + 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 from the DUT the StartUpMode attribute." + PICS: OTCCM.S.A0002 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "StartUpMode" + response: + value: new_start_up_mode_th + + - label: "Step 12: TH reads from the DUT the CurrentMode attribute." + PICS: OTCCM.S.A0001 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "CurrentMode" + response: + value: new_on_mode_dut diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 9bba640d4218e2..4201b969a81020 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -753,6 +753,26 @@ PIXIT.LWM.MODE_CHANGE_OK=1 LWM.S.M.CAN_TEST_MODE_FAILURE=1 LWM.S.M.CAN_MANUALLY_CONTROLLED=1 +# OVEN MODE CLUSTER +OTCCM.S=1 +OTCCM.S.A0000=1 +OTCCM.S.A0001=1 +OTCCM.S.A0002=0 +OTCCM.S.A0003=0 + +#Feature +OTCCM.S.F00=0 + +#Command +OTCCM.S.C00.Rsp=1 +OTCCM.S.C01.Tx=1 + +OTCCM.S.M.CAN_TEST_MODE_FAILURE=1 +OTCCM.S.M.CAN_MANUALLY_CONTROLLED=1 + +#PIXIT +PIXIT.OTCCM.MODE_CHANGE_FAIL=1 +PIXIT.OTCCM.MODE_CHANGE_OK=1 # LAUNDRY DRYER MODE CLUSTER DRYERCTRL.S=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 905b5f2ebd4999..9594ea623d1717 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -118,7 +118,13 @@ "Test_TC_WASHERCTRL_2_1", "Test_TC_WASHERCTRL_2_2" ], - + "OvenMode": [ + "Test_TC_OTCCM_1_1", + "Test_TC_OTCCM_2_1", + "Test_TC_OTCCM_3_1", + "Test_TC_OTCCM_3_2", + "Test_TC_OTCCM_3_3" + ], "LaundryDryerControl": ["Test_TC_DRYERCTRL_1_1", "Test_TC_DRYERCTRL_2_1"], "MediaControl": [ @@ -401,6 +407,7 @@ "TimeFormatLocalization", "LaundryWasherMode", "LaundryWasherControl", + "OvenMode", "LaundryDryerControl", "MediaControl", "ModeSelect", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 7b4f2208a99e55..0263fc258b8db0 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -307,6 +307,7 @@ "Test_TC_BRBINFO_3_1" ], "LaundryWasherControl": [], + "OvenMode": ["Test_TC_OTCCM_1_2", "Test_TC_OTCCM_3_2", "Test_TC_OTCCM_3_3"], "AccessControlEnforcement": [], "OvenMode": ["Test_TC_OTCCM_1_1", "Test_TC_OTCCM_1_2"], "EnergyEVSE": ["Test_TC_EEVSE_1_1", "Test_TC_EEVSE_2_1"], @@ -352,6 +353,7 @@ "LevelControl", "LaundryWasherMode", "OnOff", + "OvenMode", "OperationalState", "OvenMode", "RelativeHumidityMeasurement", diff --git a/src/controller/python/chip/clusters/__init__.py b/src/controller/python/chip/clusters/__init__.py index bf1f66a31a5a05..1e4fcee4eb37c4 100644 --- a/src/controller/python/chip/clusters/__init__.py +++ b/src/controller/python/chip/clusters/__init__.py @@ -54,9 +54,7 @@ ColorControl, ContentLauncher, Descriptor, DeviceEnergyManagementMode, DeviceEnergyManagement, DiagnosticLogs, DishwasherAlarm, DishwasherMode, DoorLock, ElectricalMeasurement, EnergyEvse, EnergyEvseMode, EthernetNetworkDiagnostics, FanControl, FaultInjection, FixedLabel, FlowMeasurement, FormaldehydeConcentrationMeasurement, GeneralCommissioning, GeneralDiagnostics, GroupKeyManagement, Groups, - HepaFilterMonitoring, IcdManagement, Identify, IlluminanceMeasurement, KeypadInput, - LaundryWasherControls, LaundryDryerControls, LaundryWasherMode, LevelControl, LocalizationConfiguration, LowPower, MediaInput, MediaPlayback, ModeSelect, - NetworkCommissioning, NitrogenDioxideConcentrationMeasurement, + HepaFilterMonitoring, IcdManagement, Identify, IlluminanceMeasurement, KeypadInput, LaundryDryerControls, LaundryWasherControls, LaundryWasherMode, LevelControl, LocalizationConfiguration, LowPower, MediaInput, MediaPlayback, MicrowaveOvenControl, MicrowaveOvenMode, ModeSelect, NetworkCommissioning, NitrogenDioxideConcentrationMeasurement, OccupancySensing, OnOff, OnOffSwitchConfiguration, OperationalCredentials, OperationalState, 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 2cd96b5a45995d..06059f6144ac7c 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -133,6 +133,7 @@ class TestList : public Command { printf("Test_TC_WASHERCTRL_1_1\n"); printf("Test_TC_WASHERCTRL_2_1\n"); printf("Test_TC_WASHERCTRL_2_2\n"); + printf("Test_TC_OTCCM_1_1\n"); printf("Test_TC_DRYERCTRL_1_1\n"); printf("Test_TC_DRYERCTRL_2_1\n"); printf("Test_TC_LOWPOWER_1_1\n"); @@ -70356,6 +70357,430 @@ class Test_TC_WASHERCTRL_2_2 : public TestCommandBridge { } }; +class Test_TC_OTCCM_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OTCCM_1_1() + : TestCommandBridge("Test_TC_OTCCM_1_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_OTCCM_1_1() + { + } + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OTCCM_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OTCCM_1_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: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the ClusterRevision attribute.\n"); + err = TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if OTCCM.S.F00(DEPONOFF)\n"); + if (ShouldSkip("OTCCM.S.F00")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit0ShallBe1IfAndOnlyIfOtccmsf00deponoff_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads from the DUT the FeatureMap attribute.\n"); + if (ShouldSkip("!OTCCM.S.F00")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheFeatureMapAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4b: Read the optional attribute(StartUpMode) in AttributeList\n"); + if (ShouldSkip("OTCCM.S.A0002")) { + NextTest(); + return; + } + err = TestStep4bReadTheOptionalAttributeStartUpModeInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 4c: Read the Feature dependent attribute(DEPONOFF) in AttributeList\n"); + if (ShouldSkip("OTCCM.S.F00")) { + NextTest(); + return; + } + err = TestStep4cReadTheFeatureDependentAttributeDEPONOFFInAttributeList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 5: TH reads from the DUT the EventList attribute.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 6: TH reads from the DUT the AcceptedCommandList attribute.\n"); + err = TestStep6ThReadsFromTheDutTheAcceptedCommandListAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 7: TH reads from the DUT the GeneratedCommandList attribute.\n"); + err = TestStep7ThReadsFromTheDutTheGeneratedCommandListAttribute_10(); + 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; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + 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 = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 2: TH reads from the DUT the ClusterRevision attribute.: Error: %@", err); + } else { + NSLog(@"Step 2: TH reads from the DUT the ClusterRevision attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit0ShallBe1IfAndOnlyIfOtccmsf00deponoff_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if OTCCM.S.F00(DEPONOFF): Error: %@", err); + } else { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute, bit 0: SHALL be 1 if and only if OTCCM.S.F00(DEPONOFF): Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute.: Error: %@", err); + } else { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute.: Error: %@", err); + } else { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute.: Error: %@", err); + } else { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4bReadTheOptionalAttributeStartUpModeInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 4b: Read the optional attribute(StartUpMode) in AttributeList: Error: %@", err); + } else { + NSLog(@"Step 4b: Read the optional attribute(StartUpMode) in AttributeList: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4cReadTheFeatureDependentAttributeDEPONOFFInAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 4c: Read the Feature dependent attribute(DEPONOFF) in AttributeList: Error: %@", err); + } else { + NSLog(@"Step 4c: Read the Feature dependent attribute(DEPONOFF) in AttributeList: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6ThReadsFromTheDutTheAcceptedCommandListAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 6: TH reads from the DUT the AcceptedCommandList attribute.: Error: %@", err); + } else { + NSLog(@"Step 6: TH reads from the DUT the AcceptedCommandList attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7ThReadsFromTheDutTheGeneratedCommandListAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOvenMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 7: TH reads from the DUT the GeneratedCommandList attribute.: Error: %@", err); + } else { + NSLog(@"Step 7: TH reads from the DUT the GeneratedCommandList attribute.: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_DRYERCTRL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -193141,6 +193566,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),