Skip to content

Commit 9c34316

Browse files
marchemiStephaneGUELECksperling-applerestyled-commits
authored
TBRM Tests scripts consistency with te2 fixes (project-chip#35153)
* Add files via upload Add yaml test script for TBRM * Update TEST_TC_TBRM_2.2.yaml * Update TEST_TC_TBRM_2.3.yaml * Update TEST_TC_TBRM_2.4.yaml * Test script consitancy wit test plan after TE2 * Test script consitancy wit test plan after TE2 * Update src/app/tests/suites/certification/Test_TC_TBRM_2_3.yaml Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> * Update src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> * Restyled by whitespace * Restyled by prettier-yaml * Test_TC_TBRM_2_4. synchronisation with TC-THNETDIR-2.3 according test Plan * Restyled by whitespace * Test tweaks to get CI to pass - Use pairing payload matching the other parameters - Check response of ArmFailSafe commands - Fix bad merge in commissioner_commands.py * Restyled by prettier-yaml --------- Co-authored-by: StephaneGUELEC <94045077+StephaneGUELEC@users.noreply.github.com> Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Karsten Sperling <ksperling@apple.com>
1 parent 7d24ea3 commit 9c34316

File tree

4 files changed

+170
-11
lines changed

4 files changed

+170
-11
lines changed

src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml

+20-2
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,21 @@ tests:
4141
values:
4242
- name: nodeId
4343
value: nodeId
44-
44+
# Step 1
4545
- label: "TH reads the ActiveDatasetTimestamp attribute from the DUT"
4646
command: readAttribute
4747
attribute: ActiveDatasetTimestamp
4848
response:
4949
value: null
5050

51+
# Step 2
5152
- label: "TH reads the PendingDatasetTimestamp attribute from the DUT"
5253
command: readAttribute
5354
attribute: PendingDatasetTimestamp
5455
response:
5556
value: null
5657

58+
# Step 3
5759
- label:
5860
"TH sends a valid ActiveDatasetRequest command to the DUT without
5961
having armed the fail-safe"
@@ -65,6 +67,7 @@ tests:
6567
response:
6668
error: FAILSAFE_REQUIRED
6769

70+
# Step 4
6871
- label: "TH sends ArmFailSafe command to the DUT"
6972
cluster: General Commissioning
7073
command: ArmFailSafe
@@ -75,7 +78,12 @@ tests:
7578
value: 60
7679
- name: Breadcrumb
7780
value: 1
81+
response:
82+
values:
83+
- name: ErrorCode
84+
value: CommissioningErrorEnum.OK
7885

86+
# Step 5
7987
- label: "TH sends an invalid ActiveDatasetRequest command to the DUT"
8088
command: SetActiveDatasetRequest
8189
arguments:
@@ -85,19 +93,28 @@ tests:
8593
response:
8694
error: INVALID_COMMAND
8795

96+
# Step 6
8897
- label: "TH sends a valid ActiveDatasetRequest command to the DUT"
8998
command: SetActiveDatasetRequest
9099
arguments:
91100
values:
92101
- name: ActiveDataset
93102
value: PIXIT.TBRM.THREAD_ACTIVE_DATASET
94103

104+
# Step 7
105+
- label: "TH sends CommissioningComplete command to the DUT"
106+
cluster: General Commissioning
107+
command: CommissioningComplete
108+
endpoint: 0
109+
110+
# Step 8
95111
- label: "TH reads the InterfaceEnabled attribute from the DUT"
96112
command: readAttribute
97113
attribute: InterfaceEnabled
98114
response:
99115
value: true
100116

117+
# Step 9
101118
- label: "TH reads the ActiveDatasetTimestamp attribute from the DUT"
102119
command: readAttribute
103120
attribute: ActiveDatasetTimestamp
@@ -106,7 +123,8 @@ tests:
106123
constraints:
107124
type: int64u
108125

109-
- label: "TH sends a valid GetActiveDatasetRequest command to the DUT"
126+
# Step 10
127+
- label: "TH send a GetActiveDatasetRequest command to the DUT"
110128
command: GetActiveDatasetRequest
111129
response:
112130
values:

src/app/tests/suites/certification/Test_TC_TBRM_2_3.yaml

+20-9
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ tests:
4949
constraints:
5050
type: int64u
5151

52-
- label: "If the ActiveDatasetTimestamp attribute not null, go to step 4"
52+
- label: "If the ActiveDatasetTimestamp attribute not null, go to step 5"
5353
cluster: EqualityCommands
5454
command: UnsignedNumberEquals
5555
arguments:
@@ -75,6 +75,10 @@ tests:
7575
value: 60
7676
- name: Breadcrumb
7777
value: 1
78+
response:
79+
values:
80+
- name: ErrorCode
81+
value: CommissioningErrorEnum.OK
7882

7983
# Step 3
8084
- label: "TH sends a valid ActiveDatasetRequest command to the DUT"
@@ -86,6 +90,13 @@ tests:
8690
value: PIXIT.TBRM.THREAD_ACTIVE_DATASET
8791

8892
# Step 4
93+
- label: "TH sends CommissioningComplete command to the DUT"
94+
runIf: noActiveDataset
95+
cluster: General Commissioning
96+
command: CommissioningComplete
97+
endpoint: 0
98+
99+
# Step 5
89100
- label: "TH reads the PendingDatasetTimestamp attribute from the DUT"
90101
command: readAttribute
91102
attribute: PendingDatasetTimestamp
@@ -94,15 +105,15 @@ tests:
94105
constraints:
95106
type: int64u
96107

97-
# Step 5
108+
# Step 6
98109
- label: "TH sends a SetPendingDatasetRequest command to the DUT"
99110
command: SetPendingDatasetRequest
100111
arguments:
101112
values:
102113
- name: PendingDataset
103114
value: PIXIT.TBRM.THREAD_PENDING_DATASET
104115

105-
# Step 6
116+
# Step 7
106117
- label: "TH sends a GetPendingDatasetRequest command to the DUT"
107118
command: GetPendingDatasetRequest
108119
response:
@@ -112,7 +123,7 @@ tests:
112123
type: octet_string
113124
# TODO: This should be PIXIT.TBRM.THREAD_PENDING_DATASET but ignoring the Delay Timer element if present
114125

115-
# Step 7
126+
# Step 8
116127
- label: "TH reads the PendingDatasetTimestamp attribute from the DUT"
117128
command: readAttribute
118129
attribute: PendingDatasetTimestamp
@@ -121,7 +132,7 @@ tests:
121132
type: int64u
122133
notValue: initialPendingTimestamp
123134

124-
# Step 8
135+
# Step 9
125136
- label:
126137
"TH subscribes to the ActiveDatasetTimestamp attribute from the DUT"
127138
command: subscribeAttribute
@@ -141,15 +152,15 @@ tests:
141152
constraints:
142153
hasValue: true
143154

144-
# Step 9
155+
# Step 10
145156
- label: "TH reads the PendingDatasetTimestamp attribute from the DUT"
146157
command: readAttribute
147158
attribute: PendingDatasetTimestamp
148159
response:
149160
value: null
150161

151-
# Step 10
152-
- label: "TH sends a valid GetActiveDatasetRequest command to the DUT"
162+
# Step 11
163+
- label: "TH sends a GetActiveDatasetRequest command to the DUT"
153164
command: GetActiveDatasetRequest
154165
response:
155166
values:
@@ -158,7 +169,7 @@ tests:
158169
constraints:
159170
type: octet_string
160171

161-
# Step 11
172+
# Step 12
162173
- label: "TH reads the InterfaceEnabled attribute from the DUT"
163174
command: readAttribute
164175
attribute: InterfaceEnabled
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name:
16+
"[TC-TBRM-2.4] Verify that getting Active or Pending Dataset in the PASE
17+
session results in unsupported access"
18+
19+
PICS:
20+
- TBRM.S
21+
22+
config:
23+
nodeId: 0x12344321
24+
25+
payload: "MT:-24J0AFN00KA0648G00"
26+
discriminator: 3840
27+
PakeVerifier:
28+
type: octet_string
29+
defaultValue: "hex:b96170aae803346884724fe9a3b287c30330c2a660375d17bb205a8cf1aecb350457f8ab79ee253ab6a8e46bb09e543ae422736de501e3db37d441fe344920d09548e4c18240630c4ff4913c53513839b7c07fcc0627a1b8573a149fcd1fa466cf"
30+
31+
tests:
32+
- label: "Wait for the commissioned device to be retrieved"
33+
cluster: DelayCommands
34+
command: WaitForCommissionee
35+
arguments:
36+
values:
37+
- name: nodeId
38+
value: nodeId
39+
40+
- label: "Open Commissioning Window"
41+
endpoint: 0
42+
cluster: Administrator Commissioning
43+
command: OpenCommissioningWindow
44+
timedInteractionTimeoutMs: 2000
45+
arguments:
46+
values:
47+
- name: CommissioningTimeout
48+
value: 180
49+
- name: PAKEPasscodeVerifier
50+
value: PakeVerifier
51+
- name: Discriminator
52+
value: discriminator
53+
- name: Iterations
54+
value: 1000
55+
- name: Salt
56+
value: "SPAKE2P Key Salt"
57+
58+
- label: "TH2 establishes a PASE session with the DUT"
59+
identity: beta
60+
cluster: CommissionerCommands
61+
endpoint: 0
62+
command: EstablishPASESession
63+
arguments:
64+
values:
65+
- name: nodeId
66+
value: nodeId
67+
- name: payload
68+
value: payload
69+
70+
- label:
71+
"TH2 send GetActiveDatasetRequest command to the DUT in PASE session"
72+
identity: beta
73+
cluster: Thread Border Router Management
74+
endpoint: 1
75+
command: GetActiveDatasetRequest
76+
response:
77+
error: UNSUPPORTED_ACCESS
78+
79+
- label:
80+
"TH2 send GetPendingDatasetRequest command to the DUT in PASE session"
81+
identity: beta
82+
cluster: Thread Border Router Management
83+
endpoint: 1
84+
command: GetPendingDatasetRequest
85+
response:
86+
error: UNSUPPORTED_ACCESS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: "[TC-TBRM-3.1] Functionality with client as DUT"
16+
17+
PICS:
18+
- TBRM.C
19+
20+
config:
21+
nodeId: 0x12344321
22+
cluster: Thread Border Router Management
23+
endpoint: 1
24+
25+
tests:
26+
# Step 1
27+
- label: "DUT send SetActiveDatasetRequest to TH"
28+
PICS: TBRM.C.C03.Tx
29+
wait: "SetActiveDatasetRequest"
30+
31+
# Step 2
32+
- label: "DUT send SetPendingDatasetRequest to TH"
33+
PICS: TBRM.C.C04.Tx
34+
wait: "SetPendingDatasetRequest"
35+
36+
# Step 3
37+
- label: "DUT send GetActiveDatasetRequest to TH"
38+
PICS: TBRM.C.C00.Tx
39+
wait: "GetActiveDatasetRequest"
40+
41+
# Step 4
42+
- label: "DUT send GetPendingDatasetRequest to TH"
43+
PICS: TBRM.C.C01.Tx
44+
wait: "GetPendingDatasetRequest"

0 commit comments

Comments
 (0)