From aa682cec1220ab74e526aaa04e159660f4dd8133 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Fri, 12 Apr 2024 11:29:23 -0700 Subject: [PATCH] Updated OnOff Test script according most recent test plan. (#32306) (#32374) * updated on off test scripts according test plan * added missing CI Pics * updated cluster revision * Restyled by prettier-yaml * update label * Restyled by prettier-yaml * Added missing pics * fix yaml --------- Co-authored-by: beckerzito Co-authored-by: Restyled.io Co-authored-by: Andrei Litvin --- .../all-clusters-app.matter | 4 +- .../all-clusters-common/all-clusters-app.zap | 6 +- src/app/tests/suites/certification/PICS.yaml | 3 + .../suites/certification/Test_TC_OO_1_1.yaml | 90 ++++++++++++++++--- .../suites/certification/Test_TC_OO_2_1.yaml | 52 ++++++++++- .../suites/certification/Test_TC_OO_2_2.yaml | 59 ++++++++---- .../tests/suites/certification/ci-pics-values | 1 + 7 files changed, 183 insertions(+), 32 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 62dc0d7d84c3fa..453769000bfe92 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -7727,7 +7727,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0x0001; - ram attribute clusterRevision default = 5; + ram attribute clusterRevision default = 6; handle command Off; handle command On; @@ -9086,7 +9086,7 @@ endpoint 2 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0x0001; - ram attribute clusterRevision default = 5; + ram attribute clusterRevision default = 6; handle command Off; handle command On; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 0a2a3faf1b37e8..782b20c8f96172 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -6659,7 +6659,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -6895,7 +6895,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -23807,7 +23807,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "5", + "defaultValue": "6", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 49554c37f4e3b6..d23a1db8cdc6cb 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -5294,6 +5294,9 @@ PICS: - label: "Device has Deadfront behaviour" id: OO.S.F01 + - label: "Device has OffOnly feature" + id: OO.S.F02 + # # server / manually # diff --git a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml index 400bf68a776788..5b44953041dac7 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml @@ -38,38 +38,75 @@ tests: command: "readAttribute" attribute: "ClusterRevision" response: - value: 5 + value: 6 constraints: type: int16u - - label: "Step 3a: TH reads from the DUT the FeatureMap attribute." + - label: + "Step 3a: Given OO.S.F00(LT) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: ( !OO.S.F00 && !OO.S.F01 ) + PICS: ( OO.S.F00 && !OO.S.F02 ) response: - value: 0 constraints: type: bitmap32 - + hasMasksSet: [0x1] - label: "Step 3b: Given OO.S.F00(LT) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: OO.S.F00 + PICS: ( !( OO.S.F00 && !OO.S.F02 ) ) response: constraints: type: bitmap32 - hasMasksSet: [0x1] + hasMasksClear: [0x1] - label: "Step 3c: Given OO.S.F01(DF) ensure featuremap has the correct bit set" command: "readAttribute" attribute: "FeatureMap" - PICS: OO.S.F01 + PICS: ( OO.S.F01 && !OO.S.F02 ) response: constraints: type: bitmap32 hasMasksSet: [0x2] + - label: + "Step 3d: Given OO.S.F01(DF) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( !( OO.S.F01 && !OO.S.F02 ) ) + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Step 3e: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap + attribute." + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4] + - label: + "Step 3f: Given OO.S.F02(OFFONLY) TH reads from the DUT the FeatureMap + attribute." + command: "readAttribute" + attribute: "FeatureMap" + PICS: ( !( OO.S.F02 && !OO.S.F00 && !OO.S.F01 ) ) + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + - label: "Step 3g: All remaining shall be zero" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksClear: [0xFFFFFFF8] - label: "Step 4a: TH reads from the DUT the AttributeList attribute." PICS: PICS_EVENT_LIST_ENABLED @@ -115,10 +152,32 @@ tests: response: constraints: type: list - contains: [0, 1, 2] + contains: [0] + + - label: + "Step 6b: TH reads the feature dependent(OO.S.F02) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: ( !OO.S.F02 ) + response: + constraints: + type: list + contains: [1, 2] + + - label: + "Step 6c: TH reads the feature dependent(OO.S.F02) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: OO.S.F02 + response: + constraints: + type: list + excludes: [1, 2] - label: - "Step 6b: TH reads the feature dependent(OO.S.F00) commands in + "Step 6d: TH reads the feature dependent(OO.S.F00) commands in AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" @@ -128,6 +187,17 @@ tests: type: list contains: [64, 65, 66] + - label: + "Step 6e: TH reads the feature dependent(OO.S.F00) commands in + AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: ( !OO.S.F00 ) + response: + constraints: + type: list + excludes: [64, 65, 66] + - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml index 89d84218aef428..bd6feca4901fc3 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_1.yaml @@ -52,22 +52,70 @@ tests: command: "readAttribute" attribute: "OnTime" response: + saveAs: initialOnTime constraints: type: int16u minValue: 0 maxValue: 65535 - - label: "Step 5: TH reads the OffWaitTime attribute from the DUT" + - label: "Step 5: TH writes the OnTime attribute as 30" + PICS: OO.S.A4001 + command: "writeAttribute" + attribute: "OnTime" + arguments: + value: 30 + + - label: "Step 6: TH reads the OnTime attribute from the DUT" + PICS: OO.S.A4001 + command: "readAttribute" + attribute: "OnTime" + response: + value: 30 + + - label: + "Step 7: TH writes the OnTime attribute as 'initial-On-time' to + restore the original value" + PICS: OO.S.A4001 + command: "writeAttribute" + attribute: "OnTime" + arguments: + value: initialOnTime + + - label: "Step 8: TH reads the OffWaitTime attribute from the DUT" PICS: OO.S.A4002 command: "readAttribute" attribute: "OffWaitTime" response: + saveAs: initialOffWaitTime constraints: type: int16u minValue: 0 maxValue: 65535 - - label: "Step 6: TH reads the StartUpOnOff attribute from the DUT" + - label: "Step 9: TH writes the OffWaitTime attribute as 30" + PICS: OO.S.A4002 + command: "writeAttribute" + attribute: "OffWaitTime" + arguments: + value: 30 + + - label: "Step 10: TH reads the OffWaitTime attribute from the DUT" + PICS: OO.S.A4002 + command: "readAttribute" + attribute: "OffWaitTime" + response: + value: 30 + + - label: + "Step 11: TH writes the OffWaitTime attribute as + 'initial-Off-waittime' to restore the original value" + PICS: OO.S.A4002 + command: "writeAttribute" + attribute: "OffWaitTime" + arguments: + value: initialOffWaitTime + + - label: "Step 12: TH reads the StartUpOnOff attribute from the DUT" PICS: OO.S.A4003 command: "readAttribute" attribute: "StartUpOnOff" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml index c477d542e8a7d9..e03bed6691bbd4 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_2.yaml @@ -35,6 +35,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 2b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -46,6 +54,14 @@ tests: PICS: OO.S.C01.Rsp command: "On" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 3b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -57,6 +73,14 @@ tests: PICS: OO.S.C01.Rsp command: "On" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 3d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -68,6 +92,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 4b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -79,6 +111,14 @@ tests: PICS: OO.S.C00.Rsp command: "Off" + - label: "Wait 1000ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 1000 + - label: "Step 4d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" @@ -86,7 +126,7 @@ tests: response: value: 0 - - label: "Step 5c: TH sends Toggle command to DUT" + - label: "Step 5a: TH sends Toggle command to DUT" PICS: OO.S.C02.Rsp command: "Toggle" @@ -98,14 +138,14 @@ tests: - name: "ms" value: 1000 - - label: "Step 5d: after a few seconds, TH reads OnOff attribute from DUT" + - label: "Step 5b: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" attribute: "OnOff" response: value: 1 - - label: "TH sends Toggle command to DUT" + - label: "Step 5c: TH sends Toggle command to DUT" PICS: OO.S.C02.Rsp command: "Toggle" @@ -117,7 +157,7 @@ tests: - name: "ms" value: 1000 - - label: "Check on/off attribute value is false after toggle command" + - label: "Step 5d: after a few seconds, TH reads OnOff attribute from DUT" PICS: OO.S.A0000 command: "readAttribute" attribute: "OnOff" @@ -161,14 +201,3 @@ tests: attribute: "OnOff" response: value: 0 - - - label: "Reset Off Command" - PICS: OO.S.C00.Rsp - command: "Off" - - - label: "Check on/off attribute value is false after off command" - PICS: OO.S.A0000 - command: "readAttribute" - attribute: "OnOff" - response: - value: 0 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index f200ad302931ff..73f363d8f1c6b2 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1211,6 +1211,7 @@ OO.S.C41.Rsp=1 OO.S.C42.Rsp=1 OO.S.F00=1 OO.S.F01=0 +OO.S.F02=0 OO.S.A4003=1 OO.M.ManuallyControlled=1