Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and add additional VALCC test scripts #31243

Merged
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7e4c734
Added VCC-1.1 YAML script
ReneJosefsen Jan 4, 2024
378f9b9
Updated VCC 2.1
ReneJosefsen Jan 5, 2024
fa45b9e
Update VCC 2.1 to match latest spec
ReneJosefsen Jan 5, 2024
912df54
Added VCC 3.1 test script
ReneJosefsen Jan 5, 2024
87c92b5
Added missing step descriptions in 3.1
ReneJosefsen Jan 5, 2024
a6fcbe3
Added 3.2 test script
ReneJosefsen Jan 5, 2024
87990d3
Added 3.3 test script
ReneJosefsen Jan 5, 2024
6bd8381
Fixed check error in 3.3
ReneJosefsen Jan 5, 2024
52379ef
Added 4.1 test script
ReneJosefsen Jan 5, 2024
67b8d1c
Added 4.2 test script
ReneJosefsen Jan 5, 2024
65df017
Added 4.3 test script
ReneJosefsen Jan 5, 2024
40ad5fe
Fixed test case number in description
ReneJosefsen Jan 8, 2024
ab04371
Added 4.4 test script
ReneJosefsen Jan 8, 2024
08100c6
Merge branch 'master' into rjosefsen/update-vcc-test-scripts
ReneJosefsen Jan 8, 2024
d3ced77
Fixed wrong PICS code used fir test names
ReneJosefsen Jan 10, 2024
293f483
Renamed test YAML to use correct PICS code for name
ReneJosefsen Jan 10, 2024
92ad822
Adjusted PICS code for 1.1 YAML script
ReneJosefsen Jan 10, 2024
a4db3cc
Adjusted python scripts to use correct PICS code
ReneJosefsen Jan 10, 2024
d8fe54b
Fixed wrong validation
ReneJosefsen Jan 10, 2024
da38f6e
Removed unused imports
ReneJosefsen Jan 10, 2024
0ae8991
Remove prints
ReneJosefsen Jan 12, 2024
93caa6a
Added 3.4 test script
ReneJosefsen Jan 12, 2024
d6027f4
Remove unused imports
ReneJosefsen Jan 12, 2024
303a6d6
Added LevelStep step to 2.1
ReneJosefsen Jan 12, 2024
6b172c0
Added null handling step to 4.2
ReneJosefsen Jan 12, 2024
5638d88
Adjusted 4.3 to match latest test spec
ReneJosefsen Jan 12, 2024
ec09fe3
Fix wrong openDuration in Open command for 4.4
ReneJosefsen Jan 12, 2024
bb9d3cc
Update src/app/tests/suites/certification/Test_TC_VALCC_1_1.yaml
ReneJosefsen Jan 15, 2024
f859033
Added LevelStep check to 1.1
ReneJosefsen Jan 15, 2024
1f7dd37
Changing test case skipping to loop
ReneJosefsen Jan 15, 2024
a0764af
Minor update to for loop
ReneJosefsen Jan 15, 2024
2efb11c
Updated 4.3 to match latest test spec
ReneJosefsen Jan 15, 2024
1a698cf
Restyle
ReneJosefsen Jan 15, 2024
29ca7f5
Merge branch 'master' into rjosefsen/update-vcc-test-scripts
ReneJosefsen Jan 15, 2024
ee452f8
Merge branch 'master' into rjosefsen/update-vcc-test-scripts
ReneJosefsen Jan 15, 2024
87433cc
Added ci PICS for VALCC
ReneJosefsen Jan 16, 2024
257ce5c
Added missed header
ReneJosefsen Jan 16, 2024
f0b44d5
Added missing feature PICS
ReneJosefsen Jan 16, 2024
e7b8648
Remove manual PICS
ReneJosefsen Jan 16, 2024
e39db2e
Fixed invalid PICS
ReneJosefsen Jan 16, 2024
1dcba7f
Merge branch 'master' into rjosefsen/update-vcc-test-scripts
ReneJosefsen Jan 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 186 additions & 0 deletions src/app/tests/suites/certification/Test_TC_VALCC_1_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# Copyright (c) 2024 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 62.1.1. [TC-VALCC-1.1] Global attributes with server as DUT
ReneJosefsen marked this conversation as resolved.
Show resolved Hide resolved

PICS:
- VALCC.S

config:
nodeId: 0x12344321
cluster: "Valve Configuration and Control"
endpoint: 1

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

- label: "Step 2: Read the global attribute: ClusterRevision"
command: "readAttribute"
attribute: "ClusterRevision"
response:
value: 1
constraints:
type: int16u

- label: "Step 3a: Read the global attribute: FeatureMap"
command: "readAttribute"
attribute: "FeatureMap"
PICS: ( !VALCC.S.F00 && !VALCC.S.F01 )
response:
value: 0
constraints:
type: bitmap32

- label:
"Step 3b: Given VALCC.S.F00(TS) ensure featuremap has the correct bit
set"
command: "readAttribute"
attribute: "FeatureMap"
PICS: VALCC.S.F00
response:
constraints:
type: bitmap32
hasMasksSet: [0x1]

- label:
"Step 3c: Given VALCC.S.F01(LVL) ensure featuremap has the correct bit
set"
command: "readAttribute"
attribute: "FeatureMap"
PICS: VALCC.S.F01
response:
constraints:
type: bitmap32
hasMasksSet: [0x2]

- label: "Step 4a: Read the global attribute: AttributeList"
PICS: PICS_EVENT_LIST_ENABLED
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [0, 1, 3, 4, 65528, 65529, 65530, 65531, 65532, 65533]

- label: "Step 4a: Read the global attribute: AttributeList"
PICS: "!PICS_EVENT_LIST_ENABLED"
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [0, 1, 3, 4, 65528, 65529, 65531, 65532, 65533]

- label:
"Step 4b: Read the feature dependent(VALCC.S.F00) attribute in
AttributeList"
PICS: VALCC.S.F00
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [2]

- label:
"Step 4c: Read the feature dependent(VALCC.S.F01) attribute in
AttributeList"
PICS: VALCC.S.F01
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [6, 7]

- label:
"Step 4d: Read the feature dependent(VALCC.S.F01) optional attribute
in AttributeList"
PICS: VALCC.S.F01 && VALCC.S.A0008
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [8]

- label:
"Step 4e: Read the feature dependent(VALCC.S.F01) optional attribute
in AttributeList"
PICS: VALCC.S.F01 && VALCC.S.A000a
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [10]

- label:
"Step 4f: TH reads optional (ValveFault) attribute in AttributeList"
PICS: VALCC.S.A0009
command: "readAttribute"
attribute: "AttributeList"
response:
constraints:
type: list
contains: [9]

- label: "Step 5a: Read the global attribute: EventList"
PICS: PICS_EVENT_LIST_ENABLED && !VALCC.S.E00 && !VALCC.S.E01
command: "readAttribute"
attribute: "EventList"
response:
value: []
constraints:
type: list

- label: "Step 5b: Read the optional (ValveStateChanged) event in EventList"
PICS: PICS_EVENT_LIST_ENABLED && VALCC.S.E00
command: "readAttribute"
attribute: "EventList"
response:
constraints:
type: list
contains: [0]

- label: "Step 5c: Read the optional (ValveFault) event in EventList"
PICS: PICS_EVENT_LIST_ENABLED && VALCC.S.E01
command: "readAttribute"
attribute: "EventList"
response:
constraints:
type: list
contains: [1]

- label: "Step 6: Read the global attribute: AcceptedCommandList"
command: "readAttribute"
attribute: "AcceptedCommandList"
response:
constraints:
type: list
contains: [0, 1]

- label: "Step 7: Read the global attribute: GeneratedCommandList"
command: "readAttribute"
attribute: "GeneratedCommandList"
response:
value: []
constraints:
type: list
177 changes: 177 additions & 0 deletions src/python_testing/TC_VALCC_2_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
#
# Copyright (c) 2023 Project CHIP Authors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import logging

import chip.clusters as Clusters
from chip.clusters.Types import NullValue
from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
from mobly import asserts


class TC_VALCC_2_1(MatterBaseTest):
async def read_valcc_attribute_expect_success(self, endpoint, attribute):
cluster = Clusters.Objects.ValveConfigurationAndControl
return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute)

def desc_TC_VALCC_2_1(self) -> str:
return "[TC-VALCC-2.1] Attributes with DUT as Server"

def steps_TC_VALCC_2_1(self) -> list[TestStep]:
steps = [
TestStep(1, "Commissioning, already done", is_commissioning=True),
TestStep(2, "Read attribute list to determine supported attributes"),
TestStep(3, "Read OpenDuration attribute, if supported"),
TestStep(4, "Read DefaultOpenDuration attribute, if supported"),
TestStep(5, "Read AutoCloseTime attribute, if supported"),
TestStep(6, "Read RemainingDuration attribute, if supported"),
TestStep(7, "Read CurrentState attribute, if supported"),
TestStep(8, "Read TargetState attribute, if supported"),
TestStep(9, "Read CurrentLevel attribute, if supported"),
TestStep(10, "Read TargetLevel attribute, if supported"),
TestStep(11, "Read DefaultOpenLevel attribute, if supported"),
TestStep(12, "Read ValveFault attribute, if supported"),
TestStep(13, "Read LevelStep attribute, if supported")
]
return steps

def pics_TC_VALCC_2_1(self) -> list[str]:
pics = [
"VALCC.S",
]
return pics

@async_test_body
async def test_TC_VALCC_2_1(self):

endpoint = self.user_params.get("endpoint", 1)

self.step(1)
attributes = Clusters.ValveConfigurationAndControl.Attributes

self.step(2)
attribute_list = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList)

self.step(3)
if attributes.OpenDuration.attribute_id in attribute_list:
open_duration_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.OpenDuration)

if open_duration_dut is not NullValue:
asserts.assert_less_equal(open_duration_dut, 0xFFFFFFFE, "OpenDuration attribute is out of range")
asserts.assert_greater_equal(open_duration_dut, 1, "OpenDuration attribute is out of range")
else:
logging.info("Test step skipped")

self.step(4)
if attributes.DefaultOpenDuration.attribute_id in attribute_list:
default_open_duration_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration)

if default_open_duration_dut is not NullValue:
asserts.assert_less_equal(default_open_duration_dut, 0xFFFFFFFE, "DefaultOpenDuration attribute is out of range")
asserts.assert_greater_equal(default_open_duration_dut, 1, "DefaultOpenDuration attribute is out of range")
else:
logging.info("Test step skipped")

self.step(5)
if attributes.AutoCloseTime.attribute_id in attribute_list:
auto_close_time_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.AutoCloseTime)

if auto_close_time_dut is not NullValue:
asserts.assert_less_equal(auto_close_time_dut, 0xFFFFFFFFFFFFFFFE, "OpenDuration attribute is out of range")
else:
logging.info("Test step skipped")

self.step(6)
if attributes.RemainingDuration.attribute_id in attribute_list:
remaining_duration_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.RemainingDuration)

if remaining_duration_dut is not NullValue:
asserts.assert_less_equal(remaining_duration_dut, 0xFFFFFFFE, "RemainingDuration attribute is out of range")
asserts.assert_greater_equal(remaining_duration_dut, 1, "RemainingDuration attribute is out of range")
else:
logging.info("Test step skipped")

self.step(7)
if attributes.CurrentState.attribute_id in attribute_list:
current_state_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.CurrentState)

if current_state_dut is not NullValue:
asserts.assert_less(current_state_dut, Clusters.Objects.ValveConfigurationAndControl.Enums.ValveStateEnum.kUnknownEnumValue,
"CurrentState is not in valid range")
else:
logging.info("Test step skipped")

self.step(8)
if attributes.TargetState.attribute_id in attribute_list:
target_state_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.TargetState)

if target_state_dut is not NullValue:
asserts.assert_less(target_state_dut, Clusters.Objects.ValveConfigurationAndControl.Enums.ValveStateEnum.kUnknownEnumValue,
"TargetState is not in valid range")
else:
logging.info("Test step skipped")

self.step(9)
if attributes.CurrentLevel.attribute_id in attribute_list:
current_level_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.CurrentLevel)

if current_level_dut is not NullValue:
asserts.assert_less_equal(current_level_dut, 100, "CurrentLevel attribute is out of range")
asserts.assert_greater_equal(current_level_dut, 0, "CurrentLevel attribute is out of range")
else:
logging.info("Test step skipped")

self.step(10)
if attributes.TargetLevel.attribute_id in attribute_list:
target_level_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.TargetLevel)

if target_level_dut is not NullValue:
asserts.assert_less_equal(target_level_dut, 100, "TargetLevel attribute is out of range")
asserts.assert_greater_equal(target_level_dut, 0, "TargetLevel attribute is out of range")
else:
logging.info("Test step skipped")

self.step(11)
if attributes.DefaultOpenLevel.attribute_id in attribute_list:
default_open_level_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenLevel)

if default_open_level_dut is not NullValue:
asserts.assert_less_equal(default_open_level_dut, 100, "DefaultOpenLevel attribute is out of range")
asserts.assert_greater_equal(default_open_level_dut, 1, "DefaultOpenLevel attribute is out of range")
else:
logging.info("Test step skipped")

self.step(12)
if attributes.ValveFault.attribute_id in attribute_list:
valve_fault_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.ValveFault)

asserts.assert_less_equal(valve_fault_dut, 0b00000111, "ValveFault is not in valid range")
else:
logging.info("Test step skipped")

self.step(13)
if attributes.LevelStep.attribute_id in attribute_list:
level_step_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.LevelStep)

asserts.assert_less_equal(level_step_dut, 50, "LevelStep attribute is out of range")
asserts.assert_greater_equal(level_step_dut, 1, "LevelStep attribute is out of range")
else:
logging.info("Test step skipped")


if __name__ == "__main__":
default_matter_test_main()
Loading
Loading