diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index d3d9dcb2f04581..0d4527d435aad8 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -52,6 +52,7 @@ "Disabled because darwin-framework-tool does not support GetCommissionerRootCertificate", "Test_AddNewFabricFromExistingFabric", "Disabled because darwin-framework-tool does not support EqualityCommands pseudo-cluster", + "Test_TC_S_2_2", "Test_TC_TCCM_3_1", "Test_TC_TCTL_2_1", "Disabled because darwin-framework-tool does not support constraints arithmetic operations", diff --git a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml index 89643913ad6c77..f084d75cdc5370 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml @@ -29,13 +29,6 @@ config: type: group_id defaultValue: 0x0002 - GroupKeyManagementEndpoint: - type: int16u - defaultValue: 0 - GroupsEndpoint: - type: int16u - defaultValue: 0 - tests: - label: "Wait for the commissioned device to be retrieved" cluster: "DelayCommands" @@ -58,7 +51,7 @@ tests: "Step 0a: preparation step for using commands from Groups cluster: Add KeySet" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "KeySetWrite" arguments: values: @@ -79,7 +72,7 @@ tests: "Step 0b: Preparation step for using commands from Groups cluster: Write Group Keys" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "writeAttribute" attribute: "GroupKeyMap" arguments: @@ -92,7 +85,7 @@ tests: - label: "Step 0c: TH sends a RemoveAllGroups command to DUT." PICS: G.S.C04.Rsp cluster: "Groups" - endpoint: GroupsEndpoint + endpoint: endpoint command: "RemoveAllGroups" - label: @@ -334,7 +327,7 @@ tests: - label: "Step 4a: Reboot target device" PICS: PICS_SDK_CI_ONLY cluster: "SystemCommands" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "Reboot" - label: "Step 4a: Reboot target device(DUT)" @@ -900,9 +893,9 @@ tests: command: "UnsignedNumberEquals" arguments: values: - - name: "value1" + - name: "Value1" value: 0x00 - - name: "value2" + - name: "Value2" value: StoreStatus response: - values: @@ -1053,9 +1046,9 @@ tests: command: "UnsignedNumberEquals" arguments: values: - - name: "value1" + - name: "Value1" value: 0x00 - - name: "value2" + - name: "Value2" value: StoredStatus response: - values: @@ -1088,7 +1081,7 @@ tests: KeySetRemove command to the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01a1" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "KeySetRemove" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml index e08a302edbc878..5e0b5d21fa41ad 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml @@ -26,10 +26,6 @@ config: type: group_id defaultValue: 0x0101 - GroupKeyManagementEndpoint: - type: int16u - defaultValue: 0 - tests: - label: "Wait for the commissioned device to be retrieved" cluster: "DelayCommands" @@ -52,7 +48,7 @@ tests: "Step 0a: preparation step for using commands from Groups cluster: Add KeySet" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "KeySetWrite" arguments: values: @@ -73,7 +69,7 @@ tests: "Step 0b: Preparation step for using commands from Groups cluster: Write Group Keys" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "writeAttribute" attribute: "GroupKeyMap" arguments: @@ -100,7 +96,7 @@ tests: - label: "Install ACLs" cluster: "Access Control" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "writeAttribute" attribute: "ACL" arguments: @@ -647,7 +643,7 @@ tests: KeySetRemove command to the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01a1" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "KeySetRemove" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_S_2_4.yaml b/src/app/tests/suites/certification/Test_TC_S_2_4.yaml index 93c4c8aa1fc360..6ee1346ce93e0a 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_4.yaml @@ -26,10 +26,6 @@ config: type: group_id defaultValue: 0x0001 - GroupKeyManagementEndpoint: - type: int16u - defaultValue: 0 - tests: - label: "Wait for the commissioned device to be retrieved" cluster: "DelayCommands" @@ -43,7 +39,7 @@ tests: "Step 0a: preparation step for using commands from Groups cluster: Add KeySet" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "KeySetWrite" arguments: values: @@ -64,7 +60,7 @@ tests: "Step 0b: Preparation step for using commands from Groups cluster: Write Group Keys" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "writeAttribute" attribute: "GroupKeyMap" arguments: @@ -423,7 +419,7 @@ tests: KeySetRemove command to the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01a1" cluster: "Group Key Management" - endpoint: GroupKeyManagementEndpoint + endpoint: 0 command: "KeySetRemove" arguments: values: 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 f8ec0d9fab7017..4990db406fc496 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -297,7 +297,6 @@ class TestList : public Command { printf("Test_TC_G_1_1\n"); printf("Test_TC_S_1_1\n"); printf("Test_TC_S_2_1\n"); - printf("Test_TC_S_2_2\n"); printf("Test_TC_S_2_3\n"); printf("Test_TC_S_2_4\n"); printf("TestActivatedCarbonFilterMonitoring\n"); @@ -172412,2193 +172411,6 @@ class Test_TC_S_2_1 : public TestCommandBridge { } }; -class Test_TC_S_2_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_S_2_2() - : TestCommandBridge("Test_TC_S_2_2") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("G1", 0, UINT16_MAX, &mG1); - AddArgument("G2", 0, UINT16_MAX, &mG2); - AddArgument("GroupKeyManagement.Endpoint", 0, UINT16_MAX, &mGroupKeyManagementEndpoint); - AddArgument("Groups.Endpoint", 0, UINT16_MAX, &mGroupsEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_S_2_2() - { - } - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_S_2_2\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_S_2_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 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the (0x0006) SceneTableSize attribute\n"); - if (ShouldSkip("S.S.A0006")) { - NextTest(); - return; - } - err = TestThReadsFromTheDutThe0x0006SceneTableSizeAttribute_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 0a: preparation step for using commands from Groups cluster: Add KeySet\n"); - err = TestStep0aPreparationStepForUsingCommandsFromGroupsClusterAddKeySet_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 0b: Preparation step for using commands from Groups cluster: Write Group Keys\n"); - err = TestStep0bPreparationStepForUsingCommandsFromGroupsClusterWriteGroupKeys_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 0c: TH sends a RemoveAllGroups command to DUT.\n"); - if (ShouldSkip("G.S.C04.Rsp")) { - NextTest(); - return; - } - err = TestStep0cThSendsARemoveAllGroupsCommandToDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 1a: TH sends a AddGroup command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("G.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep1aThSendsAAddGroupCommandToDutWithTheGroupIDFieldSetToG1_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 1b: TH sends a RemoveAllScenes command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("S.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestStep1bThSendsARemoveAllScenesCommandToDutWithTheGroupIDFieldSetToG1_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 1c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("S.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep1cThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : STep 2a: TH configures AC1 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestSTep2aThConfiguresAc1OnDutForAllImplementedApplicationClustersSupportingScenes_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2a: TH configures AC1 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep2aThConfiguresAc1OnDutForAllImplementedApplicationClustersSupportingScenes_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 2b: TH sends a StoreScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01.\n"); - if (ShouldSkip("S.S.C04.Rsp")) { - NextTest(); - return; - } - err = TestStep2bThSendsAStoreSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step 3a: TH configures AC2 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep3aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Step 3a: TH configures AC2 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep3aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 3b: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01.\n"); - if (ShouldSkip("S.S.C05.Rsp")) { - NextTest(); - return; - } - err = TestStep3bThSendsARecallSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Step 3c: TH reads the SceneCount attribute from DUT.\n"); - if (ShouldSkip("S.S.A0000 && S.S.A0001 && S.S.A0002 && S.S.A0003 && !S.S.F03")) { - NextTest(); - return; - } - err = TestStep3cThReadsTheSceneCountAttributeFromDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 3d: TH reads the CurrentScene attribute from DUT.\n"); - if (ShouldSkip("S.S.A0000 && S.S.A0001 && S.S.A0002 && S.S.A0003 && !S.S.F03")) { - NextTest(); - return; - } - err = TestStep3dThReadsTheCurrentSceneAttributeFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Step 3e: TH reads the CurrentGroup attribute from DUT.\n"); - if (ShouldSkip("S.S.A0000 && S.S.A0001 && S.S.A0002 && S.S.A0003 && !S.S.F03")) { - NextTest(); - return; - } - err = TestStep3eThReadsTheCurrentGroupAttributeFromDut_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Step 3f: TH reads the SceneValid attribute from DUT.\n"); - if (ShouldSkip("S.S.A0000 && S.S.A0001 && S.S.A0002 && S.S.A0003 && !S.S.F03")) { - NextTest(); - return; - } - err = TestStep3fThReadsTheSceneValidAttributeFromDut_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Step 3g: TH reads attribute SceneTableSize from DUT.\n"); - if (ShouldSkip("S.S.F03 && S.S.F02")) { - NextTest(); - return; - } - err = TestStep3gThReadsAttributeSceneTableSizeFromDut_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Step 3h: TH reads attribute FabricSceneInfo from DUT\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && S.S.F03 && S.S.F02")) { - NextTest(); - return; - } - err = TestStep3hThReadsAttributeFabricSceneInfoFromDut_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Step 4a: Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep4aRebootTargetDevice_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Step 4a: Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep4aRebootTargetDeviceDUT_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Step 4c: TH configures AC2 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep4cThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Step 4c: TH configures AC2 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep4cThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Step 4d: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01.\n"); - if (ShouldSkip("S.S.C05.Rsp")) { - NextTest(); - return; - } - err = TestStep4dThSendsARecallSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Step 5: TH sends a ViewScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01.\n"); - if (ShouldSkip("S.S.C01.Rsp && PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep5ThSendsAViewSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Step 5: TH sends a ViewScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01.\n"); - if (ShouldSkip("S.S.C01.Rsp && PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep5ThSendsAViewSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Step 6: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("S.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep6ThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Step 7a: TH sends a RemoveAllScenes command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("S.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestStep7aThSendsARemoveAllScenesCommandToDutWithTheGroupIDFieldSetToG1_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Step 7b: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("S.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep7bThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Step 8a: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to 0x0001 and a set of extension fields appropriate to AC1.\n"); - if (ShouldSkip("S.S.C00.Rsp && PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep8aThSendsAAddSceneCommandToDutWithTheGroupIDFieldSetToG1TheSceneIDFieldSetTo0x01TheTransitionTimeFieldSetTo0x0001AndASetOfExtensionFieldsAppropriateToAc1_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Step 8a: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to 0x0001 and a set of extension fields appropriate to AC1.\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep8aThSendsAAddSceneCommandToDutWithTheGroupIDFieldSetToG1TheSceneIDFieldSetTo0x01TheTransitionTimeFieldSetTo0x0001AndASetOfExtensionFieldsAppropriateToAc1_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Step 8b: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("S.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep8bThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Step 9a: TH sends a RemoveScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01.\n"); - if (ShouldSkip("S.S.C02.Rsp")) { - NextTest(); - return; - } - err = TestStep9aThSendsARemoveSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Step 9b: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("S.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep9bThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Step 10a: TH configures AC2 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep10aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Step 10a: TH configures AC2 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep10aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Step 10b: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01.\n"); - if (ShouldSkip("S.S.C05.Rsp")) { - NextTest(); - return; - } - err = TestStep10bThSendsARecallSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Step 11a: TH configures AC1 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep11aThConfiguresAc1OnDutForAllImplementedApplicationClustersSupportingScenes_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Step 11a: TH configures AC1 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep11aThConfiguresAc1OnDutForAllImplementedApplicationClustersSupportingScenes_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Step 11b: TH sends a StoreScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01.\n"); - if (ShouldSkip("S.S.C04.Rsp")) { - NextTest(); - return; - } - err = TestStep11bThSendsAStoreSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Step 12a: TH configures AC2 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep12aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Step 12a: TH configures AC2 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep12aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Step 12b: TH sends a StoreScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x02.\n"); - if (ShouldSkip("S.S.C04.Rsp")) { - NextTest(); - return; - } - err = TestStep12bThSendsAStoreSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x02_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Verify that the status of previous command was either 0x00 (SUCCESS) or 0x89 (INSUFFICIENT_SPACE)\n"); - err = TestVerifyThatTheStatusOfPreviousCommandWasEither0x00SuccessOr0x89InsufficientSpace_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Step 12c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1.\n"); - if (ShouldSkip("S.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep12cThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Step 13a: If capacity allows, TH sends a AddGroup command to DUT with the GroupID field set to G2.\n"); - if (ShouldSkip("G.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestStep13aIfCapacityAllowsThSendsAAddGroupCommandToDutWithTheGroupIDFieldSetToG2_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Step 13b: TH sends a RemoveAllScenes command to DUT with the GroupID field set to G2.\n"); - if (ShouldSkip("S.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestStep13bThSendsARemoveAllScenesCommandToDutWithTheGroupIDFieldSetToG2_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Step 13c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G2.\n"); - if (ShouldSkip("S.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep13cThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG2_49(); - break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Step 14a: TH configures AC3 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestStep14aThConfiguresAc3OnDutForAllImplementedApplicationClustersSupportingScenes_50(); - break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Step 14a: TH configures AC3 on DUT for all implemented application clusters supporting scenes.\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestStep14aThConfiguresAc3OnDutForAllImplementedApplicationClustersSupportingScenes_51(); - break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Step 14b: TH sends a StoreScene command to DUT with the GroupID field set to G2 and the SceneID field set to 0x03.\n"); - if (ShouldSkip("S.S.C04.Rsp")) { - NextTest(); - return; - } - err = TestStep14bThSendsAStoreSceneCommandToDutWithTheGroupIDFieldSetToG2AndTheSceneIDFieldSetTo0x03_52(); - break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Verify that the status of previous command was either 0x00 (SUCCESS) or 0x89 (INSUFFICIENT_SPACE)\n"); - err = TestVerifyThatTheStatusOfPreviousCommandWasEither0x00SuccessOr0x89InsufficientSpace_53(); - break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Step 14c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G2.\n"); - if (ShouldSkip("S.S.C06.Rsp")) { - NextTest(); - return; - } - err = TestStep14cThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG2_54(); - break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Step 15: TH removes the Group key set that was added by sending a KeySetRemove command to the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01a1\n"); - err = TestStep15ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01a1_55(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - 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; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 25: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 26: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 31: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 32: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 33: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 34: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 35: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 36: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 37: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 38: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); - break; - case 39: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 40: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 41: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 42: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 43: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 44: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 45: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 47: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 48: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 49: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 50: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 51: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 52: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 53: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 54: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 55: - 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 = 56; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mG1; - chip::Optional mG2; - chip::Optional mGroupKeyManagementEndpoint; - chip::Optional mGroupsEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - NSNumber * _Nonnull maxScenes; - - CHIP_ERROR TestThReadsFromTheDutThe0x0006SceneTableSizeAttribute_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSceneTableSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads from the DUT the (0x0006) SceneTableSize attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - maxScenes = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep0aPreparationStepForUsingCommandsFromGroupsClusterAddKeySet_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; - params.groupKeySet = [[MTRGroupKeyManagementClusterGroupKeySetStruct alloc] init]; - ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = - [NSNumber numberWithUnsignedShort:417U]; - ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:0U]; - ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = - [[NSData alloc] initWithBytes:"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257" length:16]; - ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = - [NSNumber numberWithUnsignedLongLong:1110000ULL]; - ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = - [[NSData alloc] initWithBytes:"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277" length:16]; - ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = - [NSNumber numberWithUnsignedLongLong:1110001ULL]; - ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = - [[NSData alloc] initWithBytes:"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317" length:16]; - ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = - [NSNumber numberWithUnsignedLongLong:1110002ULL]; - - [cluster keySetWriteWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 0a: preparation step for using commands from Groups cluster: Add KeySet Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep0bPreparationStepForUsingCommandsFromGroupsClusterWriteGroupKeys_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id groupKeyMapArgument; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[MTRGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = - [NSNumber numberWithUnsignedShort:417U]; - ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = - [NSNumber numberWithUnsignedChar:1U]; - - temp_0[1] = [[MTRGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; - ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = mG2.HasValue() ? [NSNumber numberWithUnsignedShort:mG2.Value()] : [NSNumber numberWithUnsignedShort:2U]; - ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = - [NSNumber numberWithUnsignedShort:417U]; - ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = - [NSNumber numberWithUnsignedChar:1U]; - - groupKeyMapArgument = temp_0; - } - [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument completion:^(NSError * _Nullable err) { - NSLog(@"Step 0b: Preparation step for using commands from Groups cluster: Write Group Keys Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep0cThSendsARemoveAllGroupsCommandToDut_4() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(Groups.Endpoint) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster removeAllGroupsWithCompletion: - ^(NSError * _Nullable err) { - NSLog(@"Step 0c: TH sends a RemoveAllGroups command to DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep1aThSendsAAddGroupCommandToDutWithTheGroupIDFieldSetToG1_5() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRGroupsClusterAddGroupParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.groupName = @"Group1"; - [cluster addGroupWithParams:params completion: - ^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 1a: TH sends a AddGroup command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep1bThSendsARemoveAllScenesCommandToDutWithTheGroupIDFieldSetToG1_6() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterRemoveAllScenesParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - [cluster removeAllScenesWithParams:params completion: - ^(MTRScenesClusterRemoveAllScenesResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 1b: TH sends a RemoveAllScenes command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep1cThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_7() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterGetSceneMembershipParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - [cluster getSceneMembershipWithParams:params completion: - ^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 1c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNonNull("Capacity", actualValue)); - VerifyOrReturn(CheckValue("Capacity", actualValue, ([maxScenes unsignedShortValue] / 2U))); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSTep2aThConfiguresAc1OnDutForAllImplementedApplicationClustersSupportingScenes_8() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = - [NSNumber numberWithUnsignedChar:100U]; - params.transitionTime = - [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = - [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = - [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"STep 2a: TH configures AC1 on DUT for all implemented application clusters supporting scenes. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2aThConfiguresAc1OnDutForAllImplementedApplicationClustersSupportingScenes_9() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please configure AC1 on DUT and enter 'y' after the configuration is completegarbage: not in length on purpose", 77); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep2bThSendsAStoreSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_10() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterStoreSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - [cluster storeSceneWithParams:params completion: - ^(MTRScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 2b: TH sends a StoreScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneID; - VerifyOrReturn(CheckValue("SceneID", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_11() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = - [NSNumber numberWithUnsignedChar:200U]; - params.transitionTime = - [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = - [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = - [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 3a: TH configures AC2 on DUT for all implemented application clusters supporting scenes. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_12() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please configure AC2 on DUT and enter 'y' after the configuration is completegarbage: not in length on purpose", 77); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep3bThSendsARecallSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_13() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterRecallSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - [cluster recallSceneWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 3b: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull SceneCountValue; - - CHIP_ERROR TestStep3cThReadsTheSceneCountAttributeFromDut_14() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSceneCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3c: TH reads the SceneCount attribute from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("SceneCount", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("sceneCount", "int8u", "int8u")); - { - SceneCountValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3dThReadsTheCurrentSceneAttributeFromDut_15() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentSceneWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3d: TH reads the CurrentScene attribute from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentScene", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("currentScene", "int8u", "int8u")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3eThReadsTheCurrentGroupAttributeFromDut_16() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentGroupWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3e: TH reads the CurrentGroup attribute from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentGroup", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - VerifyOrReturn(CheckConstraintType("currentGroup", "group_id", "group_id")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3fThReadsTheSceneValidAttributeFromDut_17() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSceneValidWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3f: TH reads the SceneValid attribute from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("SceneValid", actualValue, true)); - } - - VerifyOrReturn(CheckConstraintType("sceneValid", "boolean", "boolean")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull SceneTableSizeValue; - - CHIP_ERROR TestStep3gThReadsAttributeSceneTableSizeFromDut_18() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeSceneTableSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3g: TH reads attribute SceneTableSize from DUT. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("sceneTableSize", "int16u", "int16u")); - { - SceneTableSizeValue = value; - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3hThReadsAttributeFabricSceneInfoFromDut_19() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter y after successgarbage: not in length on purpose", 21); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep4aRebootTargetDevice_20() - { - - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestStep4aRebootTargetDeviceDUT_21() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_22() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestStep4cThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_23() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = - [NSNumber numberWithUnsignedChar:200U]; - params.transitionTime = - [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = - [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = - [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 4c: TH configures AC2 on DUT for all implemented application clusters supporting scenes. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep4cThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_24() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please configure AC2 on DUT and enter 'y' after the configuration is completegarbage: not in length on purpose", 77); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep4dThSendsARecallSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_25() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterRecallSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - [cluster recallSceneWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 4d: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5ThSendsAViewSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_26() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterViewSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - [cluster viewSceneWithParams:params completion: - ^(MTRScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 5: TH sends a ViewScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneID; - VerifyOrReturn(CheckValue("SceneID", actualValue, 1U)); - } - - { - id actualValue = values.transitionTime; - VerifyOrReturn(CheckValue("TransitionTime", actualValue, 0U)); - } - - { - id actualValue = values.extensionFieldSets; - VerifyOrReturn(CheckValue("ExtensionFieldSets", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("ClusterID", ((MTRScenesClusterExtensionFieldSet *) actualValue[0]).clusterID, 6UL)); - VerifyOrReturn(CheckValue("AttributeValueList", [((MTRScenesClusterExtensionFieldSet *) actualValue[0]).attributeValueList count], static_cast(1))); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[0]).attributeValueList[0]).attributeID, 0UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[0]).attributeValueList[0]).attributeValue, 1UL)); - VerifyOrReturn(CheckValue("ClusterID", ((MTRScenesClusterExtensionFieldSet *) actualValue[1]).clusterID, 8UL)); - VerifyOrReturn(CheckValue("AttributeValueList", [((MTRScenesClusterExtensionFieldSet *) actualValue[1]).attributeValueList count], static_cast(1))); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[1]).attributeValueList[0]).attributeID, 0UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[1]).attributeValueList[0]).attributeValue, 100UL)); - VerifyOrReturn(CheckValue("ClusterID", ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).clusterID, 768UL)); - VerifyOrReturn(CheckValue("AttributeValueList", [((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList count], static_cast(9))); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[0]).attributeID, 3UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[0]).attributeValue, 24939UL)); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[1]).attributeID, 4UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[1]).attributeValue, 24701UL)); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[2]).attributeID, 16384UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[2]).attributeValue, 0UL)); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[3]).attributeID, 1UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[3]).attributeValue, 0UL)); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[4]).attributeID, 16386UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[4]).attributeValue, 0UL)); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[5]).attributeID, 16387UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[5]).attributeValue, 0UL)); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[6]).attributeID, 16388UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[6]).attributeValue, 25UL)); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[7]).attributeID, 7UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[7]).attributeValue, 0UL)); - VerifyOrReturn(CheckValue("AttributeID", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[8]).attributeID, 16385UL)); - VerifyOrReturn(CheckValue("AttributeValue", ((MTRScenesClusterAttributeValuePair *) ((MTRScenesClusterExtensionFieldSet *) actualValue[2]).attributeValueList[8]).attributeValue, 2UL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep5ThSendsAViewSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_27() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterViewSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - [cluster viewSceneWithParams:params completion: - ^(MTRScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 5: TH sends a ViewScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneID; - VerifyOrReturn(CheckValue("SceneID", actualValue, 1U)); - } - - { - id actualValue = values.transitionTime; - VerifyOrReturn(CheckValue("TransitionTime", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6ThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_28() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterGetSceneMembershipParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - [cluster getSceneMembershipWithParams:params completion: - ^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 6: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNonNull("Capacity", actualValue)); - VerifyOrReturn(CheckValue("Capacity", actualValue, ([maxScenes unsignedShortValue] / 2U) - 1U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneList; - VerifyOrReturn(CheckValue("SceneList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep7aThSendsARemoveAllScenesCommandToDutWithTheGroupIDFieldSetToG1_29() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterRemoveAllScenesParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - [cluster removeAllScenesWithParams:params completion: - ^(MTRScenesClusterRemoveAllScenesResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 7a: TH sends a RemoveAllScenes command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep7bThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_30() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterGetSceneMembershipParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - [cluster getSceneMembershipWithParams:params completion: - ^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 7b: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - if (values.capacity != nil) { - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep8aThSendsAAddSceneCommandToDutWithTheGroupIDFieldSetToG1TheSceneIDFieldSetTo0x01TheTransitionTimeFieldSetTo0x0001AndASetOfExtensionFieldsAppropriateToAc1_31() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterAddSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - params.transitionTime = - [NSNumber numberWithUnsignedShort:1U]; - params.sceneName = @"Scene1"; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [[MTRScenesClusterExtensionFieldSet alloc] init]; - ((MTRScenesClusterExtensionFieldSet *) temp_0[0]).clusterID = - [NSNumber numberWithUnsignedInt:6UL]; - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[MTRScenesClusterAttributeValuePair alloc] init]; - ((MTRScenesClusterAttributeValuePair *) temp_2[0]).attributeID = - [NSNumber numberWithUnsignedInt:0UL]; - ((MTRScenesClusterAttributeValuePair *) temp_2[0]).attributeValue = - [NSNumber numberWithUnsignedInt:1UL]; - - ((MTRScenesClusterExtensionFieldSet *) temp_0[0]).attributeValueList = temp_2; - } - - temp_0[1] = [[MTRScenesClusterExtensionFieldSet alloc] init]; - ((MTRScenesClusterExtensionFieldSet *) temp_0[1]).clusterID = - [NSNumber numberWithUnsignedInt:8UL]; - { - NSMutableArray * temp_2 = [[NSMutableArray alloc] init]; - temp_2[0] = [[MTRScenesClusterAttributeValuePair alloc] init]; - ((MTRScenesClusterAttributeValuePair *) temp_2[0]).attributeID = - [NSNumber numberWithUnsignedInt:0UL]; - ((MTRScenesClusterAttributeValuePair *) temp_2[0]).attributeValue = - [NSNumber numberWithUnsignedInt:100UL]; - - ((MTRScenesClusterExtensionFieldSet *) temp_0[1]).attributeValueList = temp_2; - } - - params.extensionFieldSets = temp_0; - } - [cluster addSceneWithParams:params completion: - ^(MTRScenesClusterAddSceneResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 8a: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to 0x0001 and a set of extension fields appropriate to AC1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneID; - VerifyOrReturn(CheckValue("SceneID", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep8aThSendsAAddSceneCommandToDutWithTheGroupIDFieldSetToG1TheSceneIDFieldSetTo0x01TheTransitionTimeFieldSetTo0x0001AndASetOfExtensionFieldsAppropriateToAc1_32() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please execute the add scene command with extensionfieldsets in accordance with AC1 on DUT and enter 'y' if the command is successfulgarbage: not in length on purpose", 133); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep8bThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_33() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterGetSceneMembershipParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - [cluster getSceneMembershipWithParams:params completion: - ^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 8b: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - if (values.capacity != nil) { - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneList; - VerifyOrReturn(CheckValue("SceneList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep9aThSendsARemoveSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_34() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterRemoveSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - [cluster removeSceneWithParams:params completion: - ^(MTRScenesClusterRemoveSceneResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 9a: TH sends a RemoveScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneID; - VerifyOrReturn(CheckValue("SceneID", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep9bThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_35() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterGetSceneMembershipParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - [cluster getSceneMembershipWithParams:params completion: - ^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 9b: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - if (values.capacity != nil) { - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep10aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_36() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = - [NSNumber numberWithUnsignedChar:200U]; - params.transitionTime = - [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = - [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = - [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 10a: TH configures AC2 on DUT for all implemented application clusters supporting scenes. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep10aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_37() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please configure AC2 on DUT and enter 'y' after the configuration is completegarbage: not in length on purpose", 77); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep10bThSendsARecallSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_38() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterRecallSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - [cluster recallSceneWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 10b: TH sends a RecallScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, EMBER_ZCL_STATUS_NOT_FOUND)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep11aThConfiguresAc1OnDutForAllImplementedApplicationClustersSupportingScenes_39() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = - [NSNumber numberWithUnsignedChar:100U]; - params.transitionTime = - [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = - [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = - [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 11a: TH configures AC1 on DUT for all implemented application clusters supporting scenes. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep11aThConfiguresAc1OnDutForAllImplementedApplicationClustersSupportingScenes_40() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please configure AC1 on DUT and enter 'y' after the configuration is completegarbage: not in length on purpose", 77); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep11bThSendsAStoreSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x01_41() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterStoreSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:1U]; - [cluster storeSceneWithParams:params completion: - ^(MTRScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 11b: TH sends a StoreScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneID; - VerifyOrReturn(CheckValue("SceneID", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep12aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_42() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = - [NSNumber numberWithUnsignedChar:200U]; - params.transitionTime = - [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = - [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = - [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 12a: TH configures AC2 on DUT for all implemented application clusters supporting scenes. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep12aThConfiguresAc2OnDutForAllImplementedApplicationClustersSupportingScenes_43() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please configure AC2 on DUT and enter 'y' after the configuration is completegarbage: not in length on purpose", 77); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - NSNumber * _Nonnull StoreStatus; - - CHIP_ERROR TestStep12bThSendsAStoreSceneCommandToDutWithTheGroupIDFieldSetToG1AndTheSceneIDFieldSetTo0x02_44() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterStoreSceneParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:2U]; - [cluster storeSceneWithParams:params completion: - ^(MTRScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 12b: TH sends a StoreScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x02. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - StoreStatus = values.status; - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneID; - VerifyOrReturn(CheckValue("SceneID", actualValue, 2U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull ContinueTest; - - CHIP_ERROR TestVerifyThatTheStatusOfPreviousCommandWasEither0x00SuccessOr0x89InsufficientSpace_45() - { - - chip::app::Clusters::EqualityCommands::Commands::UnsignedNumberEquals::Type value; - value.value1 = 0ULL; - value.value2 = StoreStatus; - return UnsignedNumberEquals("alpha", value); - } - - CHIP_ERROR TestStep12cThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG1_46() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterGetSceneMembershipParams alloc] init]; - params.groupID = mG1.HasValue() ? [NSNumber numberWithUnsignedShort:mG1.Value()] : [NSNumber numberWithUnsignedShort:1U]; - [cluster getSceneMembershipWithParams:params completion: - ^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 12c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G1. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNonNull("Capacity", actualValue)); - VerifyOrReturn(CheckValue("Capacity", actualValue, ([maxScenes unsignedShortValue] / 2U) - 2U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG1.HasValue() ? mG1.Value() : 1U)); - } - - { - id actualValue = values.sceneList; - VerifyOrReturn(CheckValue("SceneList", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValue("", actualValue[0], 1U)); - VerifyOrReturn(CheckValue("", actualValue[1], 2U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep13aIfCapacityAllowsThSendsAAddGroupCommandToDutWithTheGroupIDFieldSetToG2_47() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRGroupsClusterAddGroupParams alloc] init]; - params.groupID = mG2.HasValue() ? [NSNumber numberWithUnsignedShort:mG2.Value()] : [NSNumber numberWithUnsignedShort:2U]; - params.groupName = @"Group2"; - [cluster addGroupWithParams:params completion: - ^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 13a: If capacity allows, TH sends a AddGroup command to DUT with the GroupID field set to G2. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG2.HasValue() ? mG2.Value() : 2U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep13bThSendsARemoveAllScenesCommandToDutWithTheGroupIDFieldSetToG2_48() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterRemoveAllScenesParams alloc] init]; - params.groupID = mG2.HasValue() ? [NSNumber numberWithUnsignedShort:mG2.Value()] : [NSNumber numberWithUnsignedShort:2U]; - [cluster removeAllScenesWithParams:params completion: - ^(MTRScenesClusterRemoveAllScenesResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 13b: TH sends a RemoveAllScenes command to DUT with the GroupID field set to G2. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG2.HasValue() ? mG2.Value() : 2U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep13cThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG2_49() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterGetSceneMembershipParams alloc] init]; - params.groupID = mG2.HasValue() ? [NSNumber numberWithUnsignedShort:mG2.Value()] : [NSNumber numberWithUnsignedShort:2U]; - [cluster getSceneMembershipWithParams:params completion: - ^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 13c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G2. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNonNull("Capacity", actualValue)); - VerifyOrReturn(CheckValue("Capacity", actualValue, ([maxScenes unsignedShortValue] / 2U) - 2U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG2.HasValue() ? mG2.Value() : 2U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep14aThConfiguresAc3OnDutForAllImplementedApplicationClustersSupportingScenes_50() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; - params.level = - [NSNumber numberWithUnsignedChar:1U]; - params.transitionTime = - [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = - [NSNumber numberWithUnsignedChar:0U]; - params.optionsOverride = - [NSNumber numberWithUnsignedChar:0U]; - [cluster moveToLevelWithOnOffWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 14a: TH configures AC3 on DUT for all implemented application clusters supporting scenes. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep14aThConfiguresAc3OnDutForAllImplementedApplicationClustersSupportingScenes_51() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please configure AC3 on DUT and enter 'y' after the configuration is completegarbage: not in length on purpose", 77); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - NSNumber * _Nonnull StoredStatus; - - CHIP_ERROR TestStep14bThSendsAStoreSceneCommandToDutWithTheGroupIDFieldSetToG2AndTheSceneIDFieldSetTo0x03_52() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterStoreSceneParams alloc] init]; - params.groupID = mG2.HasValue() ? [NSNumber numberWithUnsignedShort:mG2.Value()] : [NSNumber numberWithUnsignedShort:2U]; - params.sceneID = - [NSNumber numberWithUnsignedChar:3U]; - [cluster storeSceneWithParams:params completion: - ^(MTRScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 14b: TH sends a StoreScene command to DUT with the GroupID field set to G2 and the SceneID field set to 0x03. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - StoredStatus = values.status; - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG2.HasValue() ? mG2.Value() : 2U)); - } - - { - id actualValue = values.sceneID; - VerifyOrReturn(CheckValue("SceneID", actualValue, 3U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - NSNumber * _Nonnull ContinueStep14; - - CHIP_ERROR TestVerifyThatTheStatusOfPreviousCommandWasEither0x00SuccessOr0x89InsufficientSpace_53() - { - - chip::app::Clusters::EqualityCommands::Commands::UnsignedNumberEquals::Type value; - value.value1 = 0ULL; - value.value2 = StoredStatus; - return UnsignedNumberEquals("alpha", value); - } - - CHIP_ERROR TestStep14cThSendsAGetSceneMembershipCommandToDutWithTheGroupIDFieldSetToG2_54() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRScenesClusterGetSceneMembershipParams alloc] init]; - params.groupID = mG2.HasValue() ? [NSNumber numberWithUnsignedShort:mG2.Value()] : [NSNumber numberWithUnsignedShort:2U]; - [cluster getSceneMembershipWithParams:params completion: - ^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 14c: TH sends a GetSceneMembership command to DUT with the GroupID field set to G2. Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } - - { - id actualValue = values.capacity; - VerifyOrReturn(CheckValueNonNull("Capacity", actualValue)); - VerifyOrReturn(CheckValue("Capacity", actualValue, ([maxScenes unsignedShortValue] / 2U) - 3U)); - } - - { - id actualValue = values.groupID; - VerifyOrReturn(CheckValue("GroupID", actualValue, mG2.HasValue() ? mG2.Value() : 2U)); - } - - { - id actualValue = values.sceneList; - VerifyOrReturn(CheckValue("SceneList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 3U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep15ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01a1_55() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRGroupKeyManagementClusterKeySetRemoveParams alloc] init]; - params.groupKeySetID = - [NSNumber numberWithUnsignedShort:417U]; - [cluster keySetRemoveWithParams:params completion: - ^(NSError * _Nullable err) { - NSLog(@"Step 15: TH removes the Group key set that was added by sending a KeySetRemove command to the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01a1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class Test_TC_S_2_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -174610,7 +172422,6 @@ class Test_TC_S_2_3 : public TestCommandBridge { AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("G1", 0, UINT16_MAX, &mG1); - AddArgument("GroupKeyManagement.Endpoint", 0, UINT16_MAX, &mGroupKeyManagementEndpoint); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) @@ -174934,7 +172745,6 @@ class Test_TC_S_2_3 : public TestCommandBridge { chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mG1; - chip::Optional mGroupKeyManagementEndpoint; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -174972,7 +172782,7 @@ class Test_TC_S_2_3 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; @@ -175010,7 +172820,7 @@ class Test_TC_S_2_3 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id groupKeyMapArgument; @@ -175072,7 +172882,7 @@ class Test_TC_S_2_3 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id aclArgument; @@ -175719,7 +173529,7 @@ class Test_TC_S_2_3 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRGroupKeyManagementClusterKeySetRemoveParams alloc] init]; @@ -175749,7 +173559,6 @@ class Test_TC_S_2_4 : public TestCommandBridge { AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); AddArgument("G1", 0, UINT16_MAX, &mG1); - AddArgument("GroupKeyManagement.Endpoint", 0, UINT16_MAX, &mGroupKeyManagementEndpoint); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) @@ -176091,7 +173900,6 @@ class Test_TC_S_2_4 : public TestCommandBridge { chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mG1; - chip::Optional mGroupKeyManagementEndpoint; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -176106,7 +173914,7 @@ class Test_TC_S_2_4 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRGroupKeyManagementClusterKeySetWriteParams alloc] init]; @@ -176144,7 +173952,7 @@ class Test_TC_S_2_4 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id groupKeyMapArgument; @@ -176679,7 +174487,7 @@ class Test_TC_S_2_4 : public TestCommandBridge { { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(GroupKeyManagement.Endpoint) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRGroupKeyManagementClusterKeySetRemoveParams alloc] init]; @@ -178931,7 +176739,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(),