@@ -25,13 +25,16 @@ config:
25
25
# Note: TestNetwork* values need to match what's encoded in TestNetworkDataset
26
26
TestNetworkDataset :
27
27
type : octet_string
28
- defaultValue : " hex:0e080000000000000001000300000f350407fff800020839758ec8144b07fb0708fdf1f1add0797dc00510f366cec7a446bab978d90d27abe38f23030f4f70656e5468726561642d353933380102593804103ca67c969efb0d0c74a4d8ee923b576c0c0402a0f7f8 "
28
+ defaultValue : " hex:0e0800000000000c0001000300000f350407fff800020839758ec8144b07fb0708fdf1f1add0797dc00510f366cec7a446bab978d90d27abe38f23030f4f70656e5468726561642d353933380102593804103ca67c969efb0d0c74a4d8ee923b576c0c0402a0f7f8 "
29
29
TestNetworkExtendedPanId :
30
30
type : octet_string
31
31
defaultValue : " hex:39758ec8144b07fb"
32
32
TestNetworkName : " OpenThread-5938"
33
33
TestNetworkChannel : 15
34
- TestNetworkActiveTimestamp : 1
34
+ TestNetworkActiveTimestamp : 0xc0001
35
+ TestNetworkUpdatedDataset :
36
+ type : octet_string
37
+ defaultValue : " hex:0e0800000000000d0001000300000f350407fff800020839758ec8144b07fb0708fdf1f1add0797dc00510f366cec7a446bab978d90d27abe38f23030f4f70656e5468726561642d353933380102593804103ca67c969efb0d0c74a4d8ee923b576c0c0402a0f7f8"
35
38
36
39
tests :
37
40
- label : " Wait for the commissioned device to be retrieved"
@@ -90,15 +93,15 @@ tests:
90
93
response :
91
94
error : NOT_FOUND
92
95
93
- # TODO: Currently fails with darwin-framework-tool because it automatically performs a timed invoke
94
- # - label: "TH sends AddNetwork command to DUT without a timed interaction"
95
- # command: AddNetwork
96
- # arguments:
97
- # values:
98
- # - name: OperationalDataset
99
- # value: TestNetworkDataset
100
- # response:
101
- # error: NEEDS_TIMED_INTERACTION
96
+ # Note: Unsupported with darwin-framework-tool because it automatically performs a timed invoke
97
+ - label : " TH sends AddNetwork command to DUT without a timed interaction"
98
+ command : AddNetwork
99
+ arguments :
100
+ values :
101
+ - name : OperationalDataset
102
+ value : TestNetworkDataset
103
+ response :
104
+ error : NEEDS_TIMED_INTERACTION
102
105
103
106
- label : " TH sends AddNetwork command to DUT with TestNetwork dataset"
104
107
command : AddNetwork
@@ -116,18 +119,43 @@ tests:
116
119
response :
117
120
constraints :
118
121
type : list
119
- # python: |
120
- # # Split the list into test (our TestNetwork) and rest (everything else)
121
- # test = next((n for n in value if n['ExtendedPanID'] == TestNetworkExtendedPanId), None)
122
- # rest = [n for n in value if n != test]
123
- # # Check test has the expected values and rest == initialNetworks (ignoring order)
124
- # return (test is not None and
125
- # test['NetworkName'] == TestNetworkName and
126
- # test['Channel'] == TestNetworkChannel and
127
- # test['ActiveTimestamp'] == TestNetworkActiveTimestamp and
128
- # len(value) == len(initialNetworks) + 1 and
129
- # len(rest) == len(initialNetworks) and
130
- # all(n in initialNetworks for n in rest))
122
+ python : |
123
+ # Split the list into test (our TestNetwork) and rest (everything else)
124
+ test = next((n for n in value if n['ExtendedPanID'] == TestNetworkExtendedPanId), None)
125
+ rest = [n for n in value if n != test]
126
+ # Check test has the expected values and rest == initialNetworks (ignoring order)
127
+ return (test is not None and
128
+ test['NetworkName'] == TestNetworkName and
129
+ test['Channel'] == TestNetworkChannel and
130
+ test['ActiveTimestamp'] == TestNetworkActiveTimestamp and
131
+ len(value) == len(initialNetworks) + 1 and
132
+ len(rest) == len(initialNetworks) and
133
+ all(n in initialNetworks for n in rest))
134
+
135
+ - label :
136
+ " TH sends GetOperationalDataset command to DUT with ExtendedPanID from
137
+ TestNetwork"
138
+ command : GetOperationalDataset
139
+ arguments :
140
+ values :
141
+ - name : ExtendedPanID
142
+ value : TestNetworkExtendedPanId
143
+ response :
144
+ values :
145
+ - name : OperationalDataset
146
+ value : TestNetworkDataset
147
+
148
+ - label :
149
+ " TH sends AddNetwork command to DUT with TestNetwork dataset matching
150
+ existing Active Timestamp"
151
+ command : AddNetwork
152
+ timedInteractionTimeoutMs : 2000
153
+ arguments :
154
+ values :
155
+ - name : OperationalDataset
156
+ value : TestNetworkDataset
157
+ response :
158
+ error : INVALID_IN_STATE
131
159
132
160
- label :
133
161
" TH sends GetOperationalDataset command to DUT with ExtendedPanID from
@@ -142,6 +170,53 @@ tests:
142
170
- name : OperationalDataset
143
171
value : TestNetworkDataset
144
172
173
+ - label :
174
+ " TH sends AddNetwork command to DUT with updated TestNetwork dataset
175
+ with larger Active Timestamp"
176
+ command : AddNetwork
177
+ timedInteractionTimeoutMs : 2000
178
+ arguments :
179
+ values :
180
+ - name : OperationalDataset
181
+ value : TestNetworkUpdatedDataset
182
+
183
+ - label :
184
+ " TH sends GetOperationalDataset command to DUT with ExtendedPanID from
185
+ TestNetwork"
186
+ command : GetOperationalDataset
187
+ arguments :
188
+ values :
189
+ - name : ExtendedPanID
190
+ value : TestNetworkExtendedPanId
191
+ response :
192
+ values :
193
+ - name : OperationalDataset
194
+ value : TestNetworkUpdatedDataset
195
+
196
+ - label :
197
+ " TH sends AddNetwork command to DUT with original TestNetwork dataset"
198
+ command : AddNetwork
199
+ timedInteractionTimeoutMs : 2000
200
+ arguments :
201
+ values :
202
+ - name : OperationalDataset
203
+ value : TestNetworkDataset
204
+ response :
205
+ error : INVALID_IN_STATE
206
+
207
+ - label :
208
+ " TH sends GetOperationalDataset command to DUT with ExtendedPanID from
209
+ TestNetwork"
210
+ command : GetOperationalDataset
211
+ arguments :
212
+ values :
213
+ - name : ExtendedPanID
214
+ value : TestNetworkExtendedPanId
215
+ response :
216
+ values :
217
+ - name : OperationalDataset
218
+ value : TestNetworkUpdatedDataset
219
+
145
220
- label :
146
221
" TH writes ExtendedPanID from TestNetwork to PreferredExtendedPanID on
147
222
DUT"
@@ -158,15 +233,15 @@ tests:
158
233
response :
159
234
value : TestNetworkExtendedPanId
160
235
161
- # TODO: Currently fails with darwin-framework-tool because it automatically performs a timed invoke
162
- # - label: "TH sends RemoveNetwork command to DUT without a timed interaction"
163
- # command: RemoveNetwork
164
- # arguments:
165
- # values:
166
- # - name: ExtendedPanID
167
- # value: TestNetworkExtendedPanId
168
- # response:
169
- # error: NEEDS_TIMED_INTERACTION
236
+ # Note: Unsupported with darwin-framework-tool because it automatically performs a timed invoke
237
+ - label : " TH sends RemoveNetwork command to DUT without a timed interaction"
238
+ command : RemoveNetwork
239
+ arguments :
240
+ values :
241
+ - name : ExtendedPanID
242
+ value : TestNetworkExtendedPanId
243
+ response :
244
+ error : NEEDS_TIMED_INTERACTION
170
245
171
246
- label :
172
247
" TH sends RemoveNetwork command to DUT with ExtendedPanID of
@@ -212,10 +287,10 @@ tests:
212
287
response :
213
288
constraints :
214
289
type : list
215
- # python: |
216
- # # value == initialNetworks (ignoring order)
217
- # return (len(value) == len(initialNetworks) and
218
- # all(n in initialNetworks for n in value))
290
+ python : |
291
+ # value == initialNetworks (ignoring order)
292
+ return (len(value) == len(initialNetworks) and
293
+ all(n in initialNetworks for n in value))
219
294
220
295
- label :
221
296
" TH writes PreferredExtendedPanID to DUT, restoring the initial value"
0 commit comments