forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest_TC_OPCREDS_3_7.yaml
297 lines (273 loc) · 10.4 KB
/
Test_TC_OPCREDS_3_7.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: 15.2.6. [TC-OPCREDS-3.7] Add Second Fabric over CASE [DUT-Server]
PICS:
- OPCREDS.S
config:
nodeId: 0x12344321
cluster: "Operational Credentials"
endpoint: 0
tests:
- label: "Precondition"
verification: |
TH1 and TH2 are 2 clients that trust each other
disabled: true
- label: "Wait for the alpha device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId
- label:
"Step 1: Factory Reset DUT (to ensure NOC list is empty at the
beginning of the following steps)"
PICS: OPCREDS.S.A0000
# verification: ""
# Disabling this step, because the test starts with a DUT device that has just been commissioned by the TH1 commissioner
disabled: true
- label:
"Step 2: Start the commissioning process of DUT by TH1 on the first
Fabric."
# PICS: ""
# verification: "Verify that TH1 successfully completes commissioning, including establishing a CASE session on the operational network and issuing a CommissioningComplete command."
# Disabling this step, because the test starts with a DUT device that has just been commissioned by the TH1 commissioner
disabled: true
- label:
"Step 3.1: Save the FabricIndex for TH1 as TH1_Fabric_Index for future
use."
PICS: OPCREDS.S.A0001
identity: "alpha"
command: "readAttribute"
cluster: "Operational Credentials"
attribute: "CurrentFabricIndex"
response:
saveAs: TH1_Fabric_Index
- label:
"Step 3.2: TH1 does a fabric-filtered read of the Fabrics attribute
from the Node Operational Credentials cluster. Save the FabricIndex
for TH1 as TH1_Fabric_Index for future use."
identity: "alpha"
command: "readAttribute"
cluster: "Operational Credentials"
attribute: "Fabrics"
fabricFiltered: true
response:
value: [{ "FabricIndex": TH1_Fabric_Index, "Label": "" }]
constraints:
type: list
# verification: "Verify that there is a single entry in the list and the FabricIndex for that entry matches TH1_Fabric_Index."
- label:
"Step 4: TH1 sends ArmFailSafe command to the DUT with the
ExpiryLengthSeconds field set to 60 seconds"
PICS: CGEN.S.C00.Rsp && CGEN.S.C01.Tx
identity: "alpha"
cluster: "General Commissioning"
command: "ArmFailSafe"
arguments:
values:
- name: "ExpiryLengthSeconds"
value: 60
- name: "Breadcrumb"
value: 0
response:
values:
- name: "ErrorCode"
value: 0 # OK
# verification: "Verify that the DUT sends ArmFailSafeResponse command to TH1 with field ErrorCode as OK(0)"
- label: "Step 5: TH1 Sends CSRRequest command with a random 32-byte nonce."
PICS: OPCREDS.S.C04.Rsp
identity: "alpha"
command: "CSRRequest"
cluster: "Operational Credentials"
arguments:
values:
- name: CSRNonce
value: "\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07"
response:
values:
- name: "NOCSRElements"
saveAs: NOCSRElements
- name: "AttestationSignature"
saveAs: attestationSignature
# verification: "Step 5: Verify that the DUT responds with the CSRResponse command."
- label:
"Step 6.1: Read the commissioner root certificate from TH2's fabric.
Save RCAC as Root_CA_Certificate_TH2"
# PICS:
identity: "beta"
cluster: "CommissionerCommands"
command: "GetCommissionerRootCertificate"
response:
values:
- name: "RCAC"
saveAs: Root_CA_Certificate_TH2
# verification: ""
- label:
"Step 6.2: TH2 generates the NOC, the Root CA Certificate and ICAC
using the CSR elements from Step 5 and selects an IPK, all for use by
TH2. Save ICAC as Intermediate_Certificate_TH2. Save NOC as
Node_Operational_Certificate_TH2. Save IPK as IPK_TH2. Extract the
RCAC public key and save as Root_Public_Key_TH2."
# PICS:
identity: "beta"
cluster: "CommissionerCommands"
command: "IssueNocChain"
arguments:
values:
- name: "Elements"
value: NOCSRElements
- name: "nodeId"
value: 0x43211234
response:
values:
- name: "NOC"
saveAs: Node_Operational_Certificate_TH2
- name: "ICAC"
saveAs: Intermediate_Certificate_TH2
- name: "IPK"
saveAs: IPK_TH2
# verification: ""
- label: "Step 7.1: Read the commissioner node ID from TH2"
# PICS:
identity: "beta"
cluster: "CommissionerCommands"
command: "GetCommissionerNodeId"
response:
values:
- name: "nodeId"
saveAs: Commissioner_Node_Id_TH2
# verification: ""
- label:
"Step 7.2: TH1 sends AddTrustedRootCertificate command to DUT with
RootCACertificate set to Root_CA_Certificate_TH2"
PICS: OPCREDS.S.C0b.Rsp
identity: "alpha"
command: "AddTrustedRootCertificate"
cluster: "Operational Credentials"
arguments:
values:
- name: "RootCACertificate"
value: Root_CA_Certificate_TH2
# verification: "Verify that AddTrustedRootCertificate command succeeds by sending the status code as SUCCESS"
- label:
"Step 8: TH1 sends the AddNOC command to DUT with the following
fields: NOCValue as Node_Operational_Certificate_TH2. ICACValue as
Intermediate_Certificate_TH2. IpkValue as IPK_TH2. CaseAdminSubject as
the NodeID of TH2. AdminVendorId as the Vendor ID of TH2."
PICS: OPCREDS.S.C06.Rsp && OPCREDS.S.C08.Tx
identity: "alpha"
command: "AddNOC"
cluster: "Operational Credentials"
arguments:
values:
- name: "NOCValue"
value: Node_Operational_Certificate_TH2
- name: "ICACValue"
value: Intermediate_Certificate_TH2
- name: "IPKValue"
value: IPK_TH2
- name: "CaseAdminSubject"
value: Commissioner_Node_Id_TH2
- name: "AdminVendorId"
value: 0xFFF1
response:
values:
- name: "StatusCode"
value: 0
# verification: "Verify that DUT responds with NOCResponse with status code OK"
- label: "Step 9: TH2 starts discovery of DUT using Operational Discovery"
# PICS: ""
# verification: ""
# Disabling this step as this occurs from the AddNOC command being run
disabled: true
- label:
"Step 10: TH2 opens a CASE session with DUT over operational network."
# PICS: ""
identity: "beta"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: 0x43211234
# verification: "DUT is able to open the CASE session with TH2"
- label: "Step 11: TH2 sends CommissioningComplete command"
PICS: CGEN.S.C05.Tx
nodeId: 0x43211234
identity: "beta"
cluster: "General Commissioning"
command: "CommissioningComplete"
response:
values:
- name: "ErrorCode"
value: 0 # SUCCESS
# verification: "DUT respond with SUCCESS at CommissioningComplete command sent by TH2"
- label:
"Step 12: TH2 reads the Current Fabric Index attribute from the Node
Operational Credentials cluster. Save the FabricIndex for TH2 as
TH2_Fabric_Index."
PICS: OPCREDS.S.A0001
identity: "beta"
nodeId: 0x43211234
command: "readAttribute"
cluster: "Operational Credentials"
attribute: "CurrentFabricIndex"
response:
saveAs: TH2_Fabric_Index
# verification: ""
- label:
"Step 13a: TH1 does a fabric-filtered read of the Fabrics attribute
from the Node Operational Credentials cluster"
nodeId: 0x43211234
command: "readAttribute"
cluster: "Operational Credentials"
attribute: "Fabrics"
fabricFiltered: true
response:
value: [{ "FabricIndex": TH1_Fabric_Index, "Label": "" }]
constraints:
type: list
# verification: ""
- label:
"Step 13b: TH2 does a fabric-filtered read of the Fabrics attribute
from the Node Operational Credentials cluster"
PICS: OPCREDS.S.A0001
identity: "beta"
nodeId: 0x43211234
command: "readAttribute"
cluster: "Operational Credentials"
attribute: "Fabrics"
fabricFiltered: true
response:
value: [{ "FabricIndex": TH2_Fabric_Index, "Label": "" }]
constraints:
type: list
# verification: "Verify that there are 2 entries in the list where one entry matches TH1_Fabric_Index and the other matches TH2_Fabric_Index."
- label:
"Step 14: TH1 sends RemoveFabric command to DUT with the FabricIndex
field set to TH2_Fabric_Index."
PICS: OPCREDS.S.C0a.Rsp
identity: "alpha"
command: "RemoveFabric"
cluster: "Operational Credentials"
arguments:
values:
- name: "FabricIndex"
value: TH2_Fabric_Index
response:
values:
- name: "StatusCode"
value: 0
# verification: "Verify that DUT sends NOCResponse command with status code OK"