Skip to content

Commit 76dd4be

Browse files
Add draft test scripts for THNETDIR cluster
Base on CHIP-Specifications/chip-test-plans#4322
1 parent fc0ef7e commit 76dd4be

File tree

2 files changed

+207
-0
lines changed

2 files changed

+207
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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-THNETDIR-2.1] Simple Attributes check with DUT as Server"
16+
17+
PICS:
18+
- THNETDIR.S
19+
20+
config:
21+
nodeId: 0x12344321
22+
cluster: Thread Network Directory
23+
endpoint: 1
24+
25+
tests:
26+
- label: "Wait for the commissioned device to be retrieved"
27+
cluster: DelayCommands
28+
command: WaitForCommissionee
29+
arguments:
30+
values:
31+
- name: nodeId
32+
value: nodeId
33+
34+
- label: "Step 1: TH reads from the DUT the (0x0002) ThreadNetworkTableSize attribute"
35+
command: readAttribute
36+
attribute: ThreadNetworkTableSize
37+
response:
38+
constraints:
39+
type: int8u
40+
minValue: 10 # 2 * SupportedFabrics, with SupportedFabrics >= 5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
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-THNETDIR-2.2] Verification for Add/Remove/Get commands"
16+
17+
PICS:
18+
- THNETDIR.S
19+
20+
config:
21+
nodeId: 0x12344321
22+
cluster: Thread Network Directory
23+
endpoint: 1
24+
25+
TestNetworkDataset:
26+
type: octet_string
27+
defaultValue: "hex:0e080000000000000001000300000f350407fff800020839758ec8144b07fb0708fdf1f1add0797dc00510f366cec7a446bab978d90d27abe38f23030f4f70656e5468726561642d353933380102593804103ca67c969efb0d0c74a4d8ee923b576c0c0402a0f7f8"
28+
TestNetworkExtendedPanId:
29+
type: octet_string
30+
defaultValue: "hex:39758ec8144b07fb"
31+
32+
tests:
33+
- label: "Wait for the commissioned device to be retrieved"
34+
cluster: DelayCommands
35+
command: WaitForCommissionee
36+
arguments:
37+
values:
38+
- name: nodeId
39+
value: nodeId
40+
41+
- label: "TH reads ThreadNetworks attribute from DUT"
42+
command: readAttribute
43+
attribute: ThreadNetworks
44+
response:
45+
saveAs: initialNetworks
46+
constraints:
47+
type: list
48+
49+
- label: "TH reads PreferredExtendedPanID attribute from DUT"
50+
command: readAttribute
51+
attribute: PreferredExtendedPanID
52+
response:
53+
constraints:
54+
type: octet_string
55+
minLength: 8
56+
maxLength: 8
57+
notValue: TestNetworkExtendedPanId
58+
59+
- label: "TH writes ExtendedPanID from TestNetwork to PreferredExtendedPanID on DUT"
60+
command: writeAttribute
61+
attribute: PreferredExtendedPanID
62+
arguments:
63+
value: TestNetworkExtendedPanId
64+
response:
65+
error: CONSTRAINT_ERROR # TestNetwork is not in ThreadNetworks
66+
67+
- label: "TH sends GetOperationalDataset command to DUT with ExtendedPanID from TestNetwork" # ADDED
68+
command: GetOperationalDataset
69+
arguments:
70+
values:
71+
- name: ExtendedPanID
72+
value: TestNetworkExtendedPanId
73+
response:
74+
error: NOT_FOUND
75+
76+
- label: "TH sends AddNetwork command to DUT without a timed interaction" # ADDED
77+
command: AddNetwork
78+
arguments:
79+
values:
80+
- name: OperationalDataset
81+
value: TestNetworkDataset
82+
response:
83+
error: NEEDS_TIMED_INTERACTION
84+
85+
- label: "TH sends AddNetwork command to DUT with TestNetwork dataset"
86+
command: AddNetwork
87+
timedInteractionTimeoutMs: 2000
88+
arguments:
89+
values:
90+
- name: OperationalDataset
91+
value: TestNetworkDataset
92+
93+
- label: "TH reads ThreadNetworks attribute from DUT"
94+
command: readAttribute
95+
attribute: ThreadNetworks
96+
response:
97+
constraints:
98+
type: list # TODO: Verify one entry matching TestNetwork has been added
99+
100+
- label: "TH sends GetOperationalDataset command to DUT with ExtendedPanID from TestNetwork"
101+
command: GetOperationalDataset
102+
arguments:
103+
values:
104+
- name: ExtendedPanID
105+
value: TestNetworkExtendedPanId
106+
response:
107+
values:
108+
- name: OperationalDataset
109+
value: TestNetworkDataset
110+
111+
- label: "TH writes ExtendedPanID from TestNetwork to PreferredExtendedPanID on DUT"
112+
command: writeAttribute
113+
attribute: PreferredExtendedPanID
114+
arguments:
115+
value: TestNetworkExtendedPanId
116+
117+
- label: "TH reads PreferredExtendedPanID attribute from DUT"
118+
command: readAttribute
119+
attribute: PreferredExtendedPanID
120+
response:
121+
value: TestNetworkExtendedPanId
122+
123+
- label: "TH sends RemoveNetwork command to DUT without a timed interaction" # ADDED
124+
command: RemoveNetwork
125+
arguments:
126+
values:
127+
- name: ExtendedPanID
128+
value: TestNetworkExtendedPanId
129+
response:
130+
error: NEEDS_TIMED_INTERACTION
131+
132+
- label: "TH sends RemoveNetwork command to DUT with ExtendedPanID of TestNetwork while it is the preferred network"
133+
command: RemoveNetwork
134+
timedInteractionTimeoutMs: 2000
135+
arguments:
136+
values:
137+
- name: ExtendedPanID
138+
value: TestNetworkExtendedPanId
139+
response:
140+
error: CONSTRAINT_ERROR # Preferred network cannot be removed
141+
142+
- label: "TH writes null to PreferredExtendedPanID on DUT"
143+
command: writeAttribute
144+
attribute: PreferredExtendedPanID
145+
arguments:
146+
value: null
147+
148+
- label: "TH reads PreferredExtendedPanID attribute from DUT"
149+
command: readAttribute
150+
attribute: PreferredExtendedPanID
151+
response:
152+
value: null
153+
154+
- label: "TH sends RemoveNetwork command to DUT with ExtendedPanID of TestNetwork"
155+
command: RemoveNetwork
156+
timedInteractionTimeoutMs: 2000
157+
arguments:
158+
values:
159+
- name: ExtendedPanID
160+
value: TestNetworkExtendedPanId
161+
162+
163+
- label: "TH reads ThreadNetworks attribute from DUT"
164+
command: readAttribute
165+
attribute: ThreadNetworks
166+
response:
167+
value: initialNetworks # TODO: Ignore order

0 commit comments

Comments
 (0)