Skip to content

Commit

Permalink
Add tests in Test_TC_OO_2_4 for OnOff StartupOnOff behaviours (#17012)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
2 people authored and pull[bot] committed Nov 23, 2023
1 parent 30140b0 commit 8295105
Show file tree
Hide file tree
Showing 5 changed files with 829 additions and 198 deletions.
6 changes: 2 additions & 4 deletions examples/chip-tool-darwin/templates/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,8 @@ function getTests()
];

const OnOff = [
'Test_TC_OO_1_1',
'Test_TC_OO_2_1',
'Test_TC_OO_2_2',
'Test_TC_OO_2_3',
'Test_TC_OO_1_1', 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3',
// 'Test_TC_OO_2_4', Disable this Test for now as Darwin does not support reboot commands currently
];

const PowerSource = [
Expand Down
6 changes: 1 addition & 5 deletions examples/chip-tool/templates/tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ function getManualTests()
'Test_TC_OCC_3_1',
];

const OnOff = [
'Test_TC_OO_2_4',
];

const PressureMeasurement = [
'Test_TC_PRS_2_2',
'Test_TC_PRS_2_3',
Expand Down Expand Up @@ -272,7 +268,6 @@ function getManualTests()
WindowCovering, //
FlowMeasurement, //
OccupancySensing, //
OnOff, //
PressureMeasurement, //
PowerSource, //

Expand Down Expand Up @@ -435,6 +430,7 @@ function getTests()
'Test_TC_OO_2_1',
'Test_TC_OO_2_2',
'Test_TC_OO_2_3',
'Test_TC_OO_2_4',
];

const PowerSource = [
Expand Down
257 changes: 149 additions & 108 deletions src/app/tests/suites/certification/Test_TC_OO_2_4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,168 +16,209 @@ name: 3.2.4. [TC-OO-2.4] Startup functionality with server as DUT

config:
nodeId: 0x12344321
cluster: "Basic"
endpoint: 0
cluster: "On/Off"
endpoint: 1
discriminator:
type: INT16U
defaultValue: 3840

tests:
- label: "Commission DUT to TH"
verification: |
disabled: true
- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "TH sends On command to DUT"
verification: |
./chip-tool onoff on 1 1
StatusIB =
{
status = 0x00,
},
disabled: true
command: "On"

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

StatusIB =
{
status = 0x00,
},
disabled: true
- label: "TH reads the StartUpOnOff attribute from the DUT"
command: "readAttribute"
attribute: "StartUpOnOff"
response:
value: 0

- label: "Power off DUT"
verification: |
disabled: true
cluster: "SystemCommands"
endpoint: 0
command: "Reboot"
arguments:
values:
- name: "discriminator"
value: discriminator

- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "Power on DUT"
verification: |
disabled: true

- label: "TH reads the OnOff attribute from the DUT"
verification: |
./chip-tool onoff read on-off 1 1
OnOff: FALSE
disabled: true
command: "readAttribute"
attribute: "OnOff"
response:
value: 0

- label: "TH writes a value of 1 to StartUpOnOff attribute of DUT"
verification: |
./chip-tool onoff write start-up-on-off 1 1 1
StatusIB =
{
status = 0x00,
},
disabled: true
command: "writeAttribute"
attribute: "StartUpOnOff"
arguments:
value: 1

- label: "Power off DUT"
verification: |
disabled: true
cluster: "SystemCommands"
endpoint: 0
command: "Reboot"
arguments:
values:
- name: "discriminator"
value: discriminator

- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "Power on DUT"
verification: |
disabled: true

- label: "TH reads the OnOff attribute from the DUT"
verification: |
./chip-tool onoff read on-off 1 1
OnOff: TRUE
disabled: true
command: "readAttribute"
attribute: "OnOff"
response:
value: 1

- label: "TH writes a value of 2 to StartUpOnOff attribute of DUT"
verification: |
./chip-tool onoff write start-up-on-off 2 1 1
StatusIB =
{
status = 0x00,
},
disabled: true
command: "writeAttribute"
attribute: "StartUpOnOff"
arguments:
value: 2

- label: "Power off DUT"
verification: |
disabled: true
cluster: "SystemCommands"
endpoint: 0
command: "Reboot"
arguments:
values:
- name: "discriminator"
value: discriminator

- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "Power on DUT"
verification: |
disabled: true

- label: "TH reads the OnOff attribute from the DUT"
verification: |
./chip-tool onoff read on-off 1 1
OnOff: FALSE
disabled: true
command: "readAttribute"
attribute: "OnOff"
response:
value: 0

- label: "Power off DUT"
verification: |
disabled: true
cluster: "SystemCommands"
endpoint: 0
command: "Reboot"
arguments:
values:
- name: "discriminator"
value: discriminator

- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "Power on DUT"
verification: |
disabled: true

- label: "TH reads the OnOff attribute from the DUT"
verification: |
./chip-tool onoff read on-off 1 1
OnOff: TRUE
disabled: true
command: "readAttribute"
attribute: "OnOff"
response:
value: 1

- label: "TH writes NULL to StartUpOnOff attribute of DUT"
verification: |
(how to perform this in chip-tool?)
disabled: true
command: "writeAttribute"
attribute: "StartUpOnOff"
arguments:
value: null

- label: "Power off DUT"
verification: |
disabled: true
cluster: "SystemCommands"
endpoint: 0
command: "Reboot"
arguments:
values:
- name: "discriminator"
value: discriminator

- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "Power on DUT"
verification: |
disabled: true

- label: "TH reads the OnOff attribute from the DUT"
verification: |
./chip-tool onoff read on-off 1 1
OnOff: TRUE
disabled: true
command: "readAttribute"
attribute: "OnOff"
response:
value: 1

- label: "TH sends Off command to DUT"
verification: |
./chip-tool onoff off 1 1
StatusIB =
{
status = 0x00,
},
disabled: true
command: "Off"

- label: "Power off DUT"
verification: |
disabled: true
cluster: "SystemCommands"
endpoint: 0
command: "Reboot"
arguments:
values:
- name: "discriminator"
value: discriminator

- label: "Wait for the commissioned device to be retrieved"
cluster: "DelayCommands"
command: "WaitForCommissionee"
arguments:
values:
- name: "nodeId"
value: nodeId

- label: "Power on DUT"
verification: |
disabled: true

- label: "TH reads the OnOff attribute from the DUT"
verification: |
./chip-tool onoff read on-off 1 1
OnOff: FALSE
disabled: true
command: "readAttribute"
attribute: "OnOff"
response:
value: 0
6 changes: 2 additions & 4 deletions src/darwin/Framework/CHIP/templates/tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,8 @@ function getTests()
];

const OnOff = [
'Test_TC_OO_1_1',
'Test_TC_OO_2_1',
'Test_TC_OO_2_2',
'Test_TC_OO_2_3',
'Test_TC_OO_1_1', 'Test_TC_OO_2_1', 'Test_TC_OO_2_2', 'Test_TC_OO_2_3',
// 'Test_TC_OO_2_4', Disable this Test for now as Darwin does not support reboot commands currently
];

const PowerSource = [
Expand Down
Loading

0 comments on commit 8295105

Please sign in to comment.