Add tests for TC-SC-5.1/2 (#24454)
* Add tests for TC-SC-5.1/2
Also add key material to match.
* Restyled by clang-format
* Restyled by prettier-yaml
* Groups uses GroupID. GroupKeyManagement uses GroupId
...and GroupID. For fun.
* Fix formatting.
Co-authored-by: Restyled.io <commits@restyled.io>
diff --git a/src/app/tests/suites/certification/Test_TC_SC_5_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_5_1.yaml
index 8264358..9220ee7 100644
--- a/src/app/tests/suites/certification/Test_TC_SC_5_1.yaml
+++ b/src/app/tests/suites/certification/Test_TC_SC_5_1.yaml
@@ -13,544 +13,229 @@
# limitations under the License.
# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default
-name:
- 19.1.1. [TC-SC-5.1] Adding member to a group - TH as Admin and DUT as Group
- Member
+name: 19.1.1. [TC-SC-5.1] Adding member to a group
PICS:
- PICS_MCORE_ROLE_COMMISSIONEE
config:
nodeId: 0x12344321
- cluster: "Basic Information"
- endpoint: 0
+ cluster: "Groups"
+ # Users should set endpoint value on the command line to PIXIT.G.ENDPOINT
+ endpoint: 1
tests:
- - label: "Precondition"
- verification: |
- DUT is commissioned by TH
- disabled: true
+ - label: "Wait for the commissioned device to be retrieved"
+ cluster: "DelayCommands"
+ command: "WaitForCommissionee"
+ arguments:
+ values:
+ - name: "nodeId"
+ value: nodeId
- - label:
- "TH writes The ACL attribute in the Access Control cluster to add
- Operate privileges for group 0x0103 and maintain the current
- administrative privileges for the TH. The following access control
- list shall be used: List item 1 (TH admin): Fabric index: 1,Privilege:
- Administer (5),AuthMode: CASE (2),Subjects: TH node id ([N1]),Targets:
- all (null) List item 2 (group operate access):Fabric index:
- 1,Privilege: Operate (3),AuthMode: Group (3),Subjects: group 0x0103
- ([0x0103]),Targets: all (null)"
- verification: |
- ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [1], "targets": null },{"fabricIndex": 1, "privilege": 3, "authMode": 3, "subjects": ["0x0103"], "targets": null }]' 1 0
+ - label: "TH adds ACL Operate privileges for Group 0x0103"
+ cluster: "Access Control"
+ endpoint: 0
+ command: "writeAttribute"
+ attribute: "ACL"
+ arguments:
+ value:
+ [
+ {
+ FabricIndex: 1,
+ Privilege: 5,
+ AuthMode: 2,
+ Subjects: [commissionerNodeId],
+ Targets: null,
+ },
+ {
+ FabricIndex: 1,
+ Privilege: 3,
+ AuthMode: 3,
+ Subjects: [0x0103],
+ Targets: null,
+ },
+ ]
+ - label: "TH sends KeySetWrite command with incorrect key"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "KeySetWrite"
+ arguments:
+ values:
+ - name: GroupKeySet
+ value:
+ {
+ GroupKeySetID: 0x01a3,
+ GroupKeySecurityPolicy: 0,
+ EpochKey0: "0x00000000000000000000000000000001",
+ EpochStartTime0: 111,
+ EpochKey1: "0x00000000000000000000000000000002",
+ EpochStartTime1: 222,
+ EpochKey2: "0x00000000000000000000000000000003",
+ EpochStartTime2: 333,
+ }
- [1674109884.293472][29548:29550] CHIP:DMG: WriteResponseMessage =
- [1674109884.293477][29548:29550] CHIP:DMG: {
- [1674109884.293479][29548:29550] CHIP:DMG: AttributeStatusIBs =
- [1674109884.293486][29548:29550] CHIP:DMG: [
- [1674109884.293489][29548:29550] CHIP:DMG: AttributeStatusIB =
- [1674109884.293494][29548:29550] CHIP:DMG: {
- [1674109884.293497][29548:29550] CHIP:DMG: AttributePathIB =
- [1674109884.293502][29548:29550] CHIP:DMG: {
- [1674109884.293506][29548:29550] CHIP:DMG: Endpoint = 0x0,
- [1674109884.293510][29548:29550] CHIP:DMG: Cluster = 0x1f,
- [1674109884.293514][29548:29550] CHIP:DMG: Attribute = 0x0000_0000,
- [1674109884.293518][29548:29550] CHIP:DMG: }
- [1674109884.293523][29548:29550] CHIP:DMG:
- [1674109884.293527][29548:29550] CHIP:DMG: StatusIB =
- [1674109884.293531][29548:29550] CHIP:DMG: {
- [1674109884.293536][29548:29550] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674109884.293539][29548:29550] CHIP:DMG: },
- [1674109884.293543][29548:29550] CHIP:DMG:
- [1674109884.293547][29548:29550] CHIP:DMG: },
- [1674109884.293572][29548:29550] CHIP:DMG:
- [1674109884.293575][29548:29550] CHIP:DMG: AttributeStatusIB =
- [1674109884.293579][29548:29550] CHIP:DMG: {
- [1674109884.293582][29548:29550] CHIP:DMG: AttributePathIB =
- [1674109884.293586][29548:29550] CHIP:DMG: {
- [1674109884.293590][29548:29550] CHIP:DMG: Endpoint = 0x0,
- [1674109884.293594][29548:29550] CHIP:DMG: Cluster = 0x1f,
- [1674109884.293598][29548:29550] CHIP:DMG: Attribute = 0x0000_0000,
- [1674109884.293602][29548:29550] CHIP:DMG: ListIndex = Null,
- [1674109884.293605][29548:29550] CHIP:DMG: }
- [1674109884.293611][29548:29550] CHIP:DMG:
- [1674109884.293614][29548:29550] CHIP:DMG: StatusIB =
- [1674109884.293618][29548:29550] CHIP:DMG: {
- [1674109884.293621][29548:29550] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674109884.293625][29548:29550] CHIP:DMG: },
- [1674109884.293629][29548:29550] CHIP:DMG:
- [1674109884.293632][29548:29550] CHIP:DMG: },
- [1674109884.293640][29548:29550] CHIP:DMG:
- [1674109884.293643][29548:29550] CHIP:DMG: AttributeStatusIB =
- [1674109884.293647][29548:29550] CHIP:DMG: {
- [1674109884.293650][29548:29550] CHIP:DMG: AttributePathIB =
- [1674109884.293654][29548:29550] CHIP:DMG: {
- [1674109884.293657][29548:29550] CHIP:DMG: Endpoint = 0x0,
- [1674109884.293661][29548:29550] CHIP:DMG: Cluster = 0x1f,
- [1674109884.293665][29548:29550] CHIP:DMG: Attribute = 0x0000_0000,
- [1674109884.293669][29548:29550] CHIP:DMG: ListIndex = Null,
- [1674109884.293672][29548:29550] CHIP:DMG: }
- [1674109884.293678][29548:29550] CHIP:DMG:
- [1674109884.293681][29548:29550] CHIP:DMG: StatusIB =
- [1674109884.293685][29548:29550] CHIP:DMG: {
- [1674109884.293689][29548:29550] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674109884.293692][29548:29550] CHIP:DMG: },
- [1674109884.293696][29548:29550] CHIP:DMG:
- [1674109884.293699][29548:29550] CHIP:DMG: },
- [1674109884.293704][29548:29550] CHIP:DMG:
- [1674109884.293707][29548:29550] CHIP:DMG: ],
- [1674109884.293717][29548:29550] CHIP:DMG:
- [1674109884.293721][29548:29550] CHIP:DMG: InteractionModelRevision = 1
- [1674109884.293724][29548:29550] CHIP:DMG: }
- disabled: true
+ - label: "TH sends KeySetWrite command with TH key"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "KeySetWrite"
+ arguments:
+ values:
+ - name: GroupKeySet
+ value:
+ {
+ GroupKeySetID: 0x01a3,
+ GroupKeySecurityPolicy: 0,
+ EpochKey0: "0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf",
+ EpochStartTime0: 2220000,
+ EpochKey1: "0xd1d1d2d3d4d5d6d7d8d9dadbdcdddedf",
+ EpochStartTime1: 2220001,
+ EpochKey2: "0xd2d1d2d3d4d5d6d7d8d9dadbdcdddedf",
+ EpochStartTime2: 2220002,
+ }
- - label:
- "TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT
- using a key that is NOT installed on the TH. This is intended to test
- that the key set is correctly updated in the next step. GroupKeySet
- fields are as follows: GroupKeySetID: 0x01a3,GroupKeySecurityPolicy:
- TrustFirst (0),EpochKey0:
- 0x00000000000000000000000000000001,EpochStartTime0: 111,EpochKey1:
- 0x00000000000000000000000000000002,EpochStartTime1: 222,EpochKey2:
- 0x00000000000000000000000000000003,EpochStartTime2: 333"
- verification: |
- ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": "0x01a3","groupKeySecurityPolicy": 0, "epochKey0":"00000000000000000000000000000001", "epochStartTime0": 111,"epochKey1":"00000000000000000000000000000002", "epochStartTime1": 222,"epochKey2":"00000000000000000000000000000003", "epochStartTime2": 333 }' 1 0
+ - label: "TH binds GroupId to GroupKeySet"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "writeAttribute"
+ attribute: "GroupKeyMap"
+ arguments:
+ value: [{ FabricIndex: 1, GroupId: 0x0103, GroupKeySetID: 0x01a3 }]
+ - label: "TH sends RemoveAllGroups command"
+ command: "RemoveAllGroups"
- [1674109957.007856][29570:29572] CHIP:DMG: InvokeResponseMessage =
- [1674109957.007859][29570:29572] CHIP:DMG: {
- [1674109957.007862][29570:29572] CHIP:DMG: suppressResponse = false,
- [1674109957.007865][29570:29572] CHIP:DMG: InvokeResponseIBs =
- [1674109957.007872][29570:29572] CHIP:DMG: [
- [1674109957.007875][29570:29572] CHIP:DMG: InvokeResponseIB =
- [1674109957.007880][29570:29572] CHIP:DMG: {
- [1674109957.007883][29570:29572] CHIP:DMG: CommandStatusIB =
- [1674109957.007887][29570:29572] CHIP:DMG: {
- [1674109957.007890][29570:29572] CHIP:DMG: CommandPathIB =
- [1674109957.007894][29570:29572] CHIP:DMG: {
- [1674109957.007898][29570:29572] CHIP:DMG: EndpointId = 0x0,
- [1674109957.007901][29570:29572] CHIP:DMG: ClusterId = 0x3f,
- [1674109957.007905][29570:29572] CHIP:DMG: CommandId = 0x0,
- [1674109957.007909][29570:29572] CHIP:DMG: },
- [1674109957.007913][29570:29572] CHIP:DMG:
- [1674109957.007917][29570:29572] CHIP:DMG: StatusIB =
- [1674109957.007921][29570:29572] CHIP:DMG: {
- [1674109957.007924][29570:29572] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674109957.007927][29570:29572] CHIP:DMG: },
- [1674109957.007931][29570:29572] CHIP:DMG:
- [1674109957.007933][29570:29572] CHIP:DMG: },
- [1674109957.007938][29570:29572] CHIP:DMG:
- [1674109957.007941][29570:29572] CHIP:DMG: },
- [1674109957.007946][29570:29572] CHIP:DMG:
- [1674109957.007948][29570:29572] CHIP:DMG: ],
- [1674109957.007953][29570:29572] CHIP:DMG:
- [1674109957.007956][29570:29572] CHIP:DMG: InteractionModelRevision = 1
- [1674109957.007958][29570:29572] CHIP:DMG: },
- disabled: true
+ - label: "TH sends AddGroup command"
+ command: "AddGroup"
+ arguments:
+ values:
+ - name: GroupID
+ value: 0x0103
+ - name: GroupName
+ value: "Test Group"
- - label:
- "TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT
- using a key that is pre-installed on the TH. GroupKeySet fields are as
- follows: GroupKeySetID: 0x01a3,GroupKeySecurityPolicy: TrustFirst
- (0),EpochKey0: 0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf,EpochStartTime0:
- 2220000,EpochKey1: 0xd1d1d2d3d4d5d6d7d8d9dadbdcdddedf,EpochStartTime1:
- 2220001,EpochKey2: 0xd2d1d2d3d4d5d6d7d8d9dadbdcdddedf,EpochStartTime2:
- 2220002"
- verification: |
- ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": "0x01a3","groupKeySecurityPolicy": 0, "epochKey0":"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1":"d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2":"d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0
-
-
- [1674110035.037849][29578:29580] CHIP:DMG: InvokeResponseMessage =
- [1674110035.037852][29578:29580] CHIP:DMG: {
- [1674110035.037856][29578:29580] CHIP:DMG: suppressResponse = false,
- [1674110035.037859][29578:29580] CHIP:DMG: InvokeResponseIBs =
- [1674110035.037864][29578:29580] CHIP:DMG: [
- [1674110035.037867][29578:29580] CHIP:DMG: InvokeResponseIB =
- [1674110035.037872][29578:29580] CHIP:DMG: {
- [1674110035.037875][29578:29580] CHIP:DMG: CommandStatusIB =
- [1674110035.037879][29578:29580] CHIP:DMG: {
- [1674110035.037882][29578:29580] CHIP:DMG: CommandPathIB =
- [1674110035.037886][29578:29580] CHIP:DMG: {
- [1674110035.037890][29578:29580] CHIP:DMG: EndpointId = 0x0,
- [1674110035.037893][29578:29580] CHIP:DMG: ClusterId = 0x3f,
- [1674110035.037897][29578:29580] CHIP:DMG: CommandId = 0x0,
- [1674110035.037900][29578:29580] CHIP:DMG: },
- [1674110035.037905][29578:29580] CHIP:DMG:
- [1674110035.037908][29578:29580] CHIP:DMG: StatusIB =
- [1674110035.037912][29578:29580] CHIP:DMG: {
- [1674110035.037916][29578:29580] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674110035.037920][29578:29580] CHIP:DMG: },
- [1674110035.037925][29578:29580] CHIP:DMG:
- [1674110035.037929][29578:29580] CHIP:DMG: },
- [1674110035.037934][29578:29580] CHIP:DMG:
- [1674110035.037938][29578:29580] CHIP:DMG: },
- [1674110035.037944][29578:29580] CHIP:DMG:
- [1674110035.037948][29578:29580] CHIP:DMG: ],
- [1674110035.037954][29578:29580] CHIP:DMG:
- [1674110035.037957][29578:29580] CHIP:DMG: InteractionModelRevision = 1
- [1674110035.037960][29578:29580] CHIP:DMG: },
- disabled: true
-
- - label:
- "TH binds GroupId 0x0103 with GroupKeySetID 0x01a3 in the GroupKeyMap
- attribute list on GroupKeyManagement cluster by writing the
- GroupKeyMap attribute with one entry as follows: List item 1:
- FabricIndex: 1,GroupId: 0x0103,GroupKeySetId: 0x01a3"
- verification: |
- ./chip-tool groupkeymanagement write group-key-map '[{"groupId": "0x0103", "groupKeySetID": "0x01a3", "fabricIndex": 1}]' 1 0
-
- [1674110101.932149][29586:29588] CHIP:DMG: WriteResponseMessage =
- [1674110101.932152][29586:29588] CHIP:DMG: {
- [1674110101.932155][29586:29588] CHIP:DMG: AttributeStatusIBs =
- [1674110101.932161][29586:29588] CHIP:DMG: [
- [1674110101.932164][29586:29588] CHIP:DMG: AttributeStatusIB =
- [1674110101.932169][29586:29588] CHIP:DMG: {
- [1674110101.932173][29586:29588] CHIP:DMG: AttributePathIB =
- [1674110101.932177][29586:29588] CHIP:DMG: {
- [1674110101.932181][29586:29588] CHIP:DMG: Endpoint = 0x0,
- [1674110101.932185][29586:29588] CHIP:DMG: Cluster = 0x3f,
- [1674110101.932189][29586:29588] CHIP:DMG: Attribute = 0x0000_0000,
- [1674110101.932193][29586:29588] CHIP:DMG: }
- [1674110101.932198][29586:29588] CHIP:DMG:
- [1674110101.932201][29586:29588] CHIP:DMG: StatusIB =
- [1674110101.932206][29586:29588] CHIP:DMG: {
- [1674110101.932210][29586:29588] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674110101.932213][29586:29588] CHIP:DMG: },
- [1674110101.932217][29586:29588] CHIP:DMG:
- [1674110101.932220][29586:29588] CHIP:DMG: },
- [1674110101.932227][29586:29588] CHIP:DMG:
- [1674110101.932230][29586:29588] CHIP:DMG: AttributeStatusIB =
- [1674110101.932234][29586:29588] CHIP:DMG: {
- [1674110101.932237][29586:29588] CHIP:DMG: AttributePathIB =
- [1674110101.932240][29586:29588] CHIP:DMG: {
- [1674110101.932244][29586:29588] CHIP:DMG: Endpoint = 0x0,
- [1674110101.932248][29586:29588] CHIP:DMG: Cluster = 0x3f,
- [1674110101.932252][29586:29588] CHIP:DMG: Attribute = 0x0000_0000,
- [1674110101.932256][29586:29588] CHIP:DMG: ListIndex = Null,
- [1674110101.932259][29586:29588] CHIP:DMG: }
- [1674110101.932264][29586:29588] CHIP:DMG:
- [1674110101.932267][29586:29588] CHIP:DMG: StatusIB =
- [1674110101.932270][29586:29588] CHIP:DMG: {
- [1674110101.932273][29586:29588] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674110101.932276][29586:29588] CHIP:DMG: },
- [1674110101.932280][29586:29588] CHIP:DMG:
- [1674110101.932283][29586:29588] CHIP:DMG: },
- [1674110101.932288][29586:29588] CHIP:DMG:
- [1674110101.932291][29586:29588] CHIP:DMG: ],
- [1674110101.932298][29586:29588] CHIP:DMG:
- [1674110101.932301][29586:29588] CHIP:DMG: InteractionModelRevision = 1
- [1674110101.932305][29586:29588] CHIP:DMG: }
- disabled: true
-
- - label: "TH sends RemoveAllGroups command to the DUT on PIXIT.G.ENDPOINT"
- verification: |
- ./chip-tool groups remove-all-groups 1 1
-
-
- [1674110158.295305][29600:29602] CHIP:DMG: InvokeResponseMessage =
- [1674110158.295310][29600:29602] CHIP:DMG: {
- [1674110158.295314][29600:29602] CHIP:DMG: suppressResponse = false,
- [1674110158.295318][29600:29602] CHIP:DMG: InvokeResponseIBs =
- [1674110158.295327][29600:29602] CHIP:DMG: [
- [1674110158.295331][29600:29602] CHIP:DMG: InvokeResponseIB =
- [1674110158.295339][29600:29602] CHIP:DMG: {
- [1674110158.295344][29600:29602] CHIP:DMG: CommandStatusIB =
- [1674110158.295349][29600:29602] CHIP:DMG: {
- [1674110158.295354][29600:29602] CHIP:DMG: CommandPathIB =
- [1674110158.295361][29600:29602] CHIP:DMG: {
- [1674110158.295366][29600:29602] CHIP:DMG: EndpointId = 0x1,
- [1674110158.295372][29600:29602] CHIP:DMG: ClusterId = 0x4,
- [1674110158.295377][29600:29602] CHIP:DMG: CommandId = 0x4,
- [1674110158.295382][29600:29602] CHIP:DMG: },
- [1674110158.295390][29600:29602] CHIP:DMG:
- [1674110158.295394][29600:29602] CHIP:DMG: StatusIB =
- [1674110158.295401][29600:29602] CHIP:DMG: {
- [1674110158.295407][29600:29602] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674110158.295412][29600:29602] CHIP:DMG: },
- [1674110158.295418][29600:29602] CHIP:DMG:
- [1674110158.295422][29600:29602] CHIP:DMG: },
- [1674110158.295429][29600:29602] CHIP:DMG:
- [1674110158.295433][29600:29602] CHIP:DMG: },
- [1674110158.295440][29600:29602] CHIP:DMG:
- [1674110158.295445][29600:29602] CHIP:DMG: ],
- [1674110158.295452][29600:29602] CHIP:DMG:
- [1674110158.295457][29600:29602] CHIP:DMG: InteractionModelRevision = 1
- [1674110158.295461][29600:29602] CHIP:DMG: },
- disabled: true
-
- - label:
- "TH sends AddGroup Command to DUT on PIXIT.G.ENDPOINT with the the
- following settings GroupID: 0x0103,GroupName: Test Group"
- verification: |
- ./chip-tool groups add-group "0x0103" "Test Group" 1 1
-
- [1674110214.486414][29605:29607] CHIP:DMG: },
- [1674110214.486440][29605:29607] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0004 Command=0x0000_0000
- [1674110214.486856][29605:29607] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0004 Command 0x0000_0000
- [1674110214.487108][29605:29607] CHIP:TOO: AddGroupResponse: {
- [1674110214.487116][29605:29607] CHIP:TOO: status: 0
- [1674110214.487119][29605:29607] CHIP:TOO: groupID: 259
- [1674110214.487123][29605:29607] CHIP:TOO: }
- disabled: true
-
- - label:
- "TH sends ViewGroup command with the GroupID to the Group cluster on
- the DUT on PIXIT.G.ENDPOINT"
+ - label: "TH sends ViewGroup command"
PICS: G.S.F00
- verification: |
- ./chip-tool groups view-group "0x0103" 1 1
+ command: "ViewGroup"
+ arguments:
+ values:
+ - name: GroupID
+ value: 0x0103
+ response:
+ values:
+ - name: Status
+ value: 0
+ - name: GroupID
+ value: 0x0103
+ - name: GroupName
+ value: "Test Group"
+ - label: "TH sends ViewGroup command"
+ PICS: "!(G.S.F00)"
+ command: "ViewGroup"
+ arguments:
+ values:
+ - name: GroupID
+ value: 0x0103
+ response:
+ values:
+ - name: Status
+ value: 0
+ - name: GroupID
+ value: 0x0103
+ - name: GroupName
+ value: ""
- [1674110306.198950][29621:29623] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0004 Command=0x0000_0001
- [1674110306.198979][29621:29623] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0004 Command 0x0000_0001
- [1674110306.199016][29621:29623] CHIP:TOO: ViewGroupResponse: {
- [1674110306.199030][29621:29623] CHIP:TOO: status: 0
- [1674110306.199041][29621:29623] CHIP:TOO: groupID: 259
- [1674110306.199051][29621:29623] CHIP:TOO: groupName: Test Group
- [1674110306.199061][29621:29623] CHIP:TOO: }
- disabled: true
+ - label: "TH sends KeySetRead"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "KeySetRead"
+ arguments:
+ values:
+ - name: GroupKeySetID
+ value: 0x01a3
+ response:
+ values:
+ - name: GroupKeySet
+ value:
+ {
+ GroupKeySetID: 0x01a3,
+ GroupKeySecurityPolicy: 0,
+ EpochKey0: null,
+ EpochStartTime0: 2220000,
+ EpochKey1: null,
+ EpochStartTime1: 2220001,
+ EpochKey2: null,
+ EpochStartTime2: 2220002,
+ }
- - label:
- "TH sends ViewGroup command with the GroupID to the Group cluster on
- the DUT on PIXIT.G.ENDPOINT"
- PICS: " !G.S.F00 "
- verification: |
- Verify DUT sends a ViewGroupResponse command with
-
- Status: SUCCESS
-
- GroupID: 0x0103
-
- GroupName: ""
- disabled: true
-
- - label:
- "TH sends KeySetRead command to GroupKeyManagement cluster with
- GroupKeySetID as 0x01a3"
- verification: |
- ./chip-tool groupkeymanagement key-set-read "0x01a3" 1 0
-
- [1674110375.913702][29626:29628] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003F Command=0x0000_0002
- [1674110375.913742][29626:29628] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Command 0x0000_0002
- [1674110375.914256][29626:29628] CHIP:TOO: KeySetReadResponse: {
- [1674110375.914277][29626:29628] CHIP:TOO: groupKeySet: {
- [1674110375.914293][29626:29628] CHIP:TOO: GroupKeySetID: 419
- [1674110375.914306][29626:29628] CHIP:TOO: GroupKeySecurityPolicy: 0
- [1674110375.914317][29626:29628] CHIP:TOO: EpochKey0: null
- [1674110375.914329][29626:29628] CHIP:TOO: EpochStartTime0: 2220000
- [1674110375.914339][29626:29628] CHIP:TOO: EpochKey1: null
- [1674110375.914350][29626:29628] CHIP:TOO: EpochStartTime1: 2220001
- [1674110375.914359][29626:29628] CHIP:TOO: EpochKey2: null
- [1674110375.914369][29626:29628] CHIP:TOO: EpochStartTime2: 2220002
- [1674110375.914379][29626:29628] CHIP:TOO: }
- [1674110375.914390][29626:29628] CHIP:TOO: }
- disabled: true
-
- - label:
- "TH reads GroupKeyMap Attribute from the GroupKeyManagement cluster
- from DUT"
- verification: |
- ./chip-tool groupkeymanagement read group-key-map 1 0
-
- [1674110435.952959][29634:29636] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0000 DataVersion: 624171954
- [1674110435.953367][29634:29636] CHIP:TOO: GroupKeyMap: 1 entries
- [1674110435.953401][29634:29636] CHIP:TOO: [1]: {
- [1674110435.953407][29634:29636] CHIP:TOO: GroupId: 259
- [1674110435.953411][29634:29636] CHIP:TOO: GroupKeySetID: 419
- [1674110435.953414][29634:29636] CHIP:TOO: FabricIndex: 1
- [1674110435.953417][29634:29636] CHIP:TOO: }
- disabled: true
-
- - label:
- "TH reads GroupTable attribute from GroupKeyManagement cluster on DUT
- using a fabric-filtered read."
+ - label: "TH reads GroupTable attribute"
+ cluster: "Group Key Management"
+ endpoint: 0
PICS: G.S.F00
- verification: |
- ./chip-tool groupkeymanagement read group-table 1 0
+ command: "readAttribute"
+ attribute: "GroupTable"
+ response:
+ value:
+ [
+ {
+ GroupId: 0x0103,
+ Endpoints: [endpoint],
+ GroupName: "Test Group",
+ },
+ ]
- [1674110549.621751][29686:29688] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0001 DataVersion: 624171954
- [1674110549.621779][29686:29688] CHIP:TOO: GroupTable: 1 entries
- [1674110549.621810][29686:29688] CHIP:TOO: [1]: {
- [1674110549.621819][29686:29688] CHIP:TOO: GroupId: 259
- [1674110549.621826][29686:29688] CHIP:TOO: Endpoints: 1 entries
- [1674110549.621833][29686:29688] CHIP:TOO: [1]: 1
- [1674110549.621839][29686:29688] CHIP:TOO: GroupName: Test Group
- [1674110549.621845][29686:29688] CHIP:TOO: FabricIndex: 1
- [1674110549.621849][29686:29688] CHIP:TOO: }
- disabled: true
+ - label: "TH reads GroupTable attribute"
+ cluster: "Group Key Management"
+ endpoint: 0
+ PICS: "!(G.S.F00)"
+ command: "readAttribute"
+ attribute: "GroupTable"
+ response:
+ value: [{ GroupId: 0x0103, Endpoints: [endpoint], GroupName: "" }]
- - label:
- "TH reads GroupTable attribute from GroupKeyManagement cluster on DUT
- using a fabric-filtered read."
- PICS: " !G.S.F00 "
- verification: |
- F00(GN) feature is supporting for GroupTable attribute
- disabled: true
+ - label: "TH removes the GroupKeySet"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "KeySetRemove"
+ arguments:
+ values:
+ - name: GroupKeySetID
+ value: 0x01a3
- - label:
- "TH removes the Group key set that was added by sending a KeySetRemove
- command to the GroupKeyManagement cluster with the GroupKeySetID field
- set to 0x01a3"
- verification: |
- ./chip-tool groupkeymanagement key-set-remove "0x01a3" 1 0
+ - label: "TH verifies the corresponding GroupKeyMap entry has been removed"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "readAttribute"
+ attribute: "GroupKeyMap"
+ response:
+ value: []
+ - label: "TH cleans up groups using RemoveAllGroups command"
+ command: "RemoveAllGroups"
- [1674110684.044225][29696:29698] CHIP:DMG: InvokeResponseMessage =
- [1674110684.044235][29696:29698] CHIP:DMG: {
- [1674110684.044246][29696:29698] CHIP:DMG: suppressResponse = false,
- [1674110684.044256][29696:29698] CHIP:DMG: InvokeResponseIBs =
- [1674110684.044277][29696:29698] CHIP:DMG: [
- [1674110684.044288][29696:29698] CHIP:DMG: InvokeResponseIB =
- [1674110684.044310][29696:29698] CHIP:DMG: {
- [1674110684.044320][29696:29698] CHIP:DMG: CommandStatusIB =
- [1674110684.044334][29696:29698] CHIP:DMG: {
- [1674110684.044345][29696:29698] CHIP:DMG: CommandPathIB =
- [1674110684.044358][29696:29698] CHIP:DMG: {
- [1674110684.044372][29696:29698] CHIP:DMG: EndpointId = 0x0,
- [1674110684.044385][29696:29698] CHIP:DMG: ClusterId = 0x3f,
- [1674110684.044397][29696:29698] CHIP:DMG: CommandId = 0x3,
- [1674110684.044408][29696:29698] CHIP:DMG: },
- [1674110684.044426][29696:29698] CHIP:DMG:
- [1674110684.044438][29696:29698] CHIP:DMG: StatusIB =
- [1674110684.044452][29696:29698] CHIP:DMG: {
- [1674110684.044465][29696:29698] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674110684.044476][29696:29698] CHIP:DMG: },
- [1674110684.044490][29696:29698] CHIP:DMG:
- [1674110684.044499][29696:29698] CHIP:DMG: },
- [1674110684.044517][29696:29698] CHIP:DMG:
- [1674110684.044527][29696:29698] CHIP:DMG: },
- [1674110684.044543][29696:29698] CHIP:DMG:
- [1674110684.044553][29696:29698] CHIP:DMG: ],
- [1674110684.044572][29696:29698] CHIP:DMG:
- [1674110684.044583][29696:29698] CHIP:DMG: InteractionModelRevision = 1
- [1674110684.044592][29696:29698] CHIP:DMG: },
- disabled: true
+ - label: "TH verifies the group has been removed in the GroupTable"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "readAttribute"
+ attribute: "GroupTable"
+ response:
+ value: []
- - label:
- "TH verifies that the key set removal in step 10 also removed the
- corresponding entries in the GroupKeyMap by Reading the GroupKeyMap
- attribute from the GroupKeyManagement cluster using a fabric-filtered
- read."
- verification: |
- " ./chip-tool groupkeymanagement read group-key-map 1 0
-
-
- [1674110744.294550][29707:29709] CHIP:DMG: ReportDataMessage =
- [1674110744.294570][29707:29709] CHIP:DMG: {
- [1674110744.294583][29707:29709] CHIP:DMG: AttributeReportIBs =
- [1674110744.294611][29707:29709] CHIP:DMG: [
- [1674110744.294626][29707:29709] CHIP:DMG: AttributeReportIB =
- [1674110744.294654][29707:29709] CHIP:DMG: {
- [1674110744.294667][29707:29709] CHIP:DMG: AttributeDataIB =
- [1674110744.294686][29707:29709] CHIP:DMG: {
- [1674110744.294703][29707:29709] CHIP:DMG: DataVersion = 0x25341bb2,
- [1674110744.294719][29707:29709] CHIP:DMG: AttributePathIB =
- [1674110744.294739][29707:29709] CHIP:DMG: {
- [1674110744.294756][29707:29709] CHIP:DMG: Endpoint = 0x0,
- [1674110744.294773][29707:29709] CHIP:DMG: Cluster = 0x3f,
- [1674110744.294847][29707:29709] CHIP:DMG: Attribute = 0x0000_0000,
- [1674110744.294864][29707:29709] CHIP:DMG: }
- [1674110744.294885][29707:29709] CHIP:DMG:
- [1674110744.294900][29707:29709] CHIP:DMG: Data = [
- [1674110744.294917][29707:29709] CHIP:DMG:
- [1674110744.294935][29707:29709] CHIP:DMG: ],
- [1674110744.294950][29707:29709] CHIP:DMG: },
- [1674110744.294974][29707:29709] CHIP:DMG:
- [1674110744.294986][29707:29709] CHIP:DMG: },
- [1674110744.295012][29707:29709] CHIP:DMG:
- [1674110744.295023][29707:29709] CHIP:DMG: ],
- [1674110744.295050][29707:29709] CHIP:DMG:
- [1674110744.295063][29707:29709] CHIP:DMG: SuppressResponse = true,
- [1674110744.295079][29707:29709] CHIP:DMG: InteractionModelRevision = 1
- [1674110744.295093][29707:29709] CHIP:DMG: }
- [1674110744.295288][29707:29709] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0000 DataVersion: 624171954
- [1674110744.295368][29707:29709] CHIP:TOO: GroupKeyMap: 0 entries"
- disabled: true
-
- - label:
- "TH cleans up the groups by sending the RemoveAllGroups command to the
- DUT on PIXIT.G.ENDPOINT"
- verification: |
- "./chip-tool groups remove-all-groups 1 1
-
- [1674110831.412092][29723:29725] CHIP:DMG: InvokeResponseMessage =
- [1674110831.412097][29723:29725] CHIP:DMG: {
- [1674110831.412101][29723:29725] CHIP:DMG: suppressResponse = false,
- [1674110831.412104][29723:29725] CHIP:DMG: InvokeResponseIBs =
- [1674110831.412111][29723:29725] CHIP:DMG: [
- [1674110831.412114][29723:29725] CHIP:DMG: InvokeResponseIB =
- [1674110831.412121][29723:29725] CHIP:DMG: {
- [1674110831.412125][29723:29725] CHIP:DMG: CommandStatusIB =
- [1674110831.412130][29723:29725] CHIP:DMG: {
- [1674110831.412134][29723:29725] CHIP:DMG: CommandPathIB =
- [1674110831.412138][29723:29725] CHIP:DMG: {
- [1674110831.412141][29723:29725] CHIP:DMG: EndpointId = 0x1,
- [1674110831.412145][29723:29725] CHIP:DMG: ClusterId = 0x4,
- [1674110831.412149][29723:29725] CHIP:DMG: CommandId = 0x4,
- [1674110831.412153][29723:29725] CHIP:DMG: },
- [1674110831.412158][29723:29725] CHIP:DMG:
- [1674110831.412162][29723:29725] CHIP:DMG: StatusIB =
- [1674110831.412168][29723:29725] CHIP:DMG: {
- [1674110831.412172][29723:29725] CHIP:DMG: status = 0x00 (SUCCESS),
- [1674110831.412175][29723:29725] CHIP:DMG: },
- [1674110831.412180][29723:29725] CHIP:DMG:
- [1674110831.412182][29723:29725] CHIP:DMG: },
- [1674110831.412188][29723:29725] CHIP:DMG:
- [1674110831.412191][29723:29725] CHIP:DMG: },
- [1674110831.412195][29723:29725] CHIP:DMG:
- [1674110831.412198][29723:29725] CHIP:DMG: ],
- [1674110831.412204][29723:29725] CHIP:DMG:
- [1674110831.412207][29723:29725] CHIP:DMG: InteractionModelRevision = 1
- [1674110831.412209][29723:29725] CHIP:DMG: },"
- disabled: true
-
- - label:
- "TH reads verifies the group has been removed by reading the
- GroupTable attribute from GroupKeyManagement cluster on DUT using a
- fabric-filtered read."
- verification: |
- ./chip-tool groupkeymanagement read group-table 1 0
-
-
- [1674110892.787761][29730:29732] CHIP:DMG: ReportDataMessage =
- [1674110892.787768][29730:29732] CHIP:DMG: {
- [1674110892.787772][29730:29732] CHIP:DMG: AttributeReportIBs =
- [1674110892.787780][29730:29732] CHIP:DMG: [
- [1674110892.787783][29730:29732] CHIP:DMG: AttributeReportIB =
- [1674110892.787789][29730:29732] CHIP:DMG: {
- [1674110892.787792][29730:29732] CHIP:DMG: AttributeDataIB =
- [1674110892.787797][29730:29732] CHIP:DMG: {
- [1674110892.787803][29730:29732] CHIP:DMG: DataVersion = 0x25341bb2,
- [1674110892.787806][29730:29732] CHIP:DMG: AttributePathIB =
- [1674110892.787811][29730:29732] CHIP:DMG: {
- [1674110892.787815][29730:29732] CHIP:DMG: Endpoint = 0x0,
- [1674110892.787819][29730:29732] CHIP:DMG: Cluster = 0x3f,
- [1674110892.787825][29730:29732] CHIP:DMG: Attribute = 0x0000_0001,
- [1674110892.787828][29730:29732] CHIP:DMG: }
- [1674110892.787834][29730:29732] CHIP:DMG:
- [1674110892.787840][29730:29732] CHIP:DMG: Data = [
- [1674110892.787843][29730:29732] CHIP:DMG:
- [1674110892.787847][29730:29732] CHIP:DMG: ],
- [1674110892.787850][29730:29732] CHIP:DMG: },
- [1674110892.787855][29730:29732] CHIP:DMG:
- [1674110892.787858][29730:29732] CHIP:DMG: },
- [1674110892.787863][29730:29732] CHIP:DMG:
- [1674110892.787865][29730:29732] CHIP:DMG: ],
- [1674110892.787871][29730:29732] CHIP:DMG:
- [1674110892.787875][29730:29732] CHIP:DMG: SuppressResponse = true,
- [1674110892.787878][29730:29732] CHIP:DMG: InteractionModelRevision = 1
- [1674110892.787881][29730:29732] CHIP:DMG: }
- [1674110892.787953][29730:29732] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0001 DataVersion: 624171954
- [1674110892.787973][29730:29732] CHIP:TOO: GroupTable: 0 entries
- disabled: true
-
- - label:
- "TH writes The ACL attribute in the Access Control cluster to remove
- Operate privileges for group 0x0103 and maintain the current
- administrative privileges for the TH. The following access control
- list shall be used: List item 1 (TH admin): Fabric index: 1,Privilege:
- Administer (5),AuthMode: CASE (2),Subjects: TH node id ([N1]),
- Targets: all (null)"
- verification: |
- Verify that the DUT sends SUCCESS response.
- disabled: true
+ - label: "TH removes ACL Operate privileges for Group 0x0103"
+ cluster: "Access Control"
+ endpoint: 0
+ command: "writeAttribute"
+ attribute: "ACL"
+ arguments:
+ value:
+ [
+ {
+ FabricIndex: 1,
+ Privilege: 5,
+ AuthMode: 2,
+ Subjects: [commissionerNodeId],
+ Targets: null,
+ },
+ ]
diff --git a/src/app/tests/suites/certification/Test_TC_SC_5_2.yaml b/src/app/tests/suites/certification/Test_TC_SC_5_2.yaml
index 152752b..fea8bac 100644
--- a/src/app/tests/suites/certification/Test_TC_SC_5_2.yaml
+++ b/src/app/tests/suites/certification/Test_TC_SC_5_2.yaml
@@ -20,47 +20,141 @@
config:
nodeId: 0x12344321
- cluster: "Basic Information"
- endpoint: 0
+ cluster: "Groups"
+ # Users should set endpoint value on the command line to PIXIT.G.ENDPOINT
+ endpoint: 1
tests:
- - label: "Precondition"
- verification: |
- DUT and TH are commissioned.
+ - label: "Wait for the commissioned device to be retrieved"
+ cluster: "DelayCommands"
+ command: "WaitForCommissionee"
+ arguments:
+ values:
+ - name: "nodeId"
+ value: nodeId
- DUT and TH are part of a common group.- Run TC-SC-5.1 to establish this precondition
+ - label: "TH adds ACL Operate privileges for Group 0x0103"
+ cluster: "Access Control"
+ endpoint: 0
+ command: "writeAttribute"
+ attribute: "ACL"
+ arguments:
+ value:
+ [
+ {
+ FabricIndex: 1,
+ Privilege: 5,
+ AuthMode: 2,
+ Subjects: [commissionerNodeId],
+ Targets: null,
+ },
+ {
+ FabricIndex: 1,
+ Privilege: 3,
+ AuthMode: 3,
+ Subjects: [0x0103],
+ Targets: null,
+ },
+ ]
- DUT supports the Identify cluster
- disabled: true
+ - label: "TH sends KeySetWrite command with TH key"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "KeySetWrite"
+ arguments:
+ values:
+ - name: GroupKeySet
+ value:
+ {
+ GroupKeySetID: 0x01a3,
+ GroupKeySecurityPolicy: 0,
+ EpochKey0: "0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf",
+ EpochStartTime0: 2220000,
+ EpochKey1: "0xd1d1d2d3d4d5d6d7d8d9dadbdcdddedf",
+ EpochStartTime1: 2220001,
+ EpochKey2: "0xd2d1d2d3d4d5d6d7d8d9dadbdcdddedf",
+ EpochStartTime2: 2220002,
+ }
- - label: "TH writes ACL entry by setting AuthMode as Group to DUT"
- verification: |
- As this step is executed in the TC-SC-5.1, we can skip this step during execution.
- disabled: true
+ - label: "TH binds GroupId to GroupKeySet"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "writeAttribute"
+ attribute: "GroupKeyMap"
+ arguments:
+ value: [{ FabricIndex: 1, GroupId: 0x0103, GroupKeySetID: 0x01a3 }]
- - label:
- "TH sends a multicast Identify command with the IdentifyTime set to
- 0x0078 (120s) to DUT with GroupID and PIXIT.G.ENDPOINT"
- PICS: I.S.C00.Rsp
- verification: |
- ./chip-tool identify identify 0x0078 0xffffffffffff0001 1
+ - label: "TH sends RemoveAllGroups command"
+ command: "RemoveAllGroups"
- Verify Identify command on the TH(chip-tool) Log and below is the sample log provided for the raspi platform:
+ - label: "TH sends AddGroup command"
+ command: "AddGroup"
+ arguments:
+ values:
+ - name: GroupID
+ value: 0x0103
+ - name: GroupName
+ value: "Test Group"
+ - label: "TH sends ViewGroup command using group messaging"
+ PICS: G.S.F00
+ command: "ViewGroup"
+ groupId: 0x0103
+ arguments:
+ values:
+ - name: GroupID
+ value: 0x0103
+ response:
+ values:
+ - name: Status
+ value: 0
+ - name: GroupID
+ value: 0x0103
+ - name: GroupName
+ value: "Test Group"
- [1657785273.973231][1618:1623] CHIP:DL: HandlePlatformSpecificBLEEvent 32784[1657785273.973291][1618:1623] CHIP:TOO: Sending command to group 0x1
- [1657785273.973316][1618:1623] CHIP:TOO: Sending cluster (0x00000003) command (0x00000000) on Group 1
- disabled: true
+ - label: "TH sends ViewGroup command using group messaging"
+ PICS: "!(G.S.F00)"
+ command: "ViewGroup"
+ groupId: 0x0103
+ arguments:
+ values:
+ - name: GroupID
+ value: 0x0103
+ response:
+ values:
+ - name: Status
+ value: 0
+ - name: GroupID
+ value: 0x0103
+ - name: GroupName
+ value: ""
- - label:
- "TH reads immediately IdentifyTime attribute from DUT on the
- PIXIT.G.ENDPOINT set by DUT"
- PICS: I.S.A0000
- verification: |
- ./chip-tool identify read identify-time 1 1
+ - label: "TH removes the GroupKeySet"
+ cluster: "Group Key Management"
+ endpoint: 0
+ command: "KeySetRemove"
+ arguments:
+ values:
+ - name: GroupKeySetID
+ value: 0x01a3
- Verify Identify time is approximately equal to 0x0078 (120s),on the TH(chip-tool) Log and below is the sample log provided for the raspi platform:
+ - label: "TH cleans up groups using RemoveAllGroups command"
+ command: "RemoveAllGroups"
- [1657785288.647504][1624:1629] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 1130139861
- [1657785288.647621][1624:1629] CHIP:TOO: identify time: 120
- disabled: true
+ - label: "TH removes ACL Operate privileges for Group 0x0103"
+ cluster: "Access Control"
+ endpoint: 0
+ command: "writeAttribute"
+ attribute: "ACL"
+ arguments:
+ value:
+ [
+ {
+ FabricIndex: 1,
+ Privilege: 5,
+ AuthMode: 2,
+ Subjects: [commissionerNodeId],
+ Targets: null,
+ },
+ ]
diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json
index b216318..857e538 100644
--- a/src/app/tests/suites/ciTests.json
+++ b/src/app/tests/suites/ciTests.json
@@ -154,7 +154,7 @@
],
"PowerSourceConfiguration": ["Test_TC_PSCFG_1_1", "Test_TC_PSCFG_2_1"],
"RelativeHumidityMeasurement": ["Test_TC_RH_1_1", "Test_TC_RH_2_1"],
- "SecureChannel": [],
+ "SecureChannel": ["Test_TC_SC_5_1", "Test_TC_SC_5_2"],
"Switch": ["Test_TC_SWTCH_1_1", "Test_TC_SWTCH_2_1"],
"TemperatureMeasurement": ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"],
"Thermostat": [
diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json
index 9f3d106..f821ed9 100644
--- a/src/app/tests/suites/manualTests.json
+++ b/src/app/tests/suites/manualTests.json
@@ -227,8 +227,6 @@
"Test_TC_SC_4_8",
"Test_TC_SC_4_9",
"Test_TC_SC_4_10",
- "Test_TC_SC_5_1",
- "Test_TC_SC_5_2",
"Test_TC_SC_5_3",
"Test_TC_SC_6_1"
],
diff --git a/src/lib/support/TestGroupData.h b/src/lib/support/TestGroupData.h
index 13c49ee..4cadb3a 100644
--- a/src/lib/support/TestGroupData.h
+++ b/src/lib/support/TestGroupData.h
@@ -44,8 +44,10 @@
{
static const chip::GroupId kGroup1 = 0x0101;
static const chip::GroupId kGroup2 = 0x0102;
+ static const chip::GroupId kGroup3 = 0x0103;
static const chip::KeysetId kKeySet1 = 0x01a1;
static const chip::KeysetId kKeySet2 = 0x01a2;
+ static const chip::KeysetId kKeySet3 = 0x01a3;
// Groups
@@ -57,6 +59,10 @@
ReturnErrorOnFailure(provider->SetGroupInfo(fabric_index, group2));
ReturnErrorOnFailure(provider->AddEndpoint(fabric_index, group2.group_id, 0));
+ const chip::Credentials::GroupDataProvider::GroupInfo group3(kGroup3, "Group #3");
+ ReturnErrorOnFailure(provider->SetGroupInfo(fabric_index, group3));
+ ReturnErrorOnFailure(provider->AddEndpoint(fabric_index, group3.group_id, 0));
+
// Key Sets
chip::Credentials::GroupDataProvider::KeySet keyset1(kKeySet1,
@@ -81,8 +87,20 @@
err = provider->SetKeySet(fabric_index, compressed_fabric_id, keyset2);
ReturnErrorOnFailure(err);
+ chip::Credentials::GroupDataProvider::KeySet keyset3(kKeySet3,
+ chip::Credentials::GroupDataProvider::SecurityPolicy::kTrustFirst, 3);
+ const chip::Credentials::GroupDataProvider::EpochKey epoch_keys3[] = {
+ { 2220000, { 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf } },
+ { 2220001, { 0xd1, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf } },
+ { 2220002, { 0xd2, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf } },
+ };
+ memcpy(keyset3.epoch_keys, epoch_keys3, sizeof(epoch_keys3));
+ err = provider->SetKeySet(fabric_index, compressed_fabric_id, keyset3);
+ ReturnErrorOnFailure(err);
+
provider->SetGroupKeyAt(fabric_index, 0, chip::Credentials::GroupDataProvider::GroupKey(kGroup1, kKeySet1));
provider->SetGroupKeyAt(fabric_index, 1, chip::Credentials::GroupDataProvider::GroupKey(kGroup2, kKeySet2));
+ provider->SetGroupKeyAt(fabric_index, 2, chip::Credentials::GroupDataProvider::GroupKey(kGroup3, kKeySet3));
return CHIP_NO_ERROR;
}
diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h
index 06c412d..1eaa2e8 100644
--- a/zzz_generated/chip-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h
@@ -165,6 +165,8 @@
printf("Test_TC_PSCFG_2_1\n");
printf("Test_TC_RH_1_1\n");
printf("Test_TC_RH_2_1\n");
+ printf("Test_TC_SC_5_1\n");
+ printf("Test_TC_SC_5_2\n");
printf("Test_TC_SWTCH_1_1\n");
printf("Test_TC_SWTCH_2_1\n");
printf("Test_TC_TMP_1_1\n");
@@ -484,8 +486,6 @@
printf("Test_TC_SC_4_8\n");
printf("Test_TC_SC_4_9\n");
printf("Test_TC_SC_4_10\n");
- printf("Test_TC_SC_5_1\n");
- printf("Test_TC_SC_5_2\n");
printf("Test_TC_SC_5_3\n");
printf("Test_TC_SC_6_1\n");
printf("Test_TC_DGSW_2_1\n");
@@ -40972,6 +40972,793 @@
}
};
+class Test_TC_SC_5_1Suite : public TestCommand
+{
+public:
+ Test_TC_SC_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_5_1", 17, credsIssuerConfig)
+ {
+ AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+ AddArgument("cluster", &mCluster);
+ AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+ AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+ }
+
+ ~Test_TC_SC_5_1Suite() {}
+
+ chip::System::Clock::Timeout GetWaitDuration() const override
+ {
+ return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+ }
+
+private:
+ chip::Optional<chip::NodeId> mNodeId;
+ chip::Optional<chip::CharSpan> mCluster;
+ chip::Optional<chip::EndpointId> mEndpoint;
+ chip::Optional<uint16_t> mTimeout;
+
+ chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
+
+ //
+ // Tests methods
+ //
+
+ void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
+ {
+
+ // Allow yaml to access the current commissioner node id.
+ // Default to 0 (undefined node id) so we know if this isn't
+ // set correctly.
+ // Reset on every step in case it changed.
+ chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ (void) commissionerNodeId;
+
+ bool shouldContinue = false;
+
+ switch (mTestIndex - 1)
+ {
+ case 0:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ shouldContinue = true;
+ 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));
+ {
+ chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ }
+ break;
+ case 7:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ {
+ chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ VerifyOrReturn(CheckValue("status", value.status, 0U));
+ VerifyOrReturn(CheckValue("groupID", value.groupID, 259U));
+ VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("Test Group", 10)));
+ }
+ break;
+ case 8:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ {
+ chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ VerifyOrReturn(CheckValue("status", value.status, 0U));
+ VerifyOrReturn(CheckValue("groupID", value.groupID, 259U));
+ VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("", 0)));
+ }
+ break;
+ case 9:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ {
+ chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", value.groupKeySet.groupKeySetID, 419U));
+ VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", value.groupKeySet.groupKeySecurityPolicy, 0U));
+ VerifyOrReturn(CheckValueNull("groupKeySet.epochKey0", value.groupKeySet.epochKey0));
+ VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime0", value.groupKeySet.epochStartTime0));
+ VerifyOrReturn(
+ CheckValue("groupKeySet.epochStartTime0.Value()", value.groupKeySet.epochStartTime0.Value(), 2220000ULL));
+ VerifyOrReturn(CheckValueNull("groupKeySet.epochKey1", value.groupKeySet.epochKey1));
+ VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime1", value.groupKeySet.epochStartTime1));
+ VerifyOrReturn(
+ CheckValue("groupKeySet.epochStartTime1.Value()", value.groupKeySet.epochStartTime1.Value(), 2220001ULL));
+ VerifyOrReturn(CheckValueNull("groupKeySet.epochKey2", value.groupKeySet.epochKey2));
+ VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime2", value.groupKeySet.epochStartTime2));
+ VerifyOrReturn(
+ CheckValue("groupKeySet.epochStartTime2.Value()", value.groupKeySet.epochStartTime2.Value(), 2220002ULL));
+ }
+ break;
+ case 10:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ {
+ chip::app::DataModel::DecodableList<
+ chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType>
+ value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ {
+ auto iter_0 = value.begin();
+ VerifyOrReturn(CheckNextListItemDecodes<decltype(value)>("groupTable", iter_0, 0));
+ VerifyOrReturn(CheckValue("groupTable[0].groupId", iter_0.GetValue().groupId, 259U));
+ {
+ auto iter_2 = iter_0.GetValue().endpoints.begin();
+ VerifyOrReturn(
+ CheckNextListItemDecodes<decltype(iter_0.GetValue().endpoints)>("groupTable[0].endpoints", iter_2, 0));
+ VerifyOrReturn(CheckValue("groupTable[0].endpoints[0]", iter_2.GetValue(),
+ mEndpoint.HasValue() ? mEndpoint.Value() : 1U));
+ VerifyOrReturn(
+ CheckNoMoreListItems<decltype(iter_0.GetValue().endpoints)>("groupTable[0].endpoints", iter_2, 1));
+ }
+ VerifyOrReturn(CheckValuePresent("groupTable[0].groupName", iter_0.GetValue().groupName));
+ VerifyOrReturn(CheckValueAsString("groupTable[0].groupName.Value()", iter_0.GetValue().groupName.Value(),
+ chip::CharSpan("Test Group", 10)));
+ VerifyOrReturn(CheckNoMoreListItems<decltype(value)>("groupTable", iter_0, 1));
+ }
+ }
+ break;
+ case 11:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ {
+ chip::app::DataModel::DecodableList<
+ chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType>
+ value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ {
+ auto iter_0 = value.begin();
+ VerifyOrReturn(CheckNextListItemDecodes<decltype(value)>("groupTable", iter_0, 0));
+ VerifyOrReturn(CheckValue("groupTable[0].groupId", iter_0.GetValue().groupId, 259U));
+ {
+ auto iter_2 = iter_0.GetValue().endpoints.begin();
+ VerifyOrReturn(
+ CheckNextListItemDecodes<decltype(iter_0.GetValue().endpoints)>("groupTable[0].endpoints", iter_2, 0));
+ VerifyOrReturn(CheckValue("groupTable[0].endpoints[0]", iter_2.GetValue(),
+ mEndpoint.HasValue() ? mEndpoint.Value() : 1U));
+ VerifyOrReturn(
+ CheckNoMoreListItems<decltype(iter_0.GetValue().endpoints)>("groupTable[0].endpoints", iter_2, 1));
+ }
+ VerifyOrReturn(CheckValuePresent("groupTable[0].groupName", iter_0.GetValue().groupName));
+ VerifyOrReturn(CheckValueAsString("groupTable[0].groupName.Value()", iter_0.GetValue().groupName.Value(),
+ chip::CharSpan("", 0)));
+ VerifyOrReturn(CheckNoMoreListItems<decltype(value)>("groupTable", iter_0, 1));
+ }
+ }
+ break;
+ case 12:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 13:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ {
+ chip::app::DataModel::DecodableList<
+ chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType>
+ value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ {
+ auto iter_0 = value.begin();
+ VerifyOrReturn(CheckNoMoreListItems<decltype(value)>("groupKeyMap", iter_0, 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));
+ {
+ chip::app::DataModel::DecodableList<
+ chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType>
+ value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ {
+ auto iter_0 = value.begin();
+ VerifyOrReturn(CheckNoMoreListItems<decltype(value)>("groupTable", iter_0, 0));
+ }
+ }
+ break;
+ case 16:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ default:
+ LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
+ }
+
+ if (shouldContinue)
+ {
+ ContinueOnChipMainThread(CHIP_NO_ERROR);
+ }
+ }
+
+ CHIP_ERROR DoTestStep(uint16_t testIndex) override
+ {
+ using namespace chip::app::Clusters;
+ // Allow yaml to access the current commissioner node id.
+ // Default to 0 (undefined node id) so we know if this isn't
+ // set correctly.
+ // Reset on every step in case it changed.
+ chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ (void) commissionerNodeId;
+ switch (testIndex)
+ {
+ case 0: {
+ LogStep(0, "Wait for the commissioned device to be retrieved");
+ ListFreer listFreer;
+ chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+ value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+ return WaitForCommissionee(kIdentityAlpha, value);
+ }
+ case 1: {
+ LogStep(1, "TH adds ACL Operate privileges for Group 0x0103");
+ ListFreer listFreer;
+ chip::app::DataModel::List<const chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type> value;
+
+ {
+ auto * listHolder_0 =
+ new ListHolder<chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type>(2);
+ listFreer.add(listHolder_0);
+
+ listHolder_0->mList[0].privilege =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryPrivilegeEnum>(5);
+ listHolder_0->mList[0].authMode =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryAuthModeEnum>(2);
+ listHolder_0->mList[0].subjects.SetNonNull();
+
+ {
+ auto * listHolder_3 = new ListHolder<uint64_t>(1);
+ listFreer.add(listHolder_3);
+ listHolder_3->mList[0] = commissionerNodeId;
+ listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List<uint64_t>(listHolder_3->mList, 1);
+ }
+ listHolder_0->mList[0].targets.SetNull();
+ listHolder_0->mList[0].fabricIndex = 1U;
+
+ listHolder_0->mList[1].privilege =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryPrivilegeEnum>(3);
+ listHolder_0->mList[1].authMode =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryAuthModeEnum>(3);
+ listHolder_0->mList[1].subjects.SetNonNull();
+
+ {
+ auto * listHolder_3 = new ListHolder<uint64_t>(1);
+ listFreer.add(listHolder_3);
+ listHolder_3->mList[0] = 259ULL;
+ listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List<uint64_t>(listHolder_3->mList, 1);
+ }
+ listHolder_0->mList[1].targets.SetNull();
+ listHolder_0->mList[1].fabricIndex = 1U;
+
+ value = chip::app::DataModel::List<chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type>(
+ listHolder_0->mList, 2);
+ }
+ return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value,
+ chip::NullOptional, chip::NullOptional);
+ }
+ case 2: {
+ LogStep(2, "TH sends KeySetWrite command with incorrect key");
+ ListFreer listFreer;
+ chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value;
+
+ value.groupKeySet.groupKeySetID = 419U;
+ value.groupKeySet.groupKeySecurityPolicy =
+ static_cast<chip::app::Clusters::GroupKeyManagement::GroupKeySecurityPolicy>(0);
+ value.groupKeySet.epochKey0.SetNonNull();
+ value.groupKeySet.epochKey0.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0x00000000000000000000000000000001garbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime0.SetNonNull();
+ value.groupKeySet.epochStartTime0.Value() = 111ULL;
+ value.groupKeySet.epochKey1.SetNonNull();
+ value.groupKeySet.epochKey1.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0x00000000000000000000000000000002garbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime1.SetNonNull();
+ value.groupKeySet.epochStartTime1.Value() = 222ULL;
+ value.groupKeySet.epochKey2.SetNonNull();
+ value.groupKeySet.epochKey2.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0x00000000000000000000000000000003garbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime2.SetNonNull();
+ value.groupKeySet.epochStartTime2.Value() = 333ULL;
+
+ return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional
+
+ );
+ }
+ case 3: {
+ LogStep(3, "TH sends KeySetWrite command with TH key");
+ ListFreer listFreer;
+ chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value;
+
+ value.groupKeySet.groupKeySetID = 419U;
+ value.groupKeySet.groupKeySecurityPolicy =
+ static_cast<chip::app::Clusters::GroupKeyManagement::GroupKeySecurityPolicy>(0);
+ value.groupKeySet.epochKey0.SetNonNull();
+ value.groupKeySet.epochKey0.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedfgarbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime0.SetNonNull();
+ value.groupKeySet.epochStartTime0.Value() = 2220000ULL;
+ value.groupKeySet.epochKey1.SetNonNull();
+ value.groupKeySet.epochKey1.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0xd1d1d2d3d4d5d6d7d8d9dadbdcdddedfgarbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime1.SetNonNull();
+ value.groupKeySet.epochStartTime1.Value() = 2220001ULL;
+ value.groupKeySet.epochKey2.SetNonNull();
+ value.groupKeySet.epochKey2.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0xd2d1d2d3d4d5d6d7d8d9dadbdcdddedfgarbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime2.SetNonNull();
+ value.groupKeySet.epochStartTime2.Value() = 2220002ULL;
+
+ return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional
+
+ );
+ }
+ case 4: {
+ LogStep(4, "TH binds GroupId to GroupKeySet");
+ ListFreer listFreer;
+ chip::app::DataModel::List<const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type> value;
+
+ {
+ auto * listHolder_0 = new ListHolder<chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type>(1);
+ listFreer.add(listHolder_0);
+
+ listHolder_0->mList[0].groupId = 259U;
+ listHolder_0->mList[0].groupKeySetID = 419U;
+ listHolder_0->mList[0].fabricIndex = 1U;
+
+ value = chip::app::DataModel::List<chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type>(
+ listHolder_0->mList, 1);
+ }
+ return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional);
+ }
+ case 5: {
+ LogStep(5, "TH sends RemoveAllGroups command");
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type value;
+ return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveAllGroups::Id, value,
+ chip::NullOptional
+
+ );
+ }
+ case 6: {
+ LogStep(6, "TH sends AddGroup command");
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::AddGroup::Type value;
+ value.groupID = 259U;
+ value.groupName = chip::Span<const char>("Test Groupgarbage: not in length on purpose", 10);
+ return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional
+
+ );
+ }
+ case 7: {
+ LogStep(7, "TH sends ViewGroup command");
+ VerifyOrDo(!ShouldSkip("G.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::ViewGroup::Type value;
+ value.groupID = 259U;
+ return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value,
+ chip::NullOptional
+
+ );
+ }
+ case 8: {
+ LogStep(8, "TH sends ViewGroup command");
+ VerifyOrDo(!ShouldSkip("!(G.S.F00)"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::ViewGroup::Type value;
+ value.groupID = 259U;
+ return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::ViewGroup::Id, value,
+ chip::NullOptional
+
+ );
+ }
+ case 9: {
+ LogStep(9, "TH sends KeySetRead");
+ ListFreer listFreer;
+ chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type value;
+ value.groupKeySetID = 419U;
+ return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id, GroupKeyManagement::Commands::KeySetRead::Id,
+ value, chip::NullOptional
+
+ );
+ }
+ case 10: {
+ LogStep(10, "TH reads GroupTable attribute");
+ VerifyOrDo(!ShouldSkip("G.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+ return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional);
+ }
+ case 11: {
+ LogStep(11, "TH reads GroupTable attribute");
+ VerifyOrDo(!ShouldSkip("!(G.S.F00)"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+ return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional);
+ }
+ case 12: {
+ LogStep(12, "TH removes the GroupKeySet");
+ ListFreer listFreer;
+ chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value;
+ value.groupKeySetID = 419U;
+ return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional
+
+ );
+ }
+ case 13: {
+ LogStep(13, "TH verifies the corresponding GroupKeyMap entry has been removed");
+ return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Attributes::GroupKeyMap::Id, true, chip::NullOptional);
+ }
+ case 14: {
+ LogStep(14, "TH cleans up groups using RemoveAllGroups command");
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type value;
+ return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveAllGroups::Id, value,
+ chip::NullOptional
+
+ );
+ }
+ case 15: {
+ LogStep(15, "TH verifies the group has been removed in the GroupTable");
+ return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Attributes::GroupTable::Id, true, chip::NullOptional);
+ }
+ case 16: {
+ LogStep(16, "TH removes ACL Operate privileges for Group 0x0103");
+ ListFreer listFreer;
+ chip::app::DataModel::List<const chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type> value;
+
+ {
+ auto * listHolder_0 =
+ new ListHolder<chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type>(1);
+ listFreer.add(listHolder_0);
+
+ listHolder_0->mList[0].privilege =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryPrivilegeEnum>(5);
+ listHolder_0->mList[0].authMode =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryAuthModeEnum>(2);
+ listHolder_0->mList[0].subjects.SetNonNull();
+
+ {
+ auto * listHolder_3 = new ListHolder<uint64_t>(1);
+ listFreer.add(listHolder_3);
+ listHolder_3->mList[0] = commissionerNodeId;
+ listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List<uint64_t>(listHolder_3->mList, 1);
+ }
+ listHolder_0->mList[0].targets.SetNull();
+ listHolder_0->mList[0].fabricIndex = 1U;
+
+ value = chip::app::DataModel::List<chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type>(
+ listHolder_0->mList, 1);
+ }
+ return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value,
+ chip::NullOptional, chip::NullOptional);
+ }
+ }
+ return CHIP_NO_ERROR;
+ }
+};
+
+class Test_TC_SC_5_2Suite : public TestCommand
+{
+public:
+ Test_TC_SC_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_5_2", 11, credsIssuerConfig)
+ {
+ AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+ AddArgument("cluster", &mCluster);
+ AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+ AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+ }
+
+ ~Test_TC_SC_5_2Suite() {}
+
+ chip::System::Clock::Timeout GetWaitDuration() const override
+ {
+ return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+ }
+
+private:
+ chip::Optional<chip::NodeId> mNodeId;
+ chip::Optional<chip::CharSpan> mCluster;
+ chip::Optional<chip::EndpointId> mEndpoint;
+ chip::Optional<uint16_t> mTimeout;
+
+ chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
+
+ //
+ // Tests methods
+ //
+
+ void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
+ {
+
+ // Allow yaml to access the current commissioner node id.
+ // Default to 0 (undefined node id) so we know if this isn't
+ // set correctly.
+ // Reset on every step in case it changed.
+ chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ (void) commissionerNodeId;
+
+ bool shouldContinue = false;
+
+ switch (mTestIndex - 1)
+ {
+ case 0:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ shouldContinue = true;
+ 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));
+ {
+ chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ }
+ break;
+ case 6:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ {
+ chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ VerifyOrReturn(CheckValue("status", value.status, 0U));
+ VerifyOrReturn(CheckValue("groupID", value.groupID, 259U));
+ VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("Test Group", 10)));
+ }
+ break;
+ case 7:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ {
+ chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType value;
+ VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
+ VerifyOrReturn(CheckValue("status", value.status, 0U));
+ VerifyOrReturn(CheckValue("groupID", value.groupID, 259U));
+ VerifyOrReturn(CheckValueAsString("groupName", value.groupName, chip::CharSpan("", 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;
+ default:
+ LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
+ }
+
+ if (shouldContinue)
+ {
+ ContinueOnChipMainThread(CHIP_NO_ERROR);
+ }
+ }
+
+ CHIP_ERROR DoTestStep(uint16_t testIndex) override
+ {
+ using namespace chip::app::Clusters;
+ // Allow yaml to access the current commissioner node id.
+ // Default to 0 (undefined node id) so we know if this isn't
+ // set correctly.
+ // Reset on every step in case it changed.
+ chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ (void) commissionerNodeId;
+ switch (testIndex)
+ {
+ case 0: {
+ LogStep(0, "Wait for the commissioned device to be retrieved");
+ ListFreer listFreer;
+ chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+ value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+ return WaitForCommissionee(kIdentityAlpha, value);
+ }
+ case 1: {
+ LogStep(1, "TH adds ACL Operate privileges for Group 0x0103");
+ ListFreer listFreer;
+ chip::app::DataModel::List<const chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type> value;
+
+ {
+ auto * listHolder_0 =
+ new ListHolder<chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type>(2);
+ listFreer.add(listHolder_0);
+
+ listHolder_0->mList[0].privilege =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryPrivilegeEnum>(5);
+ listHolder_0->mList[0].authMode =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryAuthModeEnum>(2);
+ listHolder_0->mList[0].subjects.SetNonNull();
+
+ {
+ auto * listHolder_3 = new ListHolder<uint64_t>(1);
+ listFreer.add(listHolder_3);
+ listHolder_3->mList[0] = commissionerNodeId;
+ listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List<uint64_t>(listHolder_3->mList, 1);
+ }
+ listHolder_0->mList[0].targets.SetNull();
+ listHolder_0->mList[0].fabricIndex = 1U;
+
+ listHolder_0->mList[1].privilege =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryPrivilegeEnum>(3);
+ listHolder_0->mList[1].authMode =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryAuthModeEnum>(3);
+ listHolder_0->mList[1].subjects.SetNonNull();
+
+ {
+ auto * listHolder_3 = new ListHolder<uint64_t>(1);
+ listFreer.add(listHolder_3);
+ listHolder_3->mList[0] = 259ULL;
+ listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List<uint64_t>(listHolder_3->mList, 1);
+ }
+ listHolder_0->mList[1].targets.SetNull();
+ listHolder_0->mList[1].fabricIndex = 1U;
+
+ value = chip::app::DataModel::List<chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type>(
+ listHolder_0->mList, 2);
+ }
+ return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value,
+ chip::NullOptional, chip::NullOptional);
+ }
+ case 2: {
+ LogStep(2, "TH sends KeySetWrite command with TH key");
+ ListFreer listFreer;
+ chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type value;
+
+ value.groupKeySet.groupKeySetID = 419U;
+ value.groupKeySet.groupKeySecurityPolicy =
+ static_cast<chip::app::Clusters::GroupKeyManagement::GroupKeySecurityPolicy>(0);
+ value.groupKeySet.epochKey0.SetNonNull();
+ value.groupKeySet.epochKey0.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedfgarbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime0.SetNonNull();
+ value.groupKeySet.epochStartTime0.Value() = 2220000ULL;
+ value.groupKeySet.epochKey1.SetNonNull();
+ value.groupKeySet.epochKey1.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0xd1d1d2d3d4d5d6d7d8d9dadbdcdddedfgarbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime1.SetNonNull();
+ value.groupKeySet.epochStartTime1.Value() = 2220001ULL;
+ value.groupKeySet.epochKey2.SetNonNull();
+ value.groupKeySet.epochKey2.Value() = chip::ByteSpan(
+ chip::Uint8::from_const_char("0xd2d1d2d3d4d5d6d7d8d9dadbdcdddedfgarbage: not in length on purpose"), 34);
+ value.groupKeySet.epochStartTime2.SetNonNull();
+ value.groupKeySet.epochStartTime2.Value() = 2220002ULL;
+
+ return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Commands::KeySetWrite::Id, value, chip::NullOptional
+
+ );
+ }
+ case 3: {
+ LogStep(3, "TH binds GroupId to GroupKeySet");
+ ListFreer listFreer;
+ chip::app::DataModel::List<const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type> value;
+
+ {
+ auto * listHolder_0 = new ListHolder<chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type>(1);
+ listFreer.add(listHolder_0);
+
+ listHolder_0->mList[0].groupId = 259U;
+ listHolder_0->mList[0].groupKeySetID = 419U;
+ listHolder_0->mList[0].fabricIndex = 1U;
+
+ value = chip::app::DataModel::List<chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type>(
+ listHolder_0->mList, 1);
+ }
+ return WriteAttribute(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Attributes::GroupKeyMap::Id, value, chip::NullOptional, chip::NullOptional);
+ }
+ case 4: {
+ LogStep(4, "TH sends RemoveAllGroups command");
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type value;
+ return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveAllGroups::Id, value,
+ chip::NullOptional
+
+ );
+ }
+ case 5: {
+ LogStep(5, "TH sends AddGroup command");
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::AddGroup::Type value;
+ value.groupID = 259U;
+ value.groupName = chip::Span<const char>("Test Groupgarbage: not in length on purpose", 10);
+ return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::AddGroup::Id, value, chip::NullOptional
+
+ );
+ }
+ case 6: {
+ LogStep(6, "TH sends ViewGroup command using group messaging");
+ VerifyOrDo(!ShouldSkip("G.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::ViewGroup::Type value;
+ value.groupID = 259U;
+ return SendGroupCommand(kIdentityAlpha, 259, Groups::Id, Groups::Commands::ViewGroup::Id, value);
+ }
+ case 7: {
+ LogStep(7, "TH sends ViewGroup command using group messaging");
+ VerifyOrDo(!ShouldSkip("!(G.S.F00)"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::ViewGroup::Type value;
+ value.groupID = 259U;
+ return SendGroupCommand(kIdentityAlpha, 259, Groups::Id, Groups::Commands::ViewGroup::Id, value);
+ }
+ case 8: {
+ LogStep(8, "TH removes the GroupKeySet");
+ ListFreer listFreer;
+ chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type value;
+ value.groupKeySetID = 419U;
+ return SendCommand(kIdentityAlpha, GetEndpoint(0), GroupKeyManagement::Id,
+ GroupKeyManagement::Commands::KeySetRemove::Id, value, chip::NullOptional
+
+ );
+ }
+ case 9: {
+ LogStep(9, "TH cleans up groups using RemoveAllGroups command");
+ ListFreer listFreer;
+ chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type value;
+ return SendCommand(kIdentityAlpha, GetEndpoint(1), Groups::Id, Groups::Commands::RemoveAllGroups::Id, value,
+ chip::NullOptional
+
+ );
+ }
+ case 10: {
+ LogStep(10, "TH removes ACL Operate privileges for Group 0x0103");
+ ListFreer listFreer;
+ chip::app::DataModel::List<const chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type> value;
+
+ {
+ auto * listHolder_0 =
+ new ListHolder<chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type>(1);
+ listFreer.add(listHolder_0);
+
+ listHolder_0->mList[0].privilege =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryPrivilegeEnum>(5);
+ listHolder_0->mList[0].authMode =
+ static_cast<chip::app::Clusters::AccessControl::AccessControlEntryAuthModeEnum>(2);
+ listHolder_0->mList[0].subjects.SetNonNull();
+
+ {
+ auto * listHolder_3 = new ListHolder<uint64_t>(1);
+ listFreer.add(listHolder_3);
+ listHolder_3->mList[0] = commissionerNodeId;
+ listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List<uint64_t>(listHolder_3->mList, 1);
+ }
+ listHolder_0->mList[0].targets.SetNull();
+ listHolder_0->mList[0].fabricIndex = 1U;
+
+ value = chip::app::DataModel::List<chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::Type>(
+ listHolder_0->mList, 1);
+ }
+ return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value,
+ chip::NullOptional, chip::NullOptional);
+ }
+ }
+ return CHIP_NO_ERROR;
+ }
+};
+
class Test_TC_SWTCH_1_1Suite : public TestCommand
{
public:
@@ -106132,144 +106919,6 @@
}
};
-class Test_TC_SC_5_1Suite : public TestCommand
-{
-public:
- Test_TC_SC_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_5_1", 0, credsIssuerConfig)
- {
- AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
- AddArgument("cluster", &mCluster);
- AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
- AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
- }
-
- ~Test_TC_SC_5_1Suite() {}
-
- chip::System::Clock::Timeout GetWaitDuration() const override
- {
- return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
- }
-
-private:
- chip::Optional<chip::NodeId> mNodeId;
- chip::Optional<chip::CharSpan> mCluster;
- chip::Optional<chip::EndpointId> mEndpoint;
- chip::Optional<uint16_t> mTimeout;
-
- chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
-
- //
- // Tests methods
- //
-
- void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
- {
-
- // Allow yaml to access the current commissioner node id.
- // Default to 0 (undefined node id) so we know if this isn't
- // set correctly.
- // Reset on every step in case it changed.
- chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
- (void) commissionerNodeId;
-
- bool shouldContinue = false;
-
- switch (mTestIndex - 1)
- {
- default:
- LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
- }
-
- if (shouldContinue)
- {
- ContinueOnChipMainThread(CHIP_NO_ERROR);
- }
- }
-
- CHIP_ERROR DoTestStep(uint16_t testIndex) override
- {
- using namespace chip::app::Clusters;
- // Allow yaml to access the current commissioner node id.
- // Default to 0 (undefined node id) so we know if this isn't
- // set correctly.
- // Reset on every step in case it changed.
- chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
- (void) commissionerNodeId;
- switch (testIndex)
- {}
- return CHIP_NO_ERROR;
- }
-};
-
-class Test_TC_SC_5_2Suite : public TestCommand
-{
-public:
- Test_TC_SC_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_5_2", 0, credsIssuerConfig)
- {
- AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
- AddArgument("cluster", &mCluster);
- AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
- AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
- }
-
- ~Test_TC_SC_5_2Suite() {}
-
- chip::System::Clock::Timeout GetWaitDuration() const override
- {
- return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
- }
-
-private:
- chip::Optional<chip::NodeId> mNodeId;
- chip::Optional<chip::CharSpan> mCluster;
- chip::Optional<chip::EndpointId> mEndpoint;
- chip::Optional<uint16_t> mTimeout;
-
- chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; }
-
- //
- // Tests methods
- //
-
- void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override
- {
-
- // Allow yaml to access the current commissioner node id.
- // Default to 0 (undefined node id) so we know if this isn't
- // set correctly.
- // Reset on every step in case it changed.
- chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
- (void) commissionerNodeId;
-
- bool shouldContinue = false;
-
- switch (mTestIndex - 1)
- {
- default:
- LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT));
- }
-
- if (shouldContinue)
- {
- ContinueOnChipMainThread(CHIP_NO_ERROR);
- }
- }
-
- CHIP_ERROR DoTestStep(uint16_t testIndex) override
- {
- using namespace chip::app::Clusters;
- // Allow yaml to access the current commissioner node id.
- // Default to 0 (undefined node id) so we know if this isn't
- // set correctly.
- // Reset on every step in case it changed.
- chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
- (void) commissionerNodeId;
- switch (testIndex)
- {}
- return CHIP_NO_ERROR;
- }
-};
-
class Test_TC_SC_5_3Suite : public TestCommand
{
public:
@@ -117180,6 +117829,8 @@
make_unique<Test_TC_PSCFG_2_1Suite>(credsIssuerConfig),
make_unique<Test_TC_RH_1_1Suite>(credsIssuerConfig),
make_unique<Test_TC_RH_2_1Suite>(credsIssuerConfig),
+ make_unique<Test_TC_SC_5_1Suite>(credsIssuerConfig),
+ make_unique<Test_TC_SC_5_2Suite>(credsIssuerConfig),
make_unique<Test_TC_SWTCH_1_1Suite>(credsIssuerConfig),
make_unique<Test_TC_SWTCH_2_1Suite>(credsIssuerConfig),
make_unique<Test_TC_TMP_1_1Suite>(credsIssuerConfig),
@@ -117488,8 +118139,6 @@
make_unique<Test_TC_SC_4_8Suite>(credsIssuerConfig),
make_unique<Test_TC_SC_4_9Suite>(credsIssuerConfig),
make_unique<Test_TC_SC_4_10Suite>(credsIssuerConfig),
- make_unique<Test_TC_SC_5_1Suite>(credsIssuerConfig),
- make_unique<Test_TC_SC_5_2Suite>(credsIssuerConfig),
make_unique<Test_TC_SC_5_3Suite>(credsIssuerConfig),
make_unique<Test_TC_SC_6_1Suite>(credsIssuerConfig),
make_unique<Test_TC_DGSW_2_1Suite>(credsIssuerConfig),
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 6d60cba..8d2baf9 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
@@ -152,6 +152,8 @@
printf("Test_TC_PSCFG_2_1\n");
printf("Test_TC_RH_1_1\n");
printf("Test_TC_RH_2_1\n");
+ printf("Test_TC_SC_5_1\n");
+ printf("Test_TC_SC_5_2\n");
printf("Test_TC_SWTCH_1_1\n");
printf("Test_TC_TMP_1_1\n");
printf("Test_TC_TMP_2_1\n");
@@ -57980,6 +57982,1263 @@
}
};
+class Test_TC_SC_5_1 : public TestCommandBridge {
+public:
+ // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced
+ Test_TC_SC_5_1()
+ : TestCommandBridge("Test_TC_SC_5_1")
+ , mTestIndex(0)
+ {
+ AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+ AddArgument("cluster", &mCluster);
+ AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+ AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+ }
+ // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull)
+
+ ~Test_TC_SC_5_1() {}
+
+ // Allow yaml to access the current commissioner node id.
+ // Default to 0 (undefined node id) so we know if this isn't
+ // set correctly.
+ // Reset on every step in case it changed.
+ chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+
+ /////////// TestCommand Interface /////////
+ void NextTest() override
+ {
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+
+ if (0 == mTestIndex) {
+ ChipLogProgress(chipTool, " **** Test Start: Test_TC_SC_5_1\n");
+ }
+
+ if (mTestCount == mTestIndex) {
+ ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SC_5_1\n");
+ SetCommandExitStatus(CHIP_NO_ERROR);
+ return;
+ }
+
+ Wait();
+
+ // Ensure we increment mTestIndex before we start running the relevant
+ // command. That way if we lose the timeslice after we send the message
+ // but before our function call returns, we won't end up with an
+ // incorrect mTestIndex value observed when we get the response.
+ switch (mTestIndex++) {
+ case 0:
+ ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n");
+ err = TestWaitForTheCommissionedDeviceToBeRetrieved_0();
+ break;
+ case 1:
+ ChipLogProgress(chipTool, " ***** Test Step 1 : TH adds ACL Operate privileges for Group 0x0103\n");
+ err = TestThAddsAclOperatePrivilegesForGroup0x0103_1();
+ break;
+ case 2:
+ ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends KeySetWrite command with incorrect key\n");
+ err = TestThSendsKeySetWriteCommandWithIncorrectKey_2();
+ break;
+ case 3:
+ ChipLogProgress(chipTool, " ***** Test Step 3 : TH sends KeySetWrite command with TH key\n");
+ err = TestThSendsKeySetWriteCommandWithThKey_3();
+ break;
+ case 4:
+ ChipLogProgress(chipTool, " ***** Test Step 4 : TH binds GroupId to GroupKeySet\n");
+ err = TestThBindsGroupIdToGroupKeySet_4();
+ break;
+ case 5:
+ ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends RemoveAllGroups command\n");
+ err = TestThSendsRemoveAllGroupsCommand_5();
+ break;
+ case 6:
+ ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends AddGroup command\n");
+ err = TestThSendsAddGroupCommand_6();
+ break;
+ case 7:
+ ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends ViewGroup command\n");
+ if (ShouldSkip("G.S.F00")) {
+ NextTest();
+ return;
+ }
+ err = TestThSendsViewGroupCommand_7();
+ break;
+ case 8:
+ ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends ViewGroup command\n");
+ if (ShouldSkip("!(G.S.F00)")) {
+ NextTest();
+ return;
+ }
+ err = TestThSendsViewGroupCommand_8();
+ break;
+ case 9:
+ ChipLogProgress(chipTool, " ***** Test Step 9 : TH sends KeySetRead\n");
+ err = TestThSendsKeySetRead_9();
+ break;
+ case 10:
+ ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads GroupTable attribute\n");
+ if (ShouldSkip("G.S.F00")) {
+ NextTest();
+ return;
+ }
+ err = TestThReadsGroupTableAttribute_10();
+ break;
+ case 11:
+ ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads GroupTable attribute\n");
+ if (ShouldSkip("!(G.S.F00)")) {
+ NextTest();
+ return;
+ }
+ err = TestThReadsGroupTableAttribute_11();
+ break;
+ case 12:
+ ChipLogProgress(chipTool, " ***** Test Step 12 : TH removes the GroupKeySet\n");
+ err = TestThRemovesTheGroupKeySet_12();
+ break;
+ case 13:
+ ChipLogProgress(chipTool, " ***** Test Step 13 : TH verifies the corresponding GroupKeyMap entry has been removed\n");
+ err = TestThVerifiesTheCorrespondingGroupKeyMapEntryHasBeenRemoved_13();
+ break;
+ case 14:
+ ChipLogProgress(chipTool, " ***** Test Step 14 : TH cleans up groups using RemoveAllGroups command\n");
+ err = TestThCleansUpGroupsUsingRemoveAllGroupsCommand_14();
+ break;
+ case 15:
+ ChipLogProgress(chipTool, " ***** Test Step 15 : TH verifies the group has been removed in the GroupTable\n");
+ err = TestThVerifiesTheGroupHasBeenRemovedInTheGroupTable_15();
+ break;
+ case 16:
+ ChipLogProgress(chipTool, " ***** Test Step 16 : TH removes ACL Operate privileges for Group 0x0103\n");
+ err = TestThRemovesAclOperatePrivilegesForGroup0x0103_16();
+ 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;
+ }
+
+ // 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 = 17;
+
+ chip::Optional<chip::NodeId> mNodeId;
+ chip::Optional<chip::CharSpan> mCluster;
+ chip::Optional<chip::EndpointId> mEndpoint;
+ chip::Optional<uint16_t> mTimeout;
+
+ CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0()
+ {
+
+ chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+ value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+ return WaitForCommissionee("alpha", value);
+ }
+
+ CHIP_ERROR TestThAddsAclOperatePrivilegesForGroup0x0103_1()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ id aclArgument;
+ {
+ NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
+ temp_0[0] = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5U];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2U];
+ {
+ NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
+ temp_3[0] = [NSNumber numberWithUnsignedLongLong:commissionerNodeId];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).subjects = temp_3;
+ }
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).targets = nil;
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U];
+
+ temp_0[1] = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:3U];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:3U];
+ {
+ NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
+ temp_3[0] = [NSNumber numberWithUnsignedLongLong:259ULL];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).subjects = temp_3;
+ }
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).targets = nil;
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1U];
+
+ aclArgument = temp_0;
+ }
+ [cluster writeAttributeACLWithValue:aclArgument
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH adds ACL Operate privileges for Group 0x0103 Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsKeySetWriteCommandWithIncorrectKey_2()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ 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:419U];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy =
+ [NSNumber numberWithUnsignedChar:0U];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 =
+ [[NSData alloc] initWithBytes:"0x00000000000000000000000000000001" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 =
+ [NSNumber numberWithUnsignedLongLong:111ULL];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 =
+ [[NSData alloc] initWithBytes:"0x00000000000000000000000000000002" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 =
+ [NSNumber numberWithUnsignedLongLong:222ULL];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 =
+ [[NSData alloc] initWithBytes:"0x00000000000000000000000000000003" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 =
+ [NSNumber numberWithUnsignedLongLong:333ULL];
+
+ [cluster keySetWriteWithParams:params
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH sends KeySetWrite command with incorrect key Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsKeySetWriteCommandWithThKey_3()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ 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:419U];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy =
+ [NSNumber numberWithUnsignedChar:0U];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 =
+ [[NSData alloc] initWithBytes:"0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 =
+ [NSNumber numberWithUnsignedLongLong:2220000ULL];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 =
+ [[NSData alloc] initWithBytes:"0xd1d1d2d3d4d5d6d7d8d9dadbdcdddedf" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 =
+ [NSNumber numberWithUnsignedLongLong:2220001ULL];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 =
+ [[NSData alloc] initWithBytes:"0xd2d1d2d3d4d5d6d7d8d9dadbdcdddedf" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 =
+ [NSNumber numberWithUnsignedLongLong:2220002ULL];
+
+ [cluster keySetWriteWithParams:params
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH sends KeySetWrite command with TH key Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThBindsGroupIdToGroupKeySet_4()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ 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 = [NSNumber numberWithUnsignedShort:259U];
+ ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:419U];
+ ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U];
+
+ groupKeyMapArgument = temp_0;
+ }
+ [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH binds GroupId to GroupKeySet Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsRemoveAllGroupsCommand_5()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ [cluster removeAllGroupsWithCompletion:^(NSError * _Nullable err) {
+ NSLog(@"TH sends RemoveAllGroups command Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsAddGroupCommand_6()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __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 = [NSNumber numberWithUnsignedShort:259U];
+ params.groupName = @"Test Group";
+ [cluster addGroupWithParams:params
+ completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) {
+ NSLog(@"TH sends AddGroup command Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsViewGroupCommand_7()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRGroupsClusterViewGroupParams alloc] init];
+ params.groupID = [NSNumber numberWithUnsignedShort:259U];
+ [cluster viewGroupWithParams:params
+ completion:^(MTRGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
+ NSLog(@"TH sends ViewGroup command 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, 259U));
+ }
+
+ {
+ id actualValue = values.groupName;
+ VerifyOrReturn(CheckValueAsString("GroupName", actualValue, @"Test Group"));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsViewGroupCommand_8()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRGroupsClusterViewGroupParams alloc] init];
+ params.groupID = [NSNumber numberWithUnsignedShort:259U];
+ [cluster viewGroupWithParams:params
+ completion:^(MTRGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
+ NSLog(@"TH sends ViewGroup command 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, 259U));
+ }
+
+ {
+ id actualValue = values.groupName;
+ VerifyOrReturn(CheckValueAsString("GroupName", actualValue, @""));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsKeySetRead_9()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRGroupKeyManagementClusterKeySetReadParams alloc] init];
+ params.groupKeySetID = [NSNumber numberWithUnsignedShort:419U];
+ [cluster
+ keySetReadWithParams:params
+ completion:^(
+ MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) {
+ NSLog(@"TH sends KeySetRead Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ {
+ id actualValue = values.groupKeySet;
+ VerifyOrReturn(CheckValue("GroupKeySetID",
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID, 419U));
+ VerifyOrReturn(CheckValue("GroupKeySecurityPolicy",
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy, 0U));
+ VerifyOrReturn(CheckValueNull(
+ "EpochKey0", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0));
+ VerifyOrReturn(CheckValueNonNull("EpochStartTime0",
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0));
+ VerifyOrReturn(CheckValue("EpochStartTime0",
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0, 2220000ULL));
+ VerifyOrReturn(CheckValueNull(
+ "EpochKey1", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1));
+ VerifyOrReturn(CheckValueNonNull("EpochStartTime1",
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1));
+ VerifyOrReturn(CheckValue("EpochStartTime1",
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1, 2220001ULL));
+ VerifyOrReturn(CheckValueNull(
+ "EpochKey2", ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2));
+ VerifyOrReturn(CheckValueNonNull("EpochStartTime2",
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2));
+ VerifyOrReturn(CheckValue("EpochStartTime2",
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2, 2220002ULL));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThReadsGroupTableAttribute_10()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRReadParams alloc] init];
+ params.filterByFabric = true;
+ [cluster
+ readAttributeGroupTableWithParams:params
+ completion:^(NSArray * _Nullable value, NSError * _Nullable err) {
+ NSLog(@"TH reads GroupTable attribute Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ {
+ id actualValue = value;
+ VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast<uint32_t>(1)));
+ VerifyOrReturn(CheckValue("GroupId",
+ ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 259U));
+ VerifyOrReturn(CheckValue("Endpoints",
+ [((MTRGroupKeyManagementClusterGroupInfoMapStruct *)
+ actualValue[0]).endpoints count],
+ static_cast<uint32_t>(1)));
+ VerifyOrReturn(CheckValue("",
+ ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).endpoints[0],
+ mEndpoint.HasValue() ? mEndpoint.Value() : 1U));
+ VerifyOrReturn(CheckValueAsString("GroupName",
+ ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName,
+ @"Test Group"));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThReadsGroupTableAttribute_11()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRReadParams alloc] init];
+ params.filterByFabric = true;
+ [cluster
+ readAttributeGroupTableWithParams:params
+ completion:^(NSArray * _Nullable value, NSError * _Nullable err) {
+ NSLog(@"TH reads GroupTable attribute Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ {
+ id actualValue = value;
+ VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast<uint32_t>(1)));
+ VerifyOrReturn(CheckValue("GroupId",
+ ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId, 259U));
+ VerifyOrReturn(CheckValue("Endpoints",
+ [((MTRGroupKeyManagementClusterGroupInfoMapStruct *)
+ actualValue[0]).endpoints count],
+ static_cast<uint32_t>(1)));
+ VerifyOrReturn(CheckValue("",
+ ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).endpoints[0],
+ mEndpoint.HasValue() ? mEndpoint.Value() : 1U));
+ VerifyOrReturn(CheckValueAsString("GroupName",
+ ((MTRGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName, @""));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThRemovesTheGroupKeySet_12()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRGroupKeyManagementClusterKeySetRemoveParams alloc] init];
+ params.groupKeySetID = [NSNumber numberWithUnsignedShort:419U];
+ [cluster keySetRemoveWithParams:params
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH removes the GroupKeySet Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThVerifiesTheCorrespondingGroupKeyMapEntryHasBeenRemoved_13()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRReadParams alloc] init];
+ params.filterByFabric = true;
+ [cluster
+ readAttributeGroupKeyMapWithParams:params
+ completion:^(NSArray * _Nullable value, NSError * _Nullable err) {
+ NSLog(@"TH verifies the corresponding GroupKeyMap entry has been removed Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ {
+ id actualValue = value;
+ VerifyOrReturn(
+ CheckValue("GroupKeyMap", [actualValue count], static_cast<uint32_t>(0)));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThCleansUpGroupsUsingRemoveAllGroupsCommand_14()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ [cluster removeAllGroupsWithCompletion:^(NSError * _Nullable err) {
+ NSLog(@"TH cleans up groups using RemoveAllGroups command Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThVerifiesTheGroupHasBeenRemovedInTheGroupTable_15()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRReadParams alloc] init];
+ params.filterByFabric = true;
+ [cluster
+ readAttributeGroupTableWithParams:params
+ completion:^(NSArray * _Nullable value, NSError * _Nullable err) {
+ NSLog(@"TH verifies the group has been removed in the GroupTable Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ {
+ id actualValue = value;
+ VerifyOrReturn(CheckValue("GroupTable", [actualValue count], static_cast<uint32_t>(0)));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThRemovesAclOperatePrivilegesForGroup0x0103_16()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ id aclArgument;
+ {
+ NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
+ temp_0[0] = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5U];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2U];
+ {
+ NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
+ temp_3[0] = [NSNumber numberWithUnsignedLongLong:commissionerNodeId];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).subjects = temp_3;
+ }
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).targets = nil;
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U];
+
+ aclArgument = temp_0;
+ }
+ [cluster writeAttributeACLWithValue:aclArgument
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH removes ACL Operate privileges for Group 0x0103 Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
+class Test_TC_SC_5_2 : public TestCommandBridge {
+public:
+ // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced
+ Test_TC_SC_5_2()
+ : TestCommandBridge("Test_TC_SC_5_2")
+ , mTestIndex(0)
+ {
+ AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+ AddArgument("cluster", &mCluster);
+ AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint);
+ AddArgument("timeout", 0, UINT16_MAX, &mTimeout);
+ }
+ // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull)
+
+ ~Test_TC_SC_5_2() {}
+
+ // Allow yaml to access the current commissioner node id.
+ // Default to 0 (undefined node id) so we know if this isn't
+ // set correctly.
+ // Reset on every step in case it changed.
+ chip::NodeId commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+
+ /////////// TestCommand Interface /////////
+ void NextTest() override
+ {
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+
+ if (0 == mTestIndex) {
+ ChipLogProgress(chipTool, " **** Test Start: Test_TC_SC_5_2\n");
+ }
+
+ if (mTestCount == mTestIndex) {
+ ChipLogProgress(chipTool, " **** Test Complete: Test_TC_SC_5_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 adds ACL Operate privileges for Group 0x0103\n");
+ err = TestThAddsAclOperatePrivilegesForGroup0x0103_1();
+ break;
+ case 2:
+ ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends KeySetWrite command with TH key\n");
+ err = TestThSendsKeySetWriteCommandWithThKey_2();
+ break;
+ case 3:
+ ChipLogProgress(chipTool, " ***** Test Step 3 : TH binds GroupId to GroupKeySet\n");
+ err = TestThBindsGroupIdToGroupKeySet_3();
+ break;
+ case 4:
+ ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends RemoveAllGroups command\n");
+ err = TestThSendsRemoveAllGroupsCommand_4();
+ break;
+ case 5:
+ ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends AddGroup command\n");
+ err = TestThSendsAddGroupCommand_5();
+ break;
+ case 6:
+ ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends ViewGroup command using group messaging\n");
+ if (ShouldSkip("G.S.F00")) {
+ NextTest();
+ return;
+ }
+ err = TestThSendsViewGroupCommandUsingGroupMessaging_6();
+ break;
+ case 7:
+ ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends ViewGroup command using group messaging\n");
+ if (ShouldSkip("!(G.S.F00)")) {
+ NextTest();
+ return;
+ }
+ err = TestThSendsViewGroupCommandUsingGroupMessaging_7();
+ break;
+ case 8:
+ ChipLogProgress(chipTool, " ***** Test Step 8 : TH removes the GroupKeySet\n");
+ err = TestThRemovesTheGroupKeySet_8();
+ break;
+ case 9:
+ ChipLogProgress(chipTool, " ***** Test Step 9 : TH cleans up groups using RemoveAllGroups command\n");
+ err = TestThCleansUpGroupsUsingRemoveAllGroupsCommand_9();
+ break;
+ case 10:
+ ChipLogProgress(chipTool, " ***** Test Step 10 : TH removes ACL Operate privileges for Group 0x0103\n");
+ err = TestThRemovesAclOperatePrivilegesForGroup0x0103_10();
+ break;
+ }
+
+ if (CHIP_NO_ERROR != err) {
+ ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err));
+ SetCommandExitStatus(err);
+ }
+ }
+
+ void OnStatusUpdate(const chip::app::StatusIB & status) override
+ {
+ switch (mTestIndex - 1) {
+ case 0:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 1:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 2:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 3:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 4:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 5:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 6:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 7:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 8:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 9:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ case 10:
+ VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+ break;
+ }
+
+ // Go on to the next test.
+ ContinueOnChipMainThread(CHIP_NO_ERROR);
+ }
+
+ chip::System::Clock::Timeout GetWaitDuration() const override
+ {
+ return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
+ }
+
+private:
+ std::atomic_uint16_t mTestIndex;
+ const uint16_t mTestCount = 11;
+
+ chip::Optional<chip::NodeId> mNodeId;
+ chip::Optional<chip::CharSpan> mCluster;
+ chip::Optional<chip::EndpointId> mEndpoint;
+ chip::Optional<uint16_t> mTimeout;
+
+ CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0()
+ {
+
+ chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value;
+ value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL;
+ return WaitForCommissionee("alpha", value);
+ }
+
+ CHIP_ERROR TestThAddsAclOperatePrivilegesForGroup0x0103_1()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ id aclArgument;
+ {
+ NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
+ temp_0[0] = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5U];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2U];
+ {
+ NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
+ temp_3[0] = [NSNumber numberWithUnsignedLongLong:commissionerNodeId];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).subjects = temp_3;
+ }
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).targets = nil;
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U];
+
+ temp_0[1] = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:3U];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:3U];
+ {
+ NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
+ temp_3[0] = [NSNumber numberWithUnsignedLongLong:259ULL];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).subjects = temp_3;
+ }
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).targets = nil;
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1U];
+
+ aclArgument = temp_0;
+ }
+ [cluster writeAttributeACLWithValue:aclArgument
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH adds ACL Operate privileges for Group 0x0103 Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsKeySetWriteCommandWithThKey_2()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ 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:419U];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy =
+ [NSNumber numberWithUnsignedChar:0U];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 =
+ [[NSData alloc] initWithBytes:"0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 =
+ [NSNumber numberWithUnsignedLongLong:2220000ULL];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 =
+ [[NSData alloc] initWithBytes:"0xd1d1d2d3d4d5d6d7d8d9dadbdcdddedf" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 =
+ [NSNumber numberWithUnsignedLongLong:2220001ULL];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 =
+ [[NSData alloc] initWithBytes:"0xd2d1d2d3d4d5d6d7d8d9dadbdcdddedf" length:34];
+ ((MTRGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 =
+ [NSNumber numberWithUnsignedLongLong:2220002ULL];
+
+ [cluster keySetWriteWithParams:params
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH sends KeySetWrite command with TH key Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThBindsGroupIdToGroupKeySet_3()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ 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 = [NSNumber numberWithUnsignedShort:259U];
+ ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:419U];
+ ((MTRGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U];
+
+ groupKeyMapArgument = temp_0;
+ }
+ [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH binds GroupId to GroupKeySet Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsRemoveAllGroupsCommand_4()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ [cluster removeAllGroupsWithCompletion:^(NSError * _Nullable err) {
+ NSLog(@"TH sends RemoveAllGroups command Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsAddGroupCommand_5()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __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 = [NSNumber numberWithUnsignedShort:259U];
+ params.groupName = @"Test Group";
+ [cluster addGroupWithParams:params
+ completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) {
+ NSLog(@"TH sends AddGroup command Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsViewGroupCommandUsingGroupMessaging_6()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRGroupsClusterViewGroupParams alloc] init];
+ params.groupID = [NSNumber numberWithUnsignedShort:259U];
+ [cluster viewGroupWithParams:params
+ completion:^(MTRGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
+ NSLog(@"TH sends ViewGroup command using group messaging 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, 259U));
+ }
+
+ {
+ id actualValue = values.groupName;
+ VerifyOrReturn(CheckValueAsString("GroupName", actualValue, @"Test Group"));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThSendsViewGroupCommandUsingGroupMessaging_7()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRGroupsClusterViewGroupParams alloc] init];
+ params.groupID = [NSNumber numberWithUnsignedShort:259U];
+ [cluster viewGroupWithParams:params
+ completion:^(MTRGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) {
+ NSLog(@"TH sends ViewGroup command using group messaging 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, 259U));
+ }
+
+ {
+ id actualValue = values.groupName;
+ VerifyOrReturn(CheckValueAsString("GroupName", actualValue, @""));
+ }
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThRemovesTheGroupKeySet_8()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroupKeyManagement alloc] initWithDevice:device
+ endpointID:@(0)
+ queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ __auto_type * params = [[MTRGroupKeyManagementClusterKeySetRemoveParams alloc] init];
+ params.groupKeySetID = [NSNumber numberWithUnsignedShort:419U];
+ [cluster keySetRemoveWithParams:params
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH removes the GroupKeySet Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThCleansUpGroupsUsingRemoveAllGroupsCommand_9()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ [cluster removeAllGroupsWithCompletion:^(NSError * _Nullable err) {
+ NSLog(@"TH cleans up groups using RemoveAllGroups command Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+
+ CHIP_ERROR TestThRemovesAclOperatePrivilegesForGroup0x0103_10()
+ {
+
+ MTRBaseDevice * device = GetDevice("alpha");
+ commissionerNodeId = mCommissionerNodeId.ValueOr(0);
+ __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue];
+ VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+ id aclArgument;
+ {
+ NSMutableArray * temp_0 = [[NSMutableArray alloc] init];
+ temp_0[0] = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5U];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2U];
+ {
+ NSMutableArray * temp_3 = [[NSMutableArray alloc] init];
+ temp_3[0] = [NSNumber numberWithUnsignedLongLong:commissionerNodeId];
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).subjects = temp_3;
+ }
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).targets = nil;
+ ((MTRAccessControlClusterAccessControlEntryStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1U];
+
+ aclArgument = temp_0;
+ }
+ [cluster writeAttributeACLWithValue:aclArgument
+ completion:^(NSError * _Nullable err) {
+ NSLog(@"TH removes ACL Operate privileges for Group 0x0103 Error: %@", err);
+
+ VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+ NextTest();
+ }];
+
+ return CHIP_NO_ERROR;
+ }
+};
+
class Test_TC_SWTCH_1_1 : public TestCommandBridge {
public:
// NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced
@@ -134327,6 +135586,8 @@
make_unique<Test_TC_PSCFG_2_1>(),
make_unique<Test_TC_RH_1_1>(),
make_unique<Test_TC_RH_2_1>(),
+ make_unique<Test_TC_SC_5_1>(),
+ make_unique<Test_TC_SC_5_2>(),
make_unique<Test_TC_SWTCH_1_1>(),
make_unique<Test_TC_TMP_1_1>(),
make_unique<Test_TC_TMP_2_1>(),