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

Updated TestSteps to add expectation strings and match the descriptions in the current test plan. #33667

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
146 changes: 88 additions & 58 deletions src/python_testing/TC_ACE_1_3.py

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/python_testing/TC_ACL_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ def desc_TC_ACL_2_2(self) -> str:

def steps_TC_ACL_2_2(self) -> list[TestStep]:
steps = [
TestStep(1, "Commissioning, already done", is_commissioning=True),
TestStep(2, "TH1 reads DUT Descriptor cluster ServerList attribute from Endpoint 0"),
TestStep(3, "TH1 reads DUT Descriptor cluster ServerList attribute from every Endpoint except 0"),
TestStep(1, "TH1 commissions DUT using admin node ID `N1`", "DUT is commissioned on TH1 fabric", is_commissioning=True),
TestStep(2, "TH1 reads DUT Descriptor cluster ServerList attribute from Endpoint 0",
"Result list contains an element with value 31 (0x001F)"),
TestStep(3, "TH1 reads DUT Descriptor cluster ServerList attribute from every Endpoint except 0",
"Result list does not contain an element with value 31 (0x001F)"),
]
return steps

Expand Down
21 changes: 11 additions & 10 deletions src/python_testing/TC_BOOLCFG_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import chip.clusters as Clusters
from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
from mobly import asserts
from test_plan_support import (th_read_attribute, dut_reply_attribute, if_attr_supported, dut_reply_value, com_dut_th, store_value_as)


class TC_BOOLCFG_2_1(MatterBaseTest):
Expand All @@ -34,16 +35,16 @@ def desc_TC_BOOLCFG_2_1(self) -> str:

def steps_TC_BOOLCFG_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 SupportedSensitivityLevels attribute, if supported"),
TestStep(4, "Read CurrentSensitivityLevel attribute, if supported"),
TestStep(5, "Read DefaultSensitivityLevel attribute, if supported"),
TestStep(6, "Read AlarmsActive attribute, if supported"),
TestStep(7, "Read AlarmsSuppressed attribute, if supported"),
TestStep(8, "Read AlarmsEnabled attribute, if supported"),
TestStep(9, "Read AlarmsSupported attribute, if supported"),
TestStep(10, "Read SensorFault attribute, if supported"),
TestStep(1, f"{com_dut_th}.", "", is_commissioning=True),
TestStep(2, f"{th_read_attribute('AttributeList')}", f"{dut_reply_attribute('AttributeList')}."),
TestStep(3, f"{if_attr_supported}, {th_read_attribute('SupportedSensitivityLevels')}. {store_value_as} numberOfSupportedLevels.", f"{dut_reply_value('uint8', 2, 10)}."),
TestStep(4, f"{if_attr_supported}, {th_read_attribute('CurrentSensitivityLevel')}.", f"{dut_reply_value('uint8', 0, 'the value of numberOfSupportedLevels')}."),
TestStep(5, f"{if_attr_supported}, {th_read_attribute('DefaultSensitivityLevel')}.", f"{dut_reply_value('uint8', 0, 'the value of numberOfSupportedLevels')}."),
TestStep(6, f"{if_attr_supported}, {th_read_attribute('AlarmsActive')}.", f"{dut_reply_value('map8', 0, 3)}."),
TestStep(7, f"{if_attr_supported}, {th_read_attribute('AlarmsSuppressed')}.", f"{dut_reply_value('map8', 0, 3)}."),
TestStep(8, f"{if_attr_supported}, {th_read_attribute('AlarmsEnabled')}.", f"{dut_reply_value('map8', 0, 3)}."),
TestStep(9, f"{if_attr_supported}, {th_read_attribute('AlarmsSupported')}.", f"{dut_reply_value('map8', 0, 3)}."),
TestStep(10, f"{if_attr_supported}, {th_read_attribute('SensorFault')}.", f"{dut_reply_value('map8', 0, 1)}."),
]
return steps

Expand Down
28 changes: 15 additions & 13 deletions src/python_testing/TC_BOOLCFG_3_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,21 @@ def desc_TC_BOOLCFG_3_1(self) -> str:

def steps_TC_BOOLCFG_3_1(self) -> list[TestStep]:
steps = [
TestStep(1, "Commissioning, already done", is_commissioning=True),
TestStep("2a", "Read FeatureMap attribute"),
TestStep("2b", "Verify SENS feature is supported"),
TestStep("2c", "Read AttributeList attribute"),
TestStep(3, "Read SupportedSensitivityLevels attribute"),
TestStep(4, "Read DefaultSensitivityLevel attribute, if supported"),
TestStep(5, "Read CurrentSensitivityLevel attribute"),
TestStep(6, "TH loops through the number of supported sensitivity levels"),
TestStep(7, "Write CurrentSensitivityLevel attribute to non-default value"),
TestStep(8, "Write CurrentSensitivityLevel attribute to default value"),
TestStep(9, "Write CurrentSensitivityLevel attribute to 10"),
TestStep(10, "Write CurrentSensitivityLevel attribute to 255"),
TestStep(11, "Write CurrentSensitivityLevel attribute to the initial current value"),
TestStep(1, "{comDutTH}.", "", is_commissioning=True),
TestStep("2a", "{THread} _Featuremap_ attribute.", "{DUTreply} the _Featuremap_ attribute."),
TestStep("2b", "If the _{F_SENSLVL}_ {featIsNotSupported}, skip remaining steps and end test case.", ""),
TestStep("2c", "{THread} _AttributeList_ attribute.", "{DUTreply} the _AttributeList_ attribute."),
TestStep(3, "{THread} _{A_SUPPORTEDSENSITIVITYLEVELS}_ attribute. {storeValueAs} numberOfSupportedLevels.", "{resDutSuccess}."),
TestStep(4, "{ifAttrIsSupported}, {THread} _{A_DEFAULTSENSITIVITYLEVEL}_ attribute. {storeValueAs} defaultLevel.", "{resDutSuccess}."),
TestStep(5, "{THread} _{A_CURRENTSENSITIVITYLEVEL}_ attribute. {storeValueAs} currentLevel.", "{resDutSuccess}."),
TestStep(
6, "TH loops through the number of supported sensitivity levels (0 to numberOfSupportedLevels - 1) and\n {THwrite} each value to the _{A_CURRENTSENSITIVITYLEVEL}_ attribute.", "{resDutSuccess} for all write interactions."),
TestStep(7, "If the _{A_DEFAULTSENSITIVITYLEVEL}_ {attrIsSupported}, {THwrite} _{A_CURRENTSENSITIVITYLEVEL}_ attribute to a supported value that is NOT the value of defaultLevel.", "{resDutSuccess}."),
TestStep(
8, "If the _{A_DEFAULTSENSITIVITYLEVEL}_ {attrIsSupported}, {THwrite} _{A_CURRENTSENSITIVITYLEVEL}_ attribute to the value of defaultLevel.", "{resDutSuccess}."),
TestStep(9, "{THwrite} _{A_CURRENTSENSITIVITYLEVEL}_ attribute to numberOfSupportedLevels.", "{resDutConstraintError}."),
TestStep(10, "{THwrite} _{A_CURRENTSENSITIVITYLEVEL}_ attribute to 255.", "{resDutConstraintError}."),
TestStep(11, "{THwrite} _{A_CURRENTSENSITIVITYLEVEL}_ attribute to the value of currentLevel.", "{resDutSuccess}."),
]
return steps

Expand Down
15 changes: 8 additions & 7 deletions src/python_testing/TC_BOOLCFG_4_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ def desc_TC_BOOLCFG_4_1(self) -> str:

def steps_TC_BOOLCFG_4_1(self) -> list[TestStep]:
steps = [
TestStep(1, "Commissioning, already done", is_commissioning=True),
TestStep(2, "Read FeatureMap attribute"),
TestStep(3, "Read AlarmsSupported attribute"),
TestStep("4a", "Verify AlarmsSupported attribute bit 0"),
TestStep("4b", "Verify AlarmsSupported attribute bit 0"),
TestStep("5a", "Verify AlarmsSupported attribute bit 1"),
TestStep("5b", "Verify AlarmsSupported attribute bit 1"),
TestStep(1, "{comDutTH}.", "", is_commissioning=True),
TestStep(2, "{THread} _Featuremap_ attribute.", "{DUTreply} the _Featuremap_ attribute."),
TestStep(3, "If the _{F_VIS}_ or _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSSUPPORTED}_ attribute. {storeValueAs} supportedAlarms.",
"{resDutSuccess} and that the received value is not 0."),
TestStep("4a", "If the _{F_VIS}_ {featIsSupported}.", "Verify that bit 0 in supportedAlarms is set to 1."),
TestStep("4b", "If the _{F_VIS}_ {featIsNotSupported}.", "Verify that bit 0 in supportedAlarms is set to 0."),
TestStep("5a", "If the _{F_AUD}_ {featIsSupported}.", "Verify that bit 1 in supportedAlarms is set to 1."),
TestStep("5b", "If the _{F_AUD}_ {featIsNotSupported}.", "Verify that bit 1 in supportedAlarms is set to 0."),
]
return steps

Expand Down
37 changes: 22 additions & 15 deletions src/python_testing/TC_BOOLCFG_4_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,28 @@ def desc_TC_BOOLCFG_4_2(self) -> str:

def steps_TC_BOOLCFG_4_2(self) -> list[TestStep]:
steps = [
TestStep(1, "Commissioning, already done", is_commissioning=True),
TestStep("2a", "Read FeatureMap attribute"),
TestStep("2b", "Read AttributeList attribute"),
TestStep("3a", "Create variable named enabledAlarms"),
TestStep("3b", "If VIS is supported, set bit 0 to 1"),
TestStep("3c", "If AUD is supported, set bit 1 to 1"),
TestStep("3d", "Set AlarmsEnabled attribute to value of enabledAlarms using EnableDisableAlarm command"),
TestStep(4, "Send TestEventTrigger with SensorTrigger event"),
TestStep(5, "Read AlarmsActive attribute"),
TestStep("6a", "Verify VIS alarm is active, if supported"),
TestStep("6b", "Verify VIS alarm is not active, if not supported"),
TestStep("7a", "Verify AUD alarm is active, if supported"),
TestStep("7b", "Verify AUD alarm is not active, if not supported"),
TestStep(8, "Send TestEventTrigger with SensorUntrigger event"),
TestStep(9, "Read AlarmsActive attribute"),
TestStep(1, "{comDutTH}.", "", is_commissioning=True),
TestStep("2a", "{THread} _Featuremap_ attribute.", "{DUTreply} the _Featuremap_ attribute."),
TestStep("2b", "{THread} _AttributeList_ attribute.", "{DUTreply} the _AttributeList_ attribute."),
# Enable all supported alarms (if supported)
TestStep("3a", "If the _{A_ALARMSENABLED}_ {attrIsSupported}, create variable named enabledAlarms", ""),
TestStep(
"3b", "If the _{A_ALARMSENABLED}_ {attrIsSupported} and _{F_VIS}_ {featIsSupported}, set bit 0 in enabledAlarms to 1.", ""),
TestStep(
"3c", "If the _{A_ALARMSENABLED}_ {attrIsSupported} and _{F_AUD}_ {featIsSupported}, set bit 1 in enabledAlarms to 1.", ""),
TestStep("3d", "{ifAttrIsSupported}, {THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."),
# Check that the supported alarms are active
TestStep(4, "If the _{F_VIS}_ or _{F_AUD}_ {featIsSupported}, TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0\n with EnableKey field set to PIXIT.{PICS_S}.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.{PICS_S}.TEST_EVENT_TRIGGER for SensorTrigger event.", "{resDutSuccess}."),
TestStep(5, "If the _{F_VIS}_ or _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute. {storeValueAs} activeAlarms.",
"{resDutSuccess} and that the received value is not 0."),
TestStep("6a", "If the _{F_VIS}_ {featIsSupported}.", "Verify that bit 0 in activeAlarms is set to 1."),
TestStep("6b", "If the _{F_VIS}_ {featIsNotSupported}.", "Verify that bit 0 in activeAlarms is set to 0."),
TestStep("7a", "If the _{F_AUD}_ {featIsSupported}.", "Verify that bit 1 in activeAlarms is set to 1."),
TestStep("7b", "If the _{F_AUD}_ {featIsNotSupported}.", "Verify that bit 1 in activeAlarms is set to 0."),
# Check that the supported alarms are no longer active
TestStep(8, "If the _{F_VIS}_ or _{F_AUD}_ {featIsSupported}, TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0\n with EnableKey field set to PIXIT.{PICS_S}.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.{PICS_S}.TEST_EVENT_TRIGGER for SensorUntrigger event.", "{resDutSuccess}."),
TestStep(9, "If the _{F_VIS}_ or _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.",
"{resDutSuccess} and that the received value is 0."),
]
return steps

Expand Down
Loading
Loading