Skip to content

Commit 1181776

Browse files
jmartinez-silabsrestyled-commits
authored andcommitted
Add tests in Test_TC_OO_2_4 for OnOff StartupOnOff behaviours (#17012)
* Implement test case oo 2_4. test startup on off with reboot * Wait for commissionned device discovery after reboot + save StartUpOnOff attribute in nvm for all-cluster-app * Restyled by whitespace * Restyled by clang-format * disable Test for Darwin as it does not support reboot command currently Co-authored-by: Restyled.io <[email protected]>
1 parent 64ba8ab commit 1181776

File tree

5 files changed

+829
-198
lines changed

5 files changed

+829
-198
lines changed

examples/chip-tool-darwin/templates/tests.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,8 @@ function getTests()
174174
];
175175

176176
const OnOff = [
177-
'Test_TC_OO_1_1',
178-
'Test_TC_OO_2_1',
179-
'Test_TC_OO_2_2',
180-
'Test_TC_OO_2_3',
177+
'Test_TC_OO_1_1', 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3',
178+
// 'Test_TC_OO_2_4', Disable this Test for now as Darwin does not support reboot commands currently
181179
];
182180

183181
const PowerSource = [

examples/chip-tool/templates/tests/tests.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,6 @@ function getManualTests()
233233
'Test_TC_OCC_3_1',
234234
];
235235

236-
const OnOff = [
237-
'Test_TC_OO_2_4',
238-
];
239-
240236
const PressureMeasurement = [
241237
'Test_TC_PRS_2_2',
242238
'Test_TC_PRS_2_3',
@@ -272,7 +268,6 @@ function getManualTests()
272268
WindowCovering, //
273269
FlowMeasurement, //
274270
OccupancySensing, //
275-
OnOff, //
276271
PressureMeasurement, //
277272
PowerSource, //
278273

@@ -435,6 +430,7 @@ function getTests()
435430
'Test_TC_OO_2_1',
436431
'Test_TC_OO_2_2',
437432
'Test_TC_OO_2_3',
433+
'Test_TC_OO_2_4',
438434
];
439435

440436
const PowerSource = [

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

+149-108
Original file line numberDiff line numberDiff line change
@@ -16,168 +16,209 @@ name: 3.2.4. [TC-OO-2.4] Startup functionality with server as DUT
1616

1717
config:
1818
nodeId: 0x12344321
19-
cluster: "Basic"
20-
endpoint: 0
19+
cluster: "On/Off"
20+
endpoint: 1
21+
discriminator:
22+
type: INT16U
23+
defaultValue: 3840
2124

2225
tests:
23-
- label: "Commission DUT to TH"
24-
verification: |
25-
26-
disabled: true
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
2733

2834
- label: "TH sends On command to DUT"
29-
verification: |
30-
./chip-tool onoff on 1 1
31-
32-
StatusIB =
33-
{
34-
status = 0x00,
35-
},
36-
disabled: true
35+
command: "On"
3736

3837
- label: "TH writes a value of 0 to StartUpOnOff attribute of DUT"
39-
verification: |
40-
./chip-tool onoff write start-up-on-off 0 1 1
38+
command: "writeAttribute"
39+
attribute: "StartUpOnOff"
40+
arguments:
41+
value: 0
4142

42-
StatusIB =
43-
{
44-
status = 0x00,
45-
},
46-
disabled: true
43+
- label: "TH reads the StartUpOnOff attribute from the DUT"
44+
command: "readAttribute"
45+
attribute: "StartUpOnOff"
46+
response:
47+
value: 0
4748

4849
- label: "Power off DUT"
49-
verification: |
50-
51-
disabled: true
50+
cluster: "SystemCommands"
51+
endpoint: 0
52+
command: "Reboot"
53+
arguments:
54+
values:
55+
- name: "discriminator"
56+
value: discriminator
57+
58+
- label: "Wait for the commissioned device to be retrieved"
59+
cluster: "DelayCommands"
60+
command: "WaitForCommissionee"
61+
arguments:
62+
values:
63+
- name: "nodeId"
64+
value: nodeId
5265

5366
- label: "Power on DUT"
54-
verification: |
55-
5667
disabled: true
5768

5869
- label: "TH reads the OnOff attribute from the DUT"
59-
verification: |
60-
./chip-tool onoff read on-off 1 1
61-
62-
OnOff: FALSE
63-
disabled: true
70+
command: "readAttribute"
71+
attribute: "OnOff"
72+
response:
73+
value: 0
6474

6575
- label: "TH writes a value of 1 to StartUpOnOff attribute of DUT"
66-
verification: |
67-
./chip-tool onoff write start-up-on-off 1 1 1
68-
69-
StatusIB =
70-
{
71-
status = 0x00,
72-
},
73-
disabled: true
76+
command: "writeAttribute"
77+
attribute: "StartUpOnOff"
78+
arguments:
79+
value: 1
7480

7581
- label: "Power off DUT"
76-
verification: |
77-
78-
disabled: true
82+
cluster: "SystemCommands"
83+
endpoint: 0
84+
command: "Reboot"
85+
arguments:
86+
values:
87+
- name: "discriminator"
88+
value: discriminator
89+
90+
- label: "Wait for the commissioned device to be retrieved"
91+
cluster: "DelayCommands"
92+
command: "WaitForCommissionee"
93+
arguments:
94+
values:
95+
- name: "nodeId"
96+
value: nodeId
7997

8098
- label: "Power on DUT"
81-
verification: |
82-
8399
disabled: true
84100

85101
- label: "TH reads the OnOff attribute from the DUT"
86-
verification: |
87-
./chip-tool onoff read on-off 1 1
88-
89-
OnOff: TRUE
90-
disabled: true
102+
command: "readAttribute"
103+
attribute: "OnOff"
104+
response:
105+
value: 1
91106

92107
- label: "TH writes a value of 2 to StartUpOnOff attribute of DUT"
93-
verification: |
94-
./chip-tool onoff write start-up-on-off 2 1 1
95-
96-
StatusIB =
97-
{
98-
status = 0x00,
99-
},
100-
disabled: true
108+
command: "writeAttribute"
109+
attribute: "StartUpOnOff"
110+
arguments:
111+
value: 2
101112

102113
- label: "Power off DUT"
103-
verification: |
104-
105-
disabled: true
114+
cluster: "SystemCommands"
115+
endpoint: 0
116+
command: "Reboot"
117+
arguments:
118+
values:
119+
- name: "discriminator"
120+
value: discriminator
121+
122+
- label: "Wait for the commissioned device to be retrieved"
123+
cluster: "DelayCommands"
124+
command: "WaitForCommissionee"
125+
arguments:
126+
values:
127+
- name: "nodeId"
128+
value: nodeId
106129

107130
- label: "Power on DUT"
108-
verification: |
109-
110131
disabled: true
111132

112133
- label: "TH reads the OnOff attribute from the DUT"
113-
verification: |
114-
./chip-tool onoff read on-off 1 1
115-
116-
OnOff: FALSE
117-
disabled: true
134+
command: "readAttribute"
135+
attribute: "OnOff"
136+
response:
137+
value: 0
118138

119139
- label: "Power off DUT"
120-
verification: |
121-
122-
disabled: true
140+
cluster: "SystemCommands"
141+
endpoint: 0
142+
command: "Reboot"
143+
arguments:
144+
values:
145+
- name: "discriminator"
146+
value: discriminator
147+
148+
- label: "Wait for the commissioned device to be retrieved"
149+
cluster: "DelayCommands"
150+
command: "WaitForCommissionee"
151+
arguments:
152+
values:
153+
- name: "nodeId"
154+
value: nodeId
123155

124156
- label: "Power on DUT"
125-
verification: |
126-
127157
disabled: true
128158

129159
- label: "TH reads the OnOff attribute from the DUT"
130-
verification: |
131-
./chip-tool onoff read on-off 1 1
132-
133-
OnOff: TRUE
134-
disabled: true
160+
command: "readAttribute"
161+
attribute: "OnOff"
162+
response:
163+
value: 1
135164

136165
- label: "TH writes NULL to StartUpOnOff attribute of DUT"
137-
verification: |
138-
(how to perform this in chip-tool?)
139-
disabled: true
166+
command: "writeAttribute"
167+
attribute: "StartUpOnOff"
168+
arguments:
169+
value: null
140170

141171
- label: "Power off DUT"
142-
verification: |
143-
144-
disabled: true
172+
cluster: "SystemCommands"
173+
endpoint: 0
174+
command: "Reboot"
175+
arguments:
176+
values:
177+
- name: "discriminator"
178+
value: discriminator
179+
180+
- label: "Wait for the commissioned device to be retrieved"
181+
cluster: "DelayCommands"
182+
command: "WaitForCommissionee"
183+
arguments:
184+
values:
185+
- name: "nodeId"
186+
value: nodeId
145187

146188
- label: "Power on DUT"
147-
verification: |
148-
149189
disabled: true
150190

151191
- label: "TH reads the OnOff attribute from the DUT"
152-
verification: |
153-
./chip-tool onoff read on-off 1 1
154-
155-
OnOff: TRUE
156-
disabled: true
192+
command: "readAttribute"
193+
attribute: "OnOff"
194+
response:
195+
value: 1
157196

158197
- label: "TH sends Off command to DUT"
159-
verification: |
160-
./chip-tool onoff off 1 1
161-
162-
StatusIB =
163-
{
164-
status = 0x00,
165-
},
166-
disabled: true
198+
command: "Off"
167199

168200
- label: "Power off DUT"
169-
verification: |
170-
171-
disabled: true
201+
cluster: "SystemCommands"
202+
endpoint: 0
203+
command: "Reboot"
204+
arguments:
205+
values:
206+
- name: "discriminator"
207+
value: discriminator
208+
209+
- label: "Wait for the commissioned device to be retrieved"
210+
cluster: "DelayCommands"
211+
command: "WaitForCommissionee"
212+
arguments:
213+
values:
214+
- name: "nodeId"
215+
value: nodeId
172216

173217
- label: "Power on DUT"
174-
verification: |
175-
176218
disabled: true
177219

178220
- label: "TH reads the OnOff attribute from the DUT"
179-
verification: |
180-
./chip-tool onoff read on-off 1 1
181-
182-
OnOff: FALSE
183-
disabled: true
221+
command: "readAttribute"
222+
attribute: "OnOff"
223+
response:
224+
value: 0

src/darwin/Framework/CHIP/templates/tests/tests.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,8 @@ function getTests()
174174
];
175175

176176
const OnOff = [
177-
'Test_TC_OO_1_1',
178-
'Test_TC_OO_2_1',
179-
'Test_TC_OO_2_2',
180-
'Test_TC_OO_2_3',
177+
'Test_TC_OO_1_1', 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3',
178+
// 'Test_TC_OO_2_4', Disable this Test for now as Darwin does not support reboot commands currently
181179
];
182180

183181
const PowerSource = [

0 commit comments

Comments
 (0)