diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 1bc430a981a730..78fefe41895084 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -58,6 +58,9 @@ "Test_TC_TCCM_3_3", "Test_TC_RVCRUNM_3_1", "Test_TC_TCTL_2_1", + "Test_TC_LWM_3_1", + "Test_TC_LWM_3_2", + "Test_TC_LWM_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 0ecd9313e27e91..110dd542a7f78b 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -184,6 +184,8 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_DGGEN_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_DGGEN_2_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "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_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/Test_TC_LWM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml index 285c99184c5521..fe8ff87e214e18 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_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: 183.3.2. [TC-LWM-3.2] Startup Mode functionality with DUT as Server @@ -20,234 +19,154 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Laundry Washer Mode" + endpoint: 1 -tests: - - label: "Preconditions" - verification: | - !LWM.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-LWM-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 + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the StartUpMode attribute." PICS: LWM.S.A0002 - verification: | - ./chip-tool laundrywashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer or null - - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is null - - NOTE: 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. + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut - [1690185689.626227][15652:15654] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 869931348 - [1690185689.626269][15652:15654] CHIP:TOO: StartUpMode: null - disabled: true + - 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: LWM.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: LWM.S.A0000 - verification: | - ./chip-tool laundrywashermode 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: - - [1690185724.484514][15658:15660] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 869931348 - [1690185724.484543][15658:15660] CHIP:TOO: SupportedModes: 4 entries - [1690185724.484552][15658:15660] CHIP:TOO: [1]: { - [1690185724.484555][15658:15660] CHIP:TOO: Label: Normal - [1690185724.484561][15658:15660] CHIP:TOO: Mode: 0 - [1690185724.484565][15658:15660] CHIP:TOO: ModeTags: 1 entries - [1690185724.484570][15658:15660] CHIP:TOO: [1]: { - [1690185724.484573][15658:15660] CHIP:TOO: Value: 16384 - [1690185724.484576][15658:15660] CHIP:TOO: } - [1690185724.484579][15658:15660] CHIP:TOO: } - [1690185724.484585][15658:15660] CHIP:TOO: [2]: { - [1690185724.484588][15658:15660] CHIP:TOO: Label: Delicate - [1690185724.484590][15658:15660] CHIP:TOO: Mode: 1 - [1690185724.484595][15658:15660] CHIP:TOO: ModeTags: 3 entries - [1690185724.484598][15658:15660] CHIP:TOO: [1]: { - [1690185724.484601][15658:15660] CHIP:TOO: Value: 16385 - [1690185724.484603][15658:15660] CHIP:TOO: } - [1690185724.484607][15658:15660] CHIP:TOO: [2]: { - [1690185724.484609][15658:15660] CHIP:TOO: Value: 8 - [1690185724.484612][15658:15660] CHIP:TOO: } - [1690185724.484615][15658:15660] CHIP:TOO: [3]: { - [1690185724.484617][15658:15660] CHIP:TOO: Value: 2 - [1690185724.484620][15658:15660] CHIP:TOO: } - [1690185724.484622][15658:15660] CHIP:TOO: } - [1690185724.484627][15658:15660] CHIP:TOO: [3]: { - [1690185724.484630][15658:15660] CHIP:TOO: Label: Heavy - [1690185724.484632][15658:15660] CHIP:TOO: Mode: 2 - [1690185724.484636][15658:15660] CHIP:TOO: ModeTags: 2 entries - [1690185724.484639][15658:15660] CHIP:TOO: [1]: { - [1690185724.484642][15658:15660] CHIP:TOO: Value: 7 - [1690185724.484644][15658:15660] CHIP:TOO: } - [1690185724.484647][15658:15660] CHIP:TOO: [2]: { - [1690185724.484649][15658:15660] CHIP:TOO: Value: 16386 - [1690185724.484652][15658:15660] CHIP:TOO: } - [1690185724.484654][15658:15660] CHIP:TOO: } - [1690185724.484659][15658:15660] CHIP:TOO: [4]: { - [1690185724.484662][15658:15660] CHIP:TOO: Label: Whites - [1690185724.484664][15658:15660] CHIP:TOO: Mode: 3 - [1690185724.484667][15658:15660] CHIP:TOO: ModeTags: 1 entries - [1690185724.484670][15658:15660] CHIP:TOO: [1]: { - [1690185724.484673][15658:15660] CHIP:TOO: Value: 16387 - [1690185724.484675][15658:15660] CHIP:TOO: } - [1690185724.484678][15658:15660] 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 new_start_up_mode_th value" PICS: LWM.S.A0002 - verification: | - ./chip-tool laundrywashermode 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: - - [1690185636.156858][15647:15649] CHIP:DMG: StatusIB = - [1690185636.156870][15647:15649] CHIP:DMG: { - [1690185636.156881][15647:15649] CHIP:DMG: status = 0x00 (SUCCESS), - [1690185636.156892][15647:15649] CHIP:DMG: }, - - ./chip-tool laundrywashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform - - [1692168304.773793][2920:2922] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 3179897959 - [1692168304.773865][2920:2922] CHIP:TOO: StartUpMode: 0 - disabled: true + 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: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - On TH(chip-tool), Verify CurrentMode attribute value is an integer, - - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut - NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 6. Else proceed to step 8. - - [1690185713.364316][15655:15657] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 869931348 - [1690185713.364364][15655:15657] CHIP:TOO: CurrentMode: 0 - disabled: true + - label: + "Step 5: If startup_mode_dut is equal to old_current_mode_dut proceed + to step 6. Else proceed to step 8." + PICS: LWM.S.A0001 && LWM.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: LWM.S.A0000 - verification: | - ./chip-tool laundrywashermode 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: - - [1690185724.484514][15658:15660] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 869931348 - [1690185724.484543][15658:15660] CHIP:TOO: SupportedModes: 4 entries - [1690185724.484552][15658:15660] CHIP:TOO: [1]: { - [1690185724.484555][15658:15660] CHIP:TOO: Label: Normal - [1690185724.484561][15658:15660] CHIP:TOO: Mode: 0 - [1690185724.484565][15658:15660] CHIP:TOO: ModeTags: 1 entries - [1690185724.484570][15658:15660] CHIP:TOO: [1]: { - [1690185724.484573][15658:15660] CHIP:TOO: Value: 16384 - [1690185724.484576][15658:15660] CHIP:TOO: } - [1690185724.484579][15658:15660] CHIP:TOO: } - [1690185724.484585][15658:15660] CHIP:TOO: [2]: { - [1690185724.484588][15658:15660] CHIP:TOO: Label: Delicate - [1690185724.484590][15658:15660] CHIP:TOO: Mode: 1 - [1690185724.484595][15658:15660] CHIP:TOO: ModeTags: 3 entries - [1690185724.484598][15658:15660] CHIP:TOO: [1]: { - [1690185724.484601][15658:15660] CHIP:TOO: Value: 16385 - [1690185724.484603][15658:15660] CHIP:TOO: } - [1690185724.484607][15658:15660] CHIP:TOO: [2]: { - [1690185724.484609][15658:15660] CHIP:TOO: Value: 8 - [1690185724.484612][15658:15660] CHIP:TOO: } - [1690185724.484615][15658:15660] CHIP:TOO: [3]: { - [1690185724.484617][15658:15660] CHIP:TOO: Value: 2 - [1690185724.484620][15658:15660] CHIP:TOO: } - [1690185724.484622][15658:15660] CHIP:TOO: } - [1690185724.484627][15658:15660] CHIP:TOO: [3]: { - [1690185724.484630][15658:15660] CHIP:TOO: Label: Heavy - [1690185724.484632][15658:15660] CHIP:TOO: Mode: 2 - [1690185724.484636][15658:15660] CHIP:TOO: ModeTags: 2 entries - [1690185724.484639][15658:15660] CHIP:TOO: [1]: { - [1690185724.484642][15658:15660] CHIP:TOO: Value: 7 - [1690185724.484644][15658:15660] CHIP:TOO: } - [1690185724.484647][15658:15660] CHIP:TOO: [2]: { - [1690185724.484649][15658:15660] CHIP:TOO: Value: 16386 - [1690185724.484652][15658:15660] CHIP:TOO: } - [1690185724.484654][15658:15660] CHIP:TOO: } - [1690185724.484659][15658:15660] CHIP:TOO: [4]: { - [1690185724.484662][15658:15660] CHIP:TOO: Label: Whites - [1690185724.484664][15658:15660] CHIP:TOO: Mode: 3 - [1690185724.484667][15658:15660] CHIP:TOO: ModeTags: 1 entries - [1690185724.484670][15658:15660] CHIP:TOO: [1]: { - [1690185724.484673][15658:15660] CHIP:TOO: Value: 16387 - [1690185724.484675][15658:15660] CHIP:TOO: } - [1690185724.484678][15658:15660] CHIP:TOO: } - disabled: true + 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: LWM.S.C00.Rsp - verification: | - ./chip-tool laundrywashermode change-to-mode 1 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: - - [1690185742.384243][15661:15663] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Command 0x0000_0001 - [1690185742.384257][15661:15663] CHIP:TOO: ChangeToModeResponse: { - [1690185742.384264][15661:15663] CHIP:TOO: status: 0 - [1690185742.384267][15661:15663] CHIP:TOO: } - disabled: true + 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 - disabled: true + 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: LWM.S.A0002 - verification: | - ./chip-tool laundrywashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer value - - Save the value as new_start_up_mode_dut and is equal to new_start_up_mode_th, below is the sample log provided for the raspi platform, Here StartUpMode value is 0 - - [1690185689.626227][15652:15654] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 869931348 - [1690185689.626269][15652:15654] CHIP:TOO: StartUpMode: 0 - disabled: true + PICS: LWM.S.A0002 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: new_start_up_mode_dut + constraints: + anyOf: [startup_mode_dut, new_start_up_mode_th] - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is equal to new_start_up_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690185777.021610][15671:15673] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 2000229067 - [1690185777.021664][15671:15673] CHIP:TOO: CurrentMode: 0 - disabled: true + PICS: LWM.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_LWM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml index 302eb46f563404..8250418368643d 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_3_3.yaml @@ -11,277 +11,179 @@ # 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: 183.3.3. [TC-LWM-3.3] On Mode and Startup Mode functionality with DUT as Server PICS: - - LWM.S + - LWM.S.A0002 + - LWM.S.A0003 + - LWM.S.F00 + - OO.S.A4003 config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Laundry Washer Mode" + endpoint: 1 -tests: - - label: "Note" - verification: | - To Execute the TC-LWM-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 - - 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 + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the StartUpMode attribute." PICS: LWM.S.A0002 - verification: | - ./chip-tool laundrywashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer value or null - - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is null + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut - NOTE: 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. - - [1690185689.626227][15652:15654] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 869931348 - [1690185689.626269][15652:15654] CHIP:TOO: StartUpMode: null - disabled: true + - 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: LWM.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: LWM.S.A0000 - verification: | - ./chip-tool laundrywashermode 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: - - [1690185724.484514][15658:15660] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 869931348 - [1690185724.484543][15658:15660] CHIP:TOO: SupportedModes: 4 entries - [1690185724.484552][15658:15660] CHIP:TOO: [1]: { - [1690185724.484555][15658:15660] CHIP:TOO: Label: Normal - [1690185724.484561][15658:15660] CHIP:TOO: Mode: 0 - [1690185724.484565][15658:15660] CHIP:TOO: ModeTags: 1 entries - [1690185724.484570][15658:15660] CHIP:TOO: [1]: { - [1690185724.484573][15658:15660] CHIP:TOO: Value: 16384 - [1690185724.484576][15658:15660] CHIP:TOO: } - [1690185724.484579][15658:15660] CHIP:TOO: } - [1690185724.484585][15658:15660] CHIP:TOO: [2]: { - [1690185724.484588][15658:15660] CHIP:TOO: Label: Delicate - [1690185724.484590][15658:15660] CHIP:TOO: Mode: 1 - [1690185724.484595][15658:15660] CHIP:TOO: ModeTags: 3 entries - [1690185724.484598][15658:15660] CHIP:TOO: [1]: { - [1690185724.484601][15658:15660] CHIP:TOO: Value: 16385 - [1690185724.484603][15658:15660] CHIP:TOO: } - [1690185724.484607][15658:15660] CHIP:TOO: [2]: { - [1690185724.484609][15658:15660] CHIP:TOO: Value: 8 - [1690185724.484612][15658:15660] CHIP:TOO: } - [1690185724.484615][15658:15660] CHIP:TOO: [3]: { - [1690185724.484617][15658:15660] CHIP:TOO: Value: 2 - [1690185724.484620][15658:15660] CHIP:TOO: } - [1690185724.484622][15658:15660] CHIP:TOO: } - [1690185724.484627][15658:15660] CHIP:TOO: [3]: { - [1690185724.484630][15658:15660] CHIP:TOO: Label: Heavy - [1690185724.484632][15658:15660] CHIP:TOO: Mode: 2 - [1690185724.484636][15658:15660] CHIP:TOO: ModeTags: 2 entries - [1690185724.484639][15658:15660] CHIP:TOO: [1]: { - [1690185724.484642][15658:15660] CHIP:TOO: Value: 7 - [1690185724.484644][15658:15660] CHIP:TOO: } - [1690185724.484647][15658:15660] CHIP:TOO: [2]: { - [1690185724.484649][15658:15660] CHIP:TOO: Value: 16386 - [1690185724.484652][15658:15660] CHIP:TOO: } - [1690185724.484654][15658:15660] CHIP:TOO: } - [1690185724.484659][15658:15660] CHIP:TOO: [4]: { - [1690185724.484662][15658:15660] CHIP:TOO: Label: Whites - [1690185724.484664][15658:15660] CHIP:TOO: Mode: 3 - [1690185724.484667][15658:15660] CHIP:TOO: ModeTags: 1 entries - [1690185724.484670][15658:15660] CHIP:TOO: [1]: { - [1690185724.484673][15658:15660] CHIP:TOO: Value: 16387 - [1690185724.484675][15658:15660] CHIP:TOO: } - [1690185724.484678][15658:15660] 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 new_start_up_mode_th value" PICS: LWM.S.A0002 - verification: | - ./chip-tool laundrywashermode 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: - - [1690185636.156858][15647:15649] CHIP:DMG: StatusIB = - [1690185636.156870][15647:15649] CHIP:DMG: { - [1690185636.156881][15647:15649] CHIP:DMG: status = 0x00 (SUCCESS), - [1690185636.156892][15647:15649] CHIP:DMG: }, - - ./chip-tool laundrywashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform, - - [1692165008.700475][2609:2611] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 1273636449 - [1692165008.700550][2609:2611] CHIP:TOO: StartUpMode: 0 - disabled: true + 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: LWM.S.A0003 && LWM.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 laundrywashermode 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: - - [1692164726.392055][2590:2592] CHIP:DMG: StatusIB = - [1692164726.392093][2590:2592] CHIP:DMG: { - [1692164726.392128][2590:2592] CHIP:DMG: status = 0x00 (SUCCESS), - [1692164726.392163][2590:2592] CHIP:DMG: }, + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: old_on_mode_dut - - ./chip-tool laundrywashermode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer - - Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 - - NOTE: If startup_mode_dut is equal to old_on_mode_dut proceed to step 6. Else proceed to step 8. - - [1692164858.854889][2600:2602] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0003 DataVersion: 1273636449 - [1692164858.854947][2600:2602] CHIP:TOO: OnMode: 0 - disabled: true + - label: + "Step 5: If startup_mode_dut is equal to old_on_mode_dut proceed to + step 6. Else proceed to step 8." + PICS: LWM.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: LWM.S.A0000 && LWM.S.A0002 - verification: | - ./chip-tool laundrywashermode 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: - - [1690185724.484514][15658:15660] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0000 DataVersion: 869931348 - [1690185724.484543][15658:15660] CHIP:TOO: SupportedModes: 4 entries - [1690185724.484552][15658:15660] CHIP:TOO: [1]: { - [1690185724.484555][15658:15660] CHIP:TOO: Label: Normal - [1690185724.484561][15658:15660] CHIP:TOO: Mode: 0 - [1690185724.484565][15658:15660] CHIP:TOO: ModeTags: 1 entries - [1690185724.484570][15658:15660] CHIP:TOO: [1]: { - [1690185724.484573][15658:15660] CHIP:TOO: Value: 16384 - [1690185724.484576][15658:15660] CHIP:TOO: } - [1690185724.484579][15658:15660] CHIP:TOO: } - [1690185724.484585][15658:15660] CHIP:TOO: [2]: { - [1690185724.484588][15658:15660] CHIP:TOO: Label: Delicate - [1690185724.484590][15658:15660] CHIP:TOO: Mode: 1 - [1690185724.484595][15658:15660] CHIP:TOO: ModeTags: 3 entries - [1690185724.484598][15658:15660] CHIP:TOO: [1]: { - [1690185724.484601][15658:15660] CHIP:TOO: Value: 16385 - [1690185724.484603][15658:15660] CHIP:TOO: } - [1690185724.484607][15658:15660] CHIP:TOO: [2]: { - [1690185724.484609][15658:15660] CHIP:TOO: Value: 8 - [1690185724.484612][15658:15660] CHIP:TOO: } - [1690185724.484615][15658:15660] CHIP:TOO: [3]: { - [1690185724.484617][15658:15660] CHIP:TOO: Value: 2 - [1690185724.484620][15658:15660] CHIP:TOO: } - [1690185724.484622][15658:15660] CHIP:TOO: } - [1690185724.484627][15658:15660] CHIP:TOO: [3]: { - [1690185724.484630][15658:15660] CHIP:TOO: Label: Heavy - [1690185724.484632][15658:15660] CHIP:TOO: Mode: 2 - [1690185724.484636][15658:15660] CHIP:TOO: ModeTags: 2 entries - [1690185724.484639][15658:15660] CHIP:TOO: [1]: { - [1690185724.484642][15658:15660] CHIP:TOO: Value: 7 - [1690185724.484644][15658:15660] CHIP:TOO: } - [1690185724.484647][15658:15660] CHIP:TOO: [2]: { - [1690185724.484649][15658:15660] CHIP:TOO: Value: 16386 - [1690185724.484652][15658:15660] CHIP:TOO: } - [1690185724.484654][15658:15660] CHIP:TOO: } - [1690185724.484659][15658:15660] CHIP:TOO: [4]: { - [1690185724.484662][15658:15660] CHIP:TOO: Label: Whites - [1690185724.484664][15658:15660] CHIP:TOO: Mode: 3 - [1690185724.484667][15658:15660] CHIP:TOO: ModeTags: 1 entries - [1690185724.484670][15658:15660] CHIP:TOO: [1]: { - [1690185724.484673][15658:15660] CHIP:TOO: Value: 16387 - [1690185724.484675][15658:15660] CHIP:TOO: } - [1690185724.484678][15658:15660] CHIP:TOO: } - disabled: true + 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: LWM.S.A0003 - verification: | - ./chip-tool laundrywashermode write on-mode 1 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: - - [1692165331.674699][2630:2632] CHIP:DMG: StatusIB = - [1692165331.674760][2630:2632] CHIP:DMG: { - [1692165331.674829][2630:2632] CHIP:DMG: status = 0x00 (SUCCESS), - [1692165331.674891][2630:2632] CHIP:DMG: }, - disabled: true + runIf: Step5_IsExpectedValue + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: new_mode_th - label: "Step 8: TH reads from the DUT the OnMode attribute." PICS: LWM.S.A0003 && LWM.S.F00 - verification: | - ./chip-tool laundrywashermode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer value - - Save the value as new_on_mode_dut and is equal to new_mode_th, below is the sample log provided for the raspi platform, here OnMode value is 1 - - [1692165455.305858][2637:2639] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0003 DataVersion: 1273636452 - [1692165455.305928][2637:2639] CHIP:TOO: OnMode: 1 - disabled: true + 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 - verification: | - ./chip-tool onoff write start-up-on-off 1 1 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: - - [1651101661960] [90832:7598169] CHIP: [DMG] { - [1651101661960] [90832:7598169] CHIP: [DMG] status = 0x00 (SUCCESS), - [1651101661960] [90832:7598169] CHIP: [DMG] }, - disabled: true + cluster: "On/Off" + command: "writeAttribute" + attribute: "StartUpOnOff" + arguments: + value: 1 - label: "Step 10: Physically power cycle the device" verification: | Physically power cycle the device. - 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: "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: LWM.S.A0002 - verification: | - ./chip-tool laundrywashermode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer value and is equal to new_start_up_mode_th, below is the sample log provided for the raspi platform, Here StartUpMode value is 0 - - [1692165692.521150][2715:2717] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0002 DataVersion: 3179897958 - [1692165692.521214][2715:2717] CHIP:TOO: StartUpMode: 0 - disabled: true + PICS: LWM.S.A0002 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "StartUpMode" + response: + constraints: + anyOf: [new_start_up_mode_th, startup_mode_dut] - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: LWM.S.A0001 - verification: | - ./chip-tool laundrywashermode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is new_on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 1 - - [1690185481.653384][15610:15612] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0051 Attribute 0x0000_0001 DataVersion: 3936986766 - [1690185481.653431][15610:15612] CHIP:TOO: CurrentMode: 1 - disabled: true + PICS: LWM.S.A0001 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "CurrentMode" + response: + value: new_on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_REFALM_2_3.yaml b/src/app/tests/suites/certification/Test_TC_REFALM_2_3.yaml index be1df892bd9bcb..d47f46e00c1a1a 100644 --- a/src/app/tests/suites/certification/Test_TC_REFALM_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_REFALM_2_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: 217.2.3. [TC-REFALM-2.3] Local suppression of the door alarm with DUT as @@ -19,109 +18,127 @@ name: PICS: - REFALM.S + - REFALM.S.M.LocalSuppress config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Refrigerator Alarm" + endpoint: 1 + PIXIT.REFALM.AlarmThreshold: + type: int16u + defaultValue: 5 tests: - 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 on the DUT is closed" verification: | Ensure that the door on the DUT is closed - disabled: true - - - label: "Step 3: TH reads from the DUT the State attribute" + 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 State attribute" + command: "readAttribute" + attribute: "State" 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 - - - label: "Step 4: TH reads from the DUT the Mask attribute" + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: "Step 4:TH reads from the DUT the Mask attribute" + command: "readAttribute" + attribute: "Mask" 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 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] - label: "Step 5: Manually open the door on the DUT" verification: | Manually open the door on the DUT - 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 6: Wait for the time defined in PIXIT.REFALM.AlarmThreshold" - verification: | - Wait for the time defined in PIXIT.REFALM.AlarmThreshold - disabled: true - - - label: "Step 7: 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: 1 - [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 + cluster: "DelayCommands" + PICS: PICS_USER_PROMPT + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: PIXIT.REFALM.AlarmThreshold * 1000 + + - label: "Step 7:TH reads from the DUT the State attribute" + command: "readAttribute" + attribute: "State" + PICS: REFALM.S.A0002 && PICS_USER_PROMPT + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] - label: "Step 8: Invoke the on DUT sequence to suppress the alarm, do not close the door" verification: | Invoke the on DUT sequence to suppress the alarm, do not close the door - disabled: true - - - label: "Step 9: 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 - - - label: "Step 10: 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: 0 - [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 - - - label: "Step 11: TH reads from the DUT the Supported 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 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Step 9:TH reads from the DUT the State attribute" + command: "readAttribute" + attribute: "State" + PICS: REFALM.S.A0002 && PICS_USER_PROMPT + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: "Step 10:TH reads from the DUT the Mask attribute" + command: "readAttribute" + attribute: "Mask" + PICS: REFALM.S.A0000 && PICS_USER_PROMPT + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: "Step 11:TH reads from the DUT the Supported attribute" + command: "readAttribute" + attribute: "Supported" + PICS: REFALM.S.A0003 && PICS_USER_PROMPT + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml index 545dcae0f5a5d0..2c22fc392f5d52 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_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: 178.2.4. [TC-TCTL-3.2] Optional temperature number functionality with DUT as @@ -23,235 +22,150 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Temperature Control" + endpoint: 1 + Step_5_setTemp: + type: temperature + defaultValue: 5 + InvalidTemp: + type: temperature + defaultValue: 100 + Step_10_setTemp: + type: temperature + defaultValue: 50 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. - - While verifying below test case we will get 0 and null value for few attributes, as per spec 0 and null value is default for those attributes. - disabled: true - - - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true + - 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: Operate device such that a temperature number can be accepted" verification: | Operate device such that a temperature number can be accepted - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 3: TH reads from the DUT the MinTemperature attribute" PICS: TCTL.S.A0001 - verification: | - ./chip-tool temperaturecontrol read min-temperature 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0001 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: MinTemperature: 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "MinTemperature" + response: + saveAs: minTemp + constraints: + type: temperature - label: "Step 4: TH reads from the DUT the MaxTemperature attribute" PICS: TCTL.S.A0002 - verification: | - ./chip-tool temperaturecontrol read max-temperature 1 1 - - On TH(chip-tool), Verify that the DUT response contains a temperature with value greater than TCTL.S.A0001(MinTemperature). - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0002 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: MaxTemperature: 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "MaxTemperature" + response: + saveAs: maxTemp + constraints: + type: temperature - label: "Step 5: TH sends command SetTemperatureCommand with a temperature - number between minTemp and maxTemp inclusive, saved as setTemp." + number between minTemp and maxTemp inclusive, saved as setTemp" + command: "SetTemperature" PICS: TCTL.S.C00.Rsp - verification: | - ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperature <5> - On TH(chip-tool), Verify that the DUT response contains SUCCESS - [1692260094.059761][13707:13710] CHIP:DMG: ICR moving to [ResponseRe] - [1692260094.059828][13707:13710] CHIP:DMG: InvokeResponseMessage = - [1692260094.059862][13707:13710] CHIP:DMG: { - [1692260094.059895][13707:13710] CHIP:DMG: suppressResponse = false, - [1692260094.059929][13707:13710] CHIP:DMG: InvokeResponseIBs = - [1692260094.059971][13707:13710] CHIP:DMG: [ - [1692260094.060005][13707:13710] CHIP:DMG: InvokeResponseIB = - [1692260094.060051][13707:13710] CHIP:DMG: { - [1692260094.060094][13707:13710] CHIP:DMG: CommandStatusIB = - [1692260094.060134][13707:13710] CHIP:DMG: { - [1692260094.060173][13707:13710] CHIP:DMG: CommandPathIB = - [1692260094.060217][13707:13710] CHIP:DMG: { - [1692260094.060261][13707:13710] CHIP:DMG: EndpointId = 0x1, - [1692260094.060310][13707:13710] CHIP:DMG: ClusterId = 0x56, - [1692260094.060356][13707:13710] CHIP:DMG: CommandId = 0x0, - [1692260094.060402][13707:13710] CHIP:DMG: }, - [1692260094.060452][13707:13710] CHIP:DMG: - [1692260094.060493][13707:13710] CHIP:DMG: StatusIB = - [1692260094.060539][13707:13710] CHIP:DMG: { - [1692260094.060584][13707:13710] CHIP:DMG: status = 0x00 (SUCCESS), - [1692260094.060629][13707:13710] CHIP:DMG: }, - [1692260094.060674][13707:13710] CHIP:DMG: - [1692260094.060712][13707:13710] CHIP:DMG: }, - [1692260094.060756][13707:13710] CHIP:DMG: - [1692260094.060792][13707:13710] CHIP:DMG: }, - [1692260094.060834][13707:13710] CHIP:DMG: - [1692260094.060867][13707:13710] CHIP:DMG: ], - [1692260094.060909][13707:13710] CHIP:DMG: - [1692260094.060942][13707:13710] CHIP:DMG: InteractionModelRevision = 10 - [1692260094.060975][13707:13710] CHIP:DMG: }, - [1692260094.061064][13707:13710] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x85 - [1692260094.061110][13707:13710] CHIP:TOO: Error: IM Error 0x00000585: General error: 0x85 (INVALID_COMMAND) - disabled: true - - - label: - "Step 6: After a few seconds, TH reads from the DUT the - TemperatureSetpoint attribute." + arguments: + values: + - name: "TargetTemperature" + value: Step_5_setTemp + + - label: "Wait for 5s" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 5000 + + - label: "Step 6: TH reads from the DUT the TemperatureSetpoint attribute" PICS: TCTL.S.A0000 - verification: | - After a few seconds, please send the below mentioned command to read TemperatureSetpoint attribute from TH to DUT - - ./chip-tool temperaturecontrol read temperature-setpoint 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 5 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "TemperatureSetpoint" + response: + value: Step_5_setTemp - label: - "Step 7: TH sends command SetTemperatureCommand with an invalid value." + "Step 7: TH sends command SetTemperatureCommand with an invalid value" PICS: TCTL.S.C00.Rsp - verification: | - ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperature <100> - On TH(chip-tool), Verify DUT responds with status CONSTRAINT_ERROR(0x87) - [1692260094.059761][13707:13710] CHIP:DMG: ICR moving to [ResponseRe] - [1692260094.059828][13707:13710] CHIP:DMG: InvokeResponseMessage = - [1692260094.059862][13707:13710] CHIP:DMG: { - [1692260094.059895][13707:13710] CHIP:DMG: suppressResponse = false, - [1692260094.059929][13707:13710] CHIP:DMG: InvokeResponseIBs = - [1692260094.059971][13707:13710] CHIP:DMG: [ - [1692260094.060005][13707:13710] CHIP:DMG: InvokeResponseIB = - [1692260094.060051][13707:13710] CHIP:DMG: { - [1692260094.060094][13707:13710] CHIP:DMG: CommandStatusIB = - [1692260094.060134][13707:13710] CHIP:DMG: { - [1692260094.060173][13707:13710] CHIP:DMG: CommandPathIB = - [1692260094.060217][13707:13710] CHIP:DMG: { - [1692260094.060261][13707:13710] CHIP:DMG: EndpointId = 0x1, - [1692260094.060310][13707:13710] CHIP:DMG: ClusterId = 0x56, - [1692260094.060356][13707:13710] CHIP:DMG: CommandId = 0x0, - [1692260094.060402][13707:13710] CHIP:DMG: }, - [1692260094.060452][13707:13710] CHIP:DMG: - [1692260094.060493][13707:13710] CHIP:DMG: StatusIB = - [1692260094.060539][13707:13710] CHIP:DMG: { - [1692260094.060584][13707:13710] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1692260094.060629][13707:13710] CHIP:DMG: }, - [1692260094.060674][13707:13710] CHIP:DMG: - [1692260094.060712][13707:13710] CHIP:DMG: }, - [1692260094.060756][13707:13710] CHIP:DMG: - [1692260094.060792][13707:13710] CHIP:DMG: }, - [1692260094.060834][13707:13710] CHIP:DMG: - [1692260094.060867][13707:13710] CHIP:DMG: ], - [1692260094.060909][13707:13710] CHIP:DMG: - [1692260094.060942][13707:13710] CHIP:DMG: InteractionModelRevision = 10 - [1692260094.060975][13707:13710] CHIP:DMG: }, - [1692260094.061064][13707:13710] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x85 - [1692260094.061110][13707:13710] CHIP:TOO: Error: IM Error 0x00000585: General error: 0x85 (INVALID_COMMAND) - disabled: true - - - label: - "Step 8: After a few seconds, TH reads from the DUT the - TemperatureSetpoint attribute." + command: "SetTemperature" + arguments: + values: + - name: "TargetTemperature" + value: InvalidTemp + response: + error: CONSTRAINT_ERROR + + - label: "Wait for 5s" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 5000 + + - label: "Step 8: TH reads from the DUT the TemperatureSetpoint attribute" PICS: TCTL.S.A0000 - verification: | - After a few seconds, please send the below mentioned command to read TemperatureSetpoint attribute from TH to DUT - - ./chip-tool temperaturecontrol read temperature-setpoint 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 5 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "TemperatureSetpoint" + response: + value: Step_5_setTemp - label: "Step 9: Operate device such that a temperature number cannot be accepted" - PICS: TCTL.S.M.SupportsInvalidInMode verification: | Operate device such that a temperature number cannot be accepted - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && TCTL.S.M.SupportsInvalidInMode + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 10: TH sends command SetTemperatureCommand with a temperature - number between minTemp and maxTemp inclusive that is different from - setTemp." - PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.C00.Rsp - verification: | - ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperature <50> - On TH(Chip-tool), Verify that the DUT response contains INVALID_IN_MODE - [1692260094.059761][13707:13710] CHIP:DMG: ICR moving to [ResponseRe] - [1692260094.059828][13707:13710] CHIP:DMG: InvokeResponseMessage = - [1692260094.059862][13707:13710] CHIP:DMG: { - [1692260094.059895][13707:13710] CHIP:DMG: suppressResponse = false, - [1692260094.059929][13707:13710] CHIP:DMG: InvokeResponseIBs = - [1692260094.059971][13707:13710] CHIP:DMG: [ - [1692260094.060005][13707:13710] CHIP:DMG: InvokeResponseIB = - [1692260094.060051][13707:13710] CHIP:DMG: { - [1692260094.060094][13707:13710] CHIP:DMG: CommandStatusIB = - [1692260094.060134][13707:13710] CHIP:DMG: { - [1692260094.060173][13707:13710] CHIP:DMG: CommandPathIB = - [1692260094.060217][13707:13710] CHIP:DMG: { - [1692260094.060261][13707:13710] CHIP:DMG: EndpointId = 0x1, - [1692260094.060310][13707:13710] CHIP:DMG: ClusterId = 0x56, - [1692260094.060356][13707:13710] CHIP:DMG: CommandId = 0x0, - [1692260094.060402][13707:13710] CHIP:DMG: }, - [1692260094.060452][13707:13710] CHIP:DMG: - [1692260094.060493][13707:13710] CHIP:DMG: StatusIB = - [1692260094.060539][13707:13710] CHIP:DMG: { - [1692260094.060584][13707:13710] CHIP:DMG: status = 0x03(INVALID_IN_MODE) - [1692260094.060629][13707:13710] CHIP:DMG: }, - [1692260094.060674][13707:13710] CHIP:DMG: - [1692260094.060712][13707:13710] CHIP:DMG: }, - [1692260094.060756][13707:13710] CHIP:DMG: - [1692260094.060792][13707:13710] CHIP:DMG: }, - [1692260094.060834][13707:13710] CHIP:DMG: - [1692260094.060867][13707:13710] CHIP:DMG: ], - [1692260094.060909][13707:13710] CHIP:DMG: - [1692260094.060942][13707:13710] CHIP:DMG: InteractionModelRevision = 10 - [1692260094.060975][13707:13710] CHIP:DMG: }, - [1692260094.061064][13707:13710] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x85 - [1692260094.061110][13707:13710] CHIP:TOO: Error: IM Error 0x00000585: General error: 0x85 (INVALID_COMMAND) - disabled: true - - - label: - "Step 11: after a few seconds, TH reads from the DUT the - TemperatureSetpoint attribute." - PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.A0000 - verification: | - After a few seconds, please send the below mentioned command to read TemperatureSetpoint attribute from TH to DUT - - ./chip-tool temperaturecontrol read temperature-setpoint 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setTemp value written in step 5 - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 5 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + number between minTemp and maxTemp inclusive, saved as setTemp" + command: "SetTemperature" + PICS: TCTL.S.C00.Rsp && PICS_USER_PROMPT && TCTL.S.M.SupportsInvalidInMode + arguments: + values: + - name: "TargetTemperature" + value: Step_10_setTemp + response: + error: INVALID_IN_STATE + + - label: "Wait for 5s" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 5000 + + - label: "Step 11: TH reads from the DUT the TemperatureSetpoint attribute" + PICS: TCTL.S.A0000 && TCTL.S.M.SupportsInvalidInMode + command: "readAttribute" + attribute: "TemperatureSetpoint" + response: + value: Step_5_setTemp diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml index 965a96aa6d4dae..bca4e83790ee2b 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_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: 178.2.5. [TC-TCTL-3.3] Optional temperature level functionality with DUT as @@ -23,123 +22,117 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Temperature Control" + endpoint: 1 + Step_4_setLevel: + type: int8u + defaultValue: 1 + Step_7_setLevel: + type: int8u + defaultValue: 3 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. - - While verifying below test case we will get 0 and null value for few attributes, as per spec 0 and null value is default for those attributes. - disabled: true - - - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true + - 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: Operate device such that a temperature level can be accepted" verification: | Operate device such that a temperature level can be accepted - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 3: TH reads from the DUT the SupportedTemperatureLevels attribute" PICS: TCTL.S.A0005 - verification: | - ./chip-tool temperaturecontrol read supported-temperature-levels 1 1 - On TH(chip-tool), Verify that the DUT response contains a list of up to 32 strings with each string length not exceeding 16 characters. - [1689770716.974439][9291:9293] CHIP:DMG: SuppressResponse = true, - [1689770716.974446][9291:9293] CHIP:DMG: InteractionModelRevision = 1 - [1689770716.974451][9291:9293] CHIP:DMG: } - [1689770716.974558][9291:9293] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0005 DataVersion: 2844459846 - [1689770716.974594][9291:9293] CHIP:TOO: SupportedTemperatureLevels: 3 entries - [1689770716.974607][9291:9293] CHIP:TOO: [1]: Hot - [1689770716.974614][9291:9293] CHIP:TOO: [2]: Warm - [1689770716.974620][9291:9293] CHIP:TOO: [3]: Freezing - [1689770716.974685][9291:9293] CHIP:EM: <<< [E:59031i S:44407 M:101895658 (Ack:80765321)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689770716.974699][9291:9293] CHIP:IN: (S) Sending msg 101895658 on secure session with LSID: 44407 - [1689770716.974728][9291:9293] CHIP:EM: Flushed pending ack for MessageCounter:80765321 on exchange 59031i - disabled: true + command: "readAttribute" + attribute: "SupportedTemperatureLevels" + response: + saveAs: supportedLevels + constraints: + type: list - label: "Step 4: TH sends command SetTemperatureCommand with a value from supportedLevels saved as setLevel" PICS: TCTL.S.C00.Rsp - verification: | - ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperatureLevel 1 - On TH(chip-tool), Verify that the DUT response contains SUCCESS - [1692265679.055214][13978:13980] CHIP:DMG: ], - [1692265679.055279][13978:13980] CHIP:DMG: - [1692265679.055306][13978:13980] CHIP:DMG: InteractionModelRevision = 10 - [1692265679.055329][13978:13980] CHIP:DMG: }, - [1692265679.055422][13978:13980] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x0 - [1692265679.055501][13978:13980] CHIP:DMG: ICR moving to [AwaitingDe] - [1692265679.055673][13978:13980] CHIP:EM: <<< [E:45460i S:40447 M:82497399 (Ack:231075843)] (S) Msg TX to 1:0000000000000001 [6311] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1692265679.055722][13978:13980] CHIP:IN: (S) Sending msg 82497399 on secure session with LSID: 40447 - disabled: true + command: "SetTemperature" + arguments: + values: + - name: "TargetTemperatureLevel" + value: Step_4_setLevel - - label: - "Step 5: After a few seconds, TH reads from the DUT the - SelectedTemperatureLevel attribute" - PICS: TCTL.S.A0004 - verification: | - After a few seconds, please send the below mentioned command to read SelectedTemperatureLevel attribute from TH to DUT + - label: "Wait for 5s" + PICS: TCTL.S.C00.Rsp + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 5000 - ./chip-tool temperaturecontrol read selected-temperature-level 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setLevel value written in step 4 - [1692265713.881978][13985:13987] CHIP:DMG: } - [1692265713.882145][13985:13987] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0004 DataVersion: 3892542637 - [1692265713.882212][13985:13987] CHIP:TOO: SelectedTemperatureLevel: 1 - [1692265713.882429][13985:13987] CHIP:EM: <<< [E:46803i S:60267 M:79585227 (Ack:218909199)] (S) Msg TX to 1:0000000000000001 [6311] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1692265713.882475][13985:13987] CHIP:IN: (S) Sending msg 79585227 on secure session with LSID: 60267 - [1692265713.882578][13985:13987] CHIP:EM: Flushed pending ack for MessageCounter:218909199 on exchange 46803i - disabled: true + - label: + "Step 5: TH reads from the DUT the SelectedTemperatureLevel attribute" + PICS: TCTL.S.A0004 && TCTL.S.C00.Rsp + command: "readAttribute" + attribute: "SelectedTemperatureLevel" + response: + value: Step_4_setLevel - label: - "Step 6: Operate device such that a temperature level cannot be + "Step 6:Operate device such that a temperature level cannot be accepted" - PICS: TCTL.S.M.SupportsInvalidInMode verification: | Operate device such that a temperature level cannot be accepted - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && TCTL.S.M.SupportsInvalidInMode + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" - label: - "Step 7: TH sends command SetTemperatureCommand with a value from - supportedLevels that is different from setLevel" - PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.C00.Rsp - verification: | - ./chip-tool temperaturecontrol set-temperature 1 1 --TargetTemperatureLevel 3 - On TH(chip-tool), Verify that the DUT response contains CONSTRAINT_ERROR - [1692265766.674998][13994:13996] CHIP:DMG: - [1692265766.675028][13994:13996] CHIP:DMG: InteractionModelRevision = 10 - [1692265766.675058][13994:13996] CHIP:DMG: }, - [1692265766.675136][13994:13996] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0056 Command=0x0000_0000 Status=0x87 - [1692265766.675180][13994:13996] CHIP:TOO: Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1692265766.675227][13994:13996] CHIP:DMG: ICR moving to [AwaitingDe] - [1692265766.675356][13994:13996] CHIP:EM: <<< [E:29432i S:48831 M:234714759 (Ack:36101797)] (S) Msg TX to 1:0000000000000001 [6311] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1692265766.675409][13994:13996] CHIP:IN: (S) Sending msg 234714759 on secure session with LSID: 48831 - [1692265766.675519][13994:13996] CHIP:EM: Flushed pending ack for MessageCounter:36101797 on exchange 29432i - disabled: true + "Step 7: TH sends command SetTemperatureCommand with an invalid value" + PICS: TCTL.S.C00.Rsp && TCTL.S.M.SupportsInvalidInMode + command: "SetTemperature" + arguments: + values: + - name: "TargetTemperatureLevel" + value: Step_7_setLevel + response: + error: CONSTRAINT_ERROR + + - label: "Wait for 5s" + PICS: TCTL.S.C00.Rsp && TCTL.S.M.SupportsInvalidInMode + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 5000 - label: - "Step 8: after a few seconds, TH reads from the DUT the - SelectedTemperatureLevel attribute" - PICS: TCTL.S.M.SupportsInvalidInMode && TCTL.S.A0004 - verification: | - After a few seconds, please send the below mentioned command to read SelectedTemperatureLevel attribute from TH to DUT - - ./chip-tool temperaturecontrol read selected-temperature-level 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperatureValue and the value is the same setLevel value written in step 4 - [1692265822.762570][14005:14007] CHIP:DMG: SuppressResponse = true, - [1692265822.762602][14005:14007] CHIP:DMG: InteractionModelRevision = 10 - [1692265822.762631][14005:14007] CHIP:DMG: } - [1692265822.762811][14005:14007] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0004 DataVersion: 3892542639 - [1692265822.762940][14005:14007] CHIP:TOO: SelectedTemperatureLevel: 1 - [1692265822.763134][14005:14007] CHIP:EM: <<< [E:14178i S:20433 M:165826928 (Ack:66881663)] (S) Msg TX to 1:0000000000000001 [6311] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1692265822.763186][14005:14007] CHIP:IN: (S) Sending msg 165826928 on secure session with LSID: 20433 - [1692265822.763307][14005:14007] CHIP:EM: Flushed pending ack for MessageCounter:66881663 on exchange 14178i - disabled: true + "Step 8: TH reads from the DUT the SelectedTemperatureLevel attribute" + PICS: TCTL.S.A0004 && TCTL.S.M.SupportsInvalidInMode + command: "readAttribute" + attribute: "SelectedTemperatureLevel" + response: + value: Step_4_setLevel diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 577bc287065a3d..d5e5ceb7ba0c18 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -2599,9 +2599,9 @@ TCTL.S.A0003=0 TCTL.S.A0004=1 TCTL.S.A0005=1 TCC.M.ManuallyControlledTemperature=1 -TCTL.S.M.SupportsInvalidInMode=1 -TCTL.S.C00.Rsp=1 -TCTL.C.C00.Tx=1 +TCTL.S.M.SupportsInvalidInMode=0 +TCTL.S.C00.Rsp=0 +TCTL.C.C00.Tx=0 #Washer Controls WASHERCTRL.S=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 18a069f267e33e..fe87af67ad18de 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -107,7 +107,13 @@ "Test_TC_ULABEL_2_3", "Test_TC_ULABEL_2_4" ], - "LaundryWasherMode": ["Test_TC_LWM_1_1", "Test_TC_LWM_2_1"], + "LaundryWasherMode": [ + "Test_TC_LWM_1_1", + "Test_TC_LWM_2_1", + "Test_TC_LWM_3_1", + "Test_TC_LWM_3_2", + "Test_TC_LWM_3_3" + ], "LaundryWasherControl": [ "Test_TC_WASHERCTRL_1_1", "Test_TC_WASHERCTRL_2_1", @@ -207,7 +213,9 @@ "Test_TC_TCTL_1_1", "Test_TC_TCTL_2_1", "Test_TC_TCTL_2_2", - "Test_TC_TCTL_2_3" + "Test_TC_TCTL_2_3", + "Test_TC_TCTL_3_2", + "Test_TC_TCTL_3_3" ], "TemperatureMeasurement": ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"], "Thermostat": ["Test_TC_TSTAT_1_1", "Test_TC_TSTAT_2_1"], diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 74e1d33ba99fdd..7ea2b10c4a0f50 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -258,11 +258,7 @@ "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2"], "LocalizationConfiguration": [], "LevelControl": [], - "LaundryWasherMode": [ - "Test_TC_LWM_1_2", - "Test_TC_LWM_3_2", - "Test_TC_LWM_3_3" - ], + "LaundryWasherMode": ["Test_TC_LWM_1_2"], "OnOff": ["Test_TC_OO_2_3"], "OperationalState": ["Test_TC_OPSTATE_2_2"], "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], @@ -276,7 +272,7 @@ "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"], + "TemperatureControl": [], "TemperatureMeasurement": ["Test_TC_TMP_2_2"], "Thermostat": ["Test_TC_TSTAT_3_2"], "ThermostatUserConfiguration": [], 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 66ba73d3badbf2..1ef76098ee8244 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -207,6 +207,8 @@ class TestList : public Command { printf("Test_TC_TCTL_1_1\n"); printf("Test_TC_TCTL_2_2\n"); printf("Test_TC_TCTL_2_3\n"); + printf("Test_TC_TCTL_3_2\n"); + printf("Test_TC_TCTL_3_3\n"); printf("Test_TC_TMP_1_1\n"); printf("Test_TC_TMP_2_1\n"); printf("Test_TC_TSTAT_1_1\n"); @@ -102250,6 +102252,835 @@ class Test_TC_TCTL_2_3 : public TestCommandBridge { } }; +class Test_TC_TCTL_3_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TCTL_3_2() + : TestCommandBridge("Test_TC_TCTL_3_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("Step_5_setTemp", INT16_MIN, INT16_MAX, &mStep5SetTemp); + AddArgument("InvalidTemp", INT16_MIN, INT16_MAX, &mInvalidTemp); + AddArgument("Step_10_setTemp", INT16_MIN, INT16_MAX, &mStep10SetTemp); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TCTL_3_2() + { + } + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TCTL_3_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TCTL_3_2\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: Operate device such that a temperature number can be accepted\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep2OperateDeviceSuchThatATemperatureNumberCanBeAccepted_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the MinTemperature attribute\n"); + if (ShouldSkip("TCTL.S.A0001")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheMinTemperatureAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH reads from the DUT the MaxTemperature attribute\n"); + if (ShouldSkip("TCTL.S.A0002")) { + NextTest(); + return; + } + err = TestStep4ThReadsFromTheDutTheMaxTemperatureAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 5: TH sends command SetTemperatureCommand with a temperature number between minTemp and maxTemp inclusive, saved as setTemp\n"); + if (ShouldSkip("TCTL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep5ThSendsCommandSetTemperatureCommandWithATemperatureNumberBetweenMinTempAndMaxTempInclusiveSavedAsSetTemp_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for 5s\n"); + err = TestWaitFor5s_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: TH reads from the DUT the TemperatureSetpoint attribute\n"); + if (ShouldSkip("TCTL.S.A0000")) { + NextTest(); + return; + } + err = TestStep6ThReadsFromTheDutTheTemperatureSetpointAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH sends command SetTemperatureCommand with an invalid value\n"); + if (ShouldSkip("TCTL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep7ThSendsCommandSetTemperatureCommandWithAnInvalidValue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait for 5s\n"); + err = TestWaitFor5s_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 8: TH reads from the DUT the TemperatureSetpoint attribute\n"); + if (ShouldSkip("TCTL.S.A0000")) { + NextTest(); + return; + } + err = TestStep8ThReadsFromTheDutTheTemperatureSetpointAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 9: Operate device such that a temperature number cannot be accepted\n"); + if (ShouldSkip("PICS_USER_PROMPT && TCTL.S.M.SupportsInvalidInMode")) { + NextTest(); + return; + } + err = TestStep9OperateDeviceSuchThatATemperatureNumberCannotBeAccepted_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 10: TH sends command SetTemperatureCommand with a temperature number between minTemp and maxTemp inclusive, saved as setTemp\n"); + if (ShouldSkip("TCTL.S.C00.Rsp && PICS_USER_PROMPT && TCTL.S.M.SupportsInvalidInMode")) { + NextTest(); + return; + } + err = TestStep10ThSendsCommandSetTemperatureCommandWithATemperatureNumberBetweenMinTempAndMaxTempInclusiveSavedAsSetTemp_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for 5s\n"); + err = TestWaitFor5s_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Step 11: TH reads from the DUT the TemperatureSetpoint attribute\n"); + if (ShouldSkip("TCTL.S.A0000 && TCTL.S.M.SupportsInvalidInMode")) { + NextTest(); + return; + } + err = TestStep11ThReadsFromTheDutTheTemperatureSetpointAttribute_13(); + 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), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + 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; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_IN_STATE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + 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 = 14; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mStep5SetTemp; + chip::Optional mInvalidTemp; + chip::Optional mStep10SetTemp; + 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 TestStep2OperateDeviceSuchThatATemperatureNumberCanBeAccepted_1() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + NSNumber * _Nonnull minTemp; + + CHIP_ERROR TestStep3ThReadsFromTheDutTheMinTemperatureAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 3: TH reads from the DUT the MinTemperature attribute: Error: %@", err); + } else { + NSLog(@"Step 3: TH reads from the DUT the MinTemperature attribute: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minTemperature", "temperature", "temperature")); + { + minTemp = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull maxTemp; + + CHIP_ERROR TestStep4ThReadsFromTheDutTheMaxTemperatureAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 4: TH reads from the DUT the MaxTemperature attribute: Error: %@", err); + } else { + NSLog(@"Step 4: TH reads from the DUT the MaxTemperature attribute: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxTemperature", "temperature", "temperature")); + { + maxTemp = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5ThSendsCommandSetTemperatureCommandWithATemperatureNumberBetweenMinTempAndMaxTempInclusiveSavedAsSetTemp_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRTemperatureControlClusterSetTemperatureParams alloc] init]; + params.targetTemperature = mStep5SetTemp.HasValue() ? [NSNumber numberWithShort:mStep5SetTemp.Value()] : [NSNumber numberWithShort:5]; + [cluster setTemperatureWithParams:params completion: + ^(NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 5: TH sends command SetTemperatureCommand with a temperature number between minTemp and maxTemp inclusive, saved as setTemp: Error: %@", err); + } else { + NSLog(@"Step 5: TH sends command SetTemperatureCommand with a temperature number between minTemp and maxTemp inclusive, saved as setTemp: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitFor5s_5() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep6ThReadsFromTheDutTheTemperatureSetpointAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTemperatureSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 6: TH reads from the DUT the TemperatureSetpoint attribute: Error: %@", err); + } else { + NSLog(@"Step 6: TH reads from the DUT the TemperatureSetpoint attribute: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TemperatureSetpoint", actualValue, mStep5SetTemp.HasValue() ? mStep5SetTemp.Value() : 5)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7ThSendsCommandSetTemperatureCommandWithAnInvalidValue_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRTemperatureControlClusterSetTemperatureParams alloc] init]; + params.targetTemperature = mInvalidTemp.HasValue() ? [NSNumber numberWithShort:mInvalidTemp.Value()] : [NSNumber numberWithShort:100]; + [cluster setTemperatureWithParams:params completion: + ^(NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 7: TH sends command SetTemperatureCommand with an invalid value: Error: %@", err); + } else { + NSLog(@"Step 7: TH sends command SetTemperatureCommand with an invalid value: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitFor5s_8() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep8ThReadsFromTheDutTheTemperatureSetpointAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTemperatureSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 8: TH reads from the DUT the TemperatureSetpoint attribute: Error: %@", err); + } else { + NSLog(@"Step 8: TH reads from the DUT the TemperatureSetpoint attribute: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TemperatureSetpoint", actualValue, mStep5SetTemp.HasValue() ? mStep5SetTemp.Value() : 5)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep9OperateDeviceSuchThatATemperatureNumberCannotBeAccepted_10() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep10ThSendsCommandSetTemperatureCommandWithATemperatureNumberBetweenMinTempAndMaxTempInclusiveSavedAsSetTemp_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRTemperatureControlClusterSetTemperatureParams alloc] init]; + params.targetTemperature = mStep10SetTemp.HasValue() ? [NSNumber numberWithShort:mStep10SetTemp.Value()] : [NSNumber numberWithShort:50]; + [cluster setTemperatureWithParams:params completion: + ^(NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 10: TH sends command SetTemperatureCommand with a temperature number between minTemp and maxTemp inclusive, saved as setTemp: Error: %@", err); + } else { + NSLog(@"Step 10: TH sends command SetTemperatureCommand with a temperature number between minTemp and maxTemp inclusive, saved as setTemp: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, EMBER_ZCL_STATUS_INVALID_IN_STATE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitFor5s_12() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep11ThReadsFromTheDutTheTemperatureSetpointAttribute_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTemperatureSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 11: TH reads from the DUT the TemperatureSetpoint attribute: Error: %@", err); + } else { + NSLog(@"Step 11: TH reads from the DUT the TemperatureSetpoint attribute: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("TemperatureSetpoint", actualValue, mStep5SetTemp.HasValue() ? mStep5SetTemp.Value() : 5)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCTL_3_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TCTL_3_3() + : TestCommandBridge("Test_TC_TCTL_3_3") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("Step_4_setLevel", 0, UINT8_MAX, &mStep4SetLevel); + AddArgument("Step_7_setLevel", 0, UINT8_MAX, &mStep7SetLevel); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TCTL_3_3() + { + } + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TCTL_3_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TCTL_3_3\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: Operate device such that a temperature level can be accepted\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestStep2OperateDeviceSuchThatATemperatureLevelCanBeAccepted_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the SupportedTemperatureLevels attribute\n"); + if (ShouldSkip("TCTL.S.A0005")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheSupportedTemperatureLevelsAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH sends command SetTemperatureCommand with a value from supportedLevels saved as setLevel\n"); + if (ShouldSkip("TCTL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep4ThSendsCommandSetTemperatureCommandWithAValueFromSupportedLevelsSavedAsSetLevel_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Wait for 5s\n"); + if (ShouldSkip("TCTL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestWaitFor5s_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5: TH reads from the DUT the SelectedTemperatureLevel attribute\n"); + if (ShouldSkip("TCTL.S.A0004 && TCTL.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestStep5ThReadsFromTheDutTheSelectedTemperatureLevelAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6:Operate device such that a temperature level cannot be accepted\n"); + if (ShouldSkip("PICS_USER_PROMPT && TCTL.S.M.SupportsInvalidInMode")) { + NextTest(); + return; + } + err = TestStep6OperateDeviceSuchThatATemperatureLevelCannotBeAccepted_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7: TH sends command SetTemperatureCommand with an invalid value\n"); + if (ShouldSkip("TCTL.S.C00.Rsp && TCTL.S.M.SupportsInvalidInMode")) { + NextTest(); + return; + } + err = TestStep7ThSendsCommandSetTemperatureCommandWithAnInvalidValue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait for 5s\n"); + if (ShouldSkip("TCTL.S.C00.Rsp && TCTL.S.M.SupportsInvalidInMode")) { + NextTest(); + return; + } + err = TestWaitFor5s_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 8: TH reads from the DUT the SelectedTemperatureLevel attribute\n"); + if (ShouldSkip("TCTL.S.A0004 && TCTL.S.M.SupportsInvalidInMode")) { + NextTest(); + return; + } + err = TestStep8ThReadsFromTheDutTheSelectedTemperatureLevelAttribute_9(); + 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), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + 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; + } + + // 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 = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mStep4SetLevel; + chip::Optional mStep7SetLevel; + 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 TestStep2OperateDeviceSuchThatATemperatureLevelCanBeAccepted_1() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + NSArray * _Nonnull supportedLevels; + + CHIP_ERROR TestStep3ThReadsFromTheDutTheSupportedTemperatureLevelsAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSupportedTemperatureLevelsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 3: TH reads from the DUT the SupportedTemperatureLevels attribute: Error: %@", err); + } else { + NSLog(@"Step 3: TH reads from the DUT the SupportedTemperatureLevels attribute: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("supportedTemperatureLevels", "list", "list")); + { + supportedLevels = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4ThSendsCommandSetTemperatureCommandWithAValueFromSupportedLevelsSavedAsSetLevel_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRTemperatureControlClusterSetTemperatureParams alloc] init]; + params.targetTemperatureLevel = mStep4SetLevel.HasValue() ? [NSNumber numberWithUnsignedChar:mStep4SetLevel.Value()] : [NSNumber numberWithUnsignedChar:1U]; + [cluster setTemperatureWithParams:params completion: + ^(NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 4: TH sends command SetTemperatureCommand with a value from supportedLevels saved as setLevel: Error: %@", err); + } else { + NSLog(@"Step 4: TH sends command SetTemperatureCommand with a value from supportedLevels saved as setLevel: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitFor5s_4() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep5ThReadsFromTheDutTheSelectedTemperatureLevelAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSelectedTemperatureLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 5: TH reads from the DUT the SelectedTemperatureLevel attribute: Error: %@", err); + } else { + NSLog(@"Step 5: TH reads from the DUT the SelectedTemperatureLevel attribute: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("SelectedTemperatureLevel", actualValue, mStep4SetLevel.HasValue() ? mStep4SetLevel.Value() : 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6OperateDeviceSuchThatATemperatureLevelCannotBeAccepted_6() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep7ThSendsCommandSetTemperatureCommandWithAnInvalidValue_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRTemperatureControlClusterSetTemperatureParams alloc] init]; + params.targetTemperatureLevel = mStep7SetLevel.HasValue() ? [NSNumber numberWithUnsignedChar:mStep7SetLevel.Value()] : [NSNumber numberWithUnsignedChar:3U]; + [cluster setTemperatureWithParams:params completion: + ^(NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 7: TH sends command SetTemperatureCommand with an invalid value: Error: %@", err); + } else { + NSLog(@"Step 7: TH sends command SetTemperatureCommand with an invalid value: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitFor5s_8() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep8ThReadsFromTheDutTheSelectedTemperatureLevelAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSelectedTemperatureLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + if (err != nil) { + NSLog(@"Step 8: TH reads from the DUT the SelectedTemperatureLevel attribute: Error: %@", err); + } else { + NSLog(@"Step 8: TH reads from the DUT the SelectedTemperatureLevel attribute: Success"); + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("SelectedTemperatureLevel", actualValue, mStep4SetLevel.HasValue() ? mStep4SetLevel.Value() : 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_TMP_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -194072,6 +194903,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),