diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index ec34b50bf1a9e5..db2ff1c844d833 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -51,64 +51,94 @@ def desc_TC_ACE_1_3(self) -> str: def steps_TC_ACE_1_3(self) -> list[TestStep]: steps = [ - TestStep(1, "Commissioning, already done", is_commissioning=True), - TestStep(2, "TH0 writes ACL all view on PIXIT.ACE.TESTENDPOINT"), - TestStep(3, "TH1 reads EP0 descriptor - expect SUCCESS"), - TestStep(4, "TH2 reads EP0 descriptor - expect SUCCESS"), - TestStep(5, "TH3 reads EP0 descriptor - expect SUCCESS"), - TestStep(6, "TH0 writes ACL TH1 view on EP0"), - TestStep(7, "TH1 reads EP0 descriptor - expect SUCCESS"), - TestStep(8, "TH2 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(9, "TH3 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(10, "TH0 writes ACL TH2 view on EP0"), - TestStep(11, "TH1 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(12, "TH2 reads EP0 descriptor - expect SUCCESS"), - TestStep(13, "TH3 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(14, "TH0 writes ACL TH3 view on EP0"), - TestStep(15, "TH1 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(16, "TH2 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(17, "TH3 reads EP0 descriptor - expect SUCCESS"), - TestStep(18, "TH0 writes ACL TH1 TH2 view on EP0"), - TestStep(19, "TH1 reads EP0 descriptor - expect SUCCESS"), - TestStep(20, "TH2 reads EP0 descriptor - expect SUCCESS"), - TestStep(21, "TH3 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(22, "TH0 writes ACL TH1 TH3 view on EP0"), - TestStep(23, "TH1 reads EP0 descriptor - expect SUCCESS"), - TestStep(24, "TH2 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(25, "TH3 reads EP0 descriptor - expect SUCCESS"), - TestStep(26, "TH0 writes ACL TH2 TH3 view on EP0"), - TestStep(27, "TH1 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(28, "TH2 reads EP0 descriptor - expect SUCCESS"), - TestStep(29, "TH3 reads EP0 descriptor - expect SUCCESS"), - TestStep(30, "TH0 writes ACL TH1 TH2 TH3 view on EP0"), - TestStep(31, "TH1 reads EP0 descriptor - expect SUCCESS"), - TestStep(32, "TH2 reads EP0 descriptor - expect SUCCESS"), - TestStep(33, "TH3 reads EP0 descriptor - expect SUCCESS"), - TestStep(34, "TH0 writes ACL cat1v1 view on EP0"), - TestStep(35, "TH1 reads EP0 descriptor - expect SUCCESS"), - TestStep(36, "TH2 reads EP0 descriptor - expect SUCCESS"), - TestStep(37, "TH3 reads EP0 descriptor - expect SUCCESS"), - TestStep(38, "TH0 writes ACL cat1v2 view on EP0"), - TestStep(39, "TH1 reads EP0 descriptor - expect SUCCESS"), - TestStep(40, "TH2 reads EP0 descriptor - expect SUCCESS"), - TestStep(41, "TH3 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(42, "TH0 writes ACL cat1v3 view on EP0"), - TestStep(43, "TH1 reads EP0 descriptor - expect SUCCESS"), - TestStep(44, "TH2 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(45, "TH3 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(46, "TH0 writes ACL cat2v1 view on EP0"), - TestStep(47, "TH1 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(48, "TH2 reads EP0 descriptor - expect SUCCESS"), - TestStep(49, "TH3 reads EP0 descriptor - expect SUCCESS"), - TestStep(50, "TH0 writes ACL cat2v2 view on EP0"), - TestStep(51, "TH1 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(52, "TH2 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(53, "TH3 reads EP0 descriptor - expect SUCCESS"), - TestStep(54, "TH0 writes ACL cat2v3 view on EP0"), - TestStep(55, "TH1 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(56, "TH2 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(57, "TH3 reads EP0 descriptor - expect UNSUPPORTED_ACCESS"), - TestStep(58, "TH0 writes ACL back to default") + TestStep(1, "Precondition: TH0 commissions DUT using admin node ID `N0`", + "DUT is commissioned on TH0 fabric", is_commissioning=True), + # Subjects: wildcard + TestStep( + 2, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: null\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(3, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(4, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(5, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + # Subjects: N1 + TestStep( + 6, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`N1`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(7, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(8, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(9, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + # Subjects: N2 + TestStep( + 10, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`N2`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(11, "TH1 reads DUT Endpoint 1 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(12, "TH2 reads DUT Endpoint 1 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(13, "TH3 reads DUT Endpoint 1 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + # Subjects: N3 + TestStep( + 14, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`N3`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(15, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(16, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(17, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + # Subjects: N1, N2 + TestStep( + 18, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`N1`, `N2`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(19, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(20, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(21, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + # Subjects: N1, N3 + TestStep( + 22, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`N1`, `N3`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(23, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(24, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(25, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + # Subjects: N2, N3 + TestStep( + 26, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`N2`, `N3`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(27, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(28, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(29, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + # Subjects: N1, N2, N3 + TestStep( + 30, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`N1`, `N2`, `N3`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(31, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(32, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(33, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + # Subjects: CAT1v1 + TestStep( + 34, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`CAT1v1_subject`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(35, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(36, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(37, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + # Subjects: CAT1v2 + TestStep( + 38, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`CAT1v2_subject`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(39, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(40, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(41, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + # Subjects: CAT1v3 + TestStep( + 42, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`CAT1v3_subject`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(43, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(44, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(45, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + # Subjects: CAT2v1 + TestStep( + 46, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`CAT2v1_subject`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(47, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(48, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + TestStep(49, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + # Subjects: CAT2v2 + TestStep( + 50, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`CAT2v2_subject`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(51, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(52, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(53, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is SUCCESS"), + # Subjects: CAT2v3 + TestStep( + 54, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute,\nvalue is list of AccessControlEntryStruct containing 2 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: [{Cluster: AccessControl (0x001f), Endpoint: 0}]\n. struct\n- Privilege field: View (1)\n- AuthMode field: CASE (2)\n- Subjects field: [`CAT2v3_subject`]\n- Targets field: [{Endpoint: 0}]", "Result is SUCCESS"), + TestStep(55, "TH1 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(56, "TH2 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep(57, "TH3 reads DUT Endpoint 0 Descriptor cluster DeviceTypeList attribute", "Result is UNSUPPORTED_ACCESS (0x7e)"), + TestStep( + 58, "TH0 writes DUT Endpoint 0 AccessControl cluster ACL attribute to reset\nit back to the default State.\nValue is list of AccessControlEntryStruct containing 1 elements\n\n. struct\n- Privilege field: Administer (5)\n- AuthMode field: CASE (2)\n- Subjects field: [`N0`]\n- Targets field: null", "Result is SUCCESS"), ] return steps diff --git a/src/python_testing/TC_ACL_2_2.py b/src/python_testing/TC_ACL_2_2.py index 252868a58d4ac3..bf50501754b073 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -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 diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index d6ed97540056db..0c5e3613cfdd8b 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -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): @@ -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 diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index fb45e60ab38f8d..c9c3bca9bda1c2 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -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 diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index 74f81b7bfd79bd..f8a60d13570658 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -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 diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index c0a74a9c46538a..09fa4ea3c1a515 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -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 diff --git a/src/python_testing/TC_BOOLCFG_4_3.py b/src/python_testing/TC_BOOLCFG_4_3.py index 90106efc2b8ab4..963e424e1f8b0b 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -36,33 +36,53 @@ def desc_TC_BOOLCFG_4_3(self) -> str: def steps_TC_BOOLCFG_4_3(self) -> list[TestStep]: steps = [ - TestStep(1, "Commissioning, already done", is_commissioning=True), - TestStep("2a", "Read FeatureMap attribute"), - TestStep("2b", "Read AttributeList attribute"), - TestStep(3, "Verify AlarmsEnabled is supported"), - TestStep(4, "Create enabledAlarms and set to 0"), - TestStep("5a", "Enable VIS alarm in enabledAlarms"), - TestStep("5b", "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(6, "Send TestEventTrigger with SensorTrigger event"), - TestStep(7, "Read AlarmsActive attribute"), - TestStep(8, "Send TestEventTrigger with SensorUntrigger event"), - TestStep(9, "Read AlarmsActive attribute"), - TestStep(10, "Set enabledAlarms to 0"), - TestStep(11, "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(12, "Send TestEventTrigger with SensorTrigger event"), - TestStep(13, "Read AlarmsActive attribute"), - TestStep(14, "Send TestEventTrigger with SensorUntrigger event"), - TestStep("15a", "Enable AUD alarm in enabledAlarms"), - TestStep("15b", "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(16, "Send TestEventTrigger with SensorTrigger event"), - TestStep(17, "Read AlarmsActive attribute"), - TestStep(18, "Send TestEventTrigger with SensorUntrigger event"), - TestStep(19, "Read AlarmsActive attribute"), - TestStep(20, "Set enabledAlarms to 0"), - TestStep(21, "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(22, "Send TestEventTrigger with SensorTrigger event"), - TestStep(23, "Read AlarmsActive attribute"), - TestStep(24, "Send TestEventTrigger with SensorUntrigger event"), + TestStep(1, "{comDutTH}.", "", is_commissioning=True), + TestStep("2a", "{THread} _Featuremap_ attribute.", "{DUTreply} the _Featuremap_ attribute."), + TestStep("2b", "{THread} _AttributeList_ attribute.", "{DUTreply} the _AttributeList_ attribute."), + # Determine if test case if applicable + TestStep(3, "If the _{A_ALARMSENABLED}_ {attrIsNotSupported}, skip remaining steps and end test case.", ""), + # Given the above "guard", it is assumes in the remainder of this test case that A_ALARMSENABLED is supported, hence why this is not explicitly checked in the following steps. Verify VIS alarm is not being emitted if disabled + TestStep(4, "Create variable named enabledAlarms and set the value to 0.", ""), + # Enable only visual alarming + TestStep("5a", "If the _{F_VIS}_ {featIsSupported}, set bit 0 in enabledAlarms to 1.", ""), + TestStep( + "5b", "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + # Check that the VIS alarm is active + TestStep(6, "If the _{F_VIS}_ {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(7, "If the _{F_VIS}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", + "{resDutSuccess} and that bit 0 is set to 1 and bit 1 is set to 0, in the received value."), + # Check that the VIS alarm is no longer active + TestStep(8, "If the _{F_VIS}_ {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}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", + "{resDutSuccess} and that the received value is 0."), + TestStep(10, "Set the value of enabledAlarms to 0.", ""), + # Disable visual alarming + TestStep( + 11, "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + TestStep(12, "If the _{F_VIS}_ {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(13, "If the _{F_VIS}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", + "{resDutSuccess} and that the received value is 0."), + TestStep(14, "If the _{F_VIS}_ {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}."), + # Verify AUD alarms is not being emitted if disabled. Enable only audible alarming (if supported) + TestStep("15a", "If the _{F_AUD}_ {featIsSupported}, set bit 0 in enabledAlarms to 1.", ""), + TestStep( + "15b", "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + # Check that the VIS alarms is active + TestStep(16, "If the _{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(17, "If the _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", + "{resDutSuccess} and that bit 0 is set to 0 and bit 1 is set to 1, in the received value."), + # Check that the VIS alarms is no longer active + TestStep(18, "If the _{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(19, "If the _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", + "{resDutSuccess} and that the received value is 0."), + TestStep(20, "Set the value of enabledAlarms to 0.", ""), + # Disable audible alarming + TestStep( + 21, "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + TestStep(22, "If the _{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(23, "If the _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", + "{resDutSuccess} and that the received value is 0."), + TestStep(24, "If the _{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}."), ] return steps diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index b60ef12fd16f5f..289c7d1a8cc73d 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -36,25 +36,36 @@ def desc_TC_BOOLCFG_4_4(self) -> str: def steps_TC_BOOLCFG_4_4(self) -> list[TestStep]: steps = [ - TestStep(1, "Commissioning, already done", is_commissioning=True), - TestStep("2a", "Read FeatureMap attribute"), - TestStep("2b", "Read AttributeList attribute"), - TestStep(3, "Verify AlarmsEnabled is supported"), - TestStep(4, "Create enabledAlarms and set to 0"), - TestStep("5a", "Enable VIS alarm in enabledAlarms"), - TestStep("5b", "Enable AUD alarm in enabledAlarms"), - TestStep("5c", "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(6, "Send TestEventTrigger with SensorTrigger event"), - TestStep(7, "Read AlarmsActive attribute"), - TestStep(8, "Verify VIS alarm is active"), - TestStep("9a", "Disable VIS alarm in enabledAlarms"), - TestStep("9b", "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(10, "Read AlarmsActive attribute"), - TestStep(11, "Verify AUD alarm is active"), - TestStep("12a", "Disable VIS alarm in enabledAlarms"), - TestStep("12b", "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(13, "Read AlarmsActive attribute"), - TestStep(14, "Send TestEventTrigger with SensorUntrigger event"), + TestStep(1, "{comDutTH}.", "", is_commissioning=True), + TestStep("2a", "{THread} _Featuremap_ attribute.", "{DUTreply} the _Featuremap_ attribute."), + TestStep("2b", "{THread} _AttributeList_ attribute.", "{DUTreply} the _AttributeList_ attribute."), + # Determine if test case if applicable + TestStep(3, "If the _{A_ALARMSENABLED}_ {attrIsNotSupported}, skip remaining steps and end test case.", ""), + # Given the above "guard", it is assumes in the remainder of this test case that A_ALARMSENABLED is supported,\n// hence why this is not explicitly checked in the following steps.\n\n// Verify that active alarms is disabled properly + TestStep(4, "Create variable named enabledAlarms and set the value to 0.", ""), + # Enable all supported alarms + TestStep("5a", "If the _{F_VIS}_ {featIsSupported}, set bit 0 in enabledAlarms to 1.", ""), + TestStep("5b", "If the _{F_AUD}_ {featIsSupported}, set bit 1 in enabledAlarms to 1.", ""), + TestStep( + "5c", "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + TestStep(6, "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(7, "If the _{F_VIS}_ or _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute. {storeValueAs} activeAlarms.", + "{resDutSuccess} and that the received value is not 0."), + # Disable visual alarm and verify it is deactivated + TestStep(8, "If the _{F_VIS}_ {featIsSupported}.", "Verify that bit 0 in activeAlarms is set to 1."), + TestStep("9a", "If the _{F_VIS}_ {featIsSupported}, set bit 0 in enabledAlarms to 0.", ""), + TestStep( + "9b", "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + TestStep(10, "If the _{F_VIS}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute. {storeValueAs} activeAlarms.", + "{resDutSuccess} and that bit 0 is set to 0, in the received value."), + # Disable audible alarm and verify it is deactivated + TestStep(11, "If the _{F_AUD}_ {featIsSupported}.", "Verify that bit 1 in activeAlarms is set to 1."), + TestStep("12a", "If the _{F_AUD}_ {featIsSupported}, set bit 1 in enabledAlarms to 0.", ""), + TestStep( + "12b", "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + TestStep(13, "If the _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", + "{resDutSuccess} and that bit 1 is set to 0, in the received value."), + TestStep(14, "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}."), ] return steps diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index 90868fd8e6316c..1ffe95c344186a 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -36,20 +36,28 @@ def desc_TC_BOOLCFG_5_1(self) -> str: def steps_TC_BOOLCFG_5_1(self) -> list[TestStep]: steps = [ - TestStep(1, "Commissioning, already done", is_commissioning=True), - TestStep(2, "Read FeatureMap attribute"), - TestStep(3, "Verify SPRS feature is supported"), - TestStep(4, "Create enabledAlarms and set to 0"), - TestStep("5a", "Enable VIS alarm in enabledAlarms"), - TestStep("5b", "Enable AUD alarm in enabledAlarms"), - TestStep("5c", "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(6, "Send TestEventTrigger with SensorUntrigger event"), - TestStep("7a", "Suppress VIS alarm using SuppressAlarm command"), - TestStep("7b", "Suppress VIS alarm using SuppressAlarm command"), - TestStep(8, "Read AlarmsSuppressed attribute"), - TestStep("9a", "Suppress AUD alarm using SuppressAlarm command"), - TestStep("9b", "Suppress AUD alarm using SuppressAlarm command"), - TestStep(10, "Read AlarmsSuppressed attribute"), + TestStep(1, "{comDutTH}.", "", is_commissioning=True), + TestStep(2, "{THread} _Featuremap_ attribute.", "{DUTreply} the _Featuremap_ attribute."), + # Determine if test case if applicable + TestStep(3, "If the _{F_SPRS}_ {featIsNotSupported}, skip remaining steps and end test case.", ""), + # Given the above "guard", it is assumes in the remainder of this test case that A_ALARMSENABLED is supported,\n// hence why this is not explicitly checked in the following steps.\n\n// Verify that active alarms is disabled properly + TestStep(4, "Create variable named enabledAlarms and set the value to 0.", ""), + # Make sure all supported alarms are enabled + TestStep("5a", "If the _{F_VIS}_ {featIsSupported}, set bit 0 in enabledAlarms to 1.", ""), + TestStep("5b", "If the _{F_AUD}_ {featIsSupported}, set bit 1 in enabledAlarms to 1.", ""), + TestStep( + "5c", "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + TestStep(6, "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( + "7a", "If the _{F_VIS}_ {featIsSupported}, {THcommand} _{C_SUPPRESSALARM}_ command with AlarmsToSuppress field set to 0b01.", "{stInvalidInState}."), + TestStep( + "7b", "If the _{F_VIS}_ {featIsNotSupported}, {THcommand} _{C_SUPPRESSALARM}_ command with AlarmsToSuppress field set to 0b01.", "{resDutConstraintError}."), + TestStep(8, "{THread} _{A_ALARMSSUPPRESSED}_ attribute.", "{resDutSuccess} and that the received value is 0."), + TestStep( + "9a", "If the _{F_AUD}_ {featIsSupported}, {THcommand} _{C_SUPPRESSALARM}_ command with AlarmsToSuppress field set to 0b10.", "{stInvalidInState}."), + TestStep( + "9b", "If the _{F_VIS}_ {featIsNotSupported}, {THcommand} _{C_SUPPRESSALARM}_ command with AlarmsToSuppress field set to 0b10.", "{resDutConstraintError}."), + TestStep(10, "{THread} _{A_ALARMSSUPPRESSED}_ attribute.", "{resDutSuccess} and that the received value is 0."), ] return steps diff --git a/src/python_testing/TC_BOOLCFG_5_2.py b/src/python_testing/TC_BOOLCFG_5_2.py index 6e2657698a9d5c..5b8ecf20e80757 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -36,19 +36,27 @@ def desc_TC_BOOLCFG_5_2(self) -> str: def steps_TC_BOOLCFG_5_2(self) -> list[TestStep]: steps = [ - TestStep(1, "Commissioning, already done", is_commissioning=True), - TestStep(2, "Read FeatureMap attribute"), - TestStep(3, "Verify SPRS feature is supported"), - TestStep(4, "Create enabledAlarms and set to 0"), - TestStep("5a", "Enable VIS alarm in enabledAlarms"), - TestStep("5b", "Enable AUD alarm in enabledAlarms"), - TestStep("5c", "Set AlarmsEnabled attribute to value of enabledAlarms using AlarmsToEnableDisable command"), - TestStep(6, "Send TestEventTrigger with SensorTrigger event"), - TestStep(7, "Suppress VIS alarm using SuppressAlarm command"), - TestStep(8, "Read AlarmsSuppressed attribute"), - TestStep(9, "Suppress AUD alarm using SuppressAlarm command"), - TestStep(10, "Read AlarmsActive attribute"), - TestStep(11, "Send TestEventTrigger with SensorUntrigger event") + TestStep(1, "{comDutTH}.", "", is_commissioning=True), + TestStep(2, "{THread} _Featuremap_ attribute.", "{DUTreply} the _Featuremap_ attribute."), + # Determine if test case if applicable + TestStep(3, "If the _{F_SPRS}_ {featIsNotSupported}, skip remaining steps and end test case.", ""), + # Given the above "guard", it is assumes in the remainder of this test case that A_ALARMSENABLED is supported,\n// hence why this is not explicitly checked in the following steps.\n\n// Verify that active alarms is disabled properly + TestStep(4, "Create variable named enabledAlarms and set the value to 0.", ""), + # Make sure all supported alarms are enabled + TestStep("5a", "If the _{F_VIS}_ {featIsSupported}, set bit 0 in enabledAlarms to 1.", ""), + TestStep("5b", "If the _{F_AUD}_ {featIsSupported}, set bit 1 in enabledAlarms to 1.", ""), + TestStep( + "5c", "{THcommand} _{C_ENABLEDISABLEALARM}_ command with the value of enabledAlarms in the AlarmsToEnableDisable field.", "{resDutSuccess}."), + TestStep(6, "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( + 7, "If the _{F_VIS}_ {featIsSupported}, {THcommand} _{C_SUPPRESSALARM}_ command with AlarmsToSuppress field set to 0b01.", "{stSuccess}."), + TestStep(8, "If the _{F_VIS}_ {featIsSupported}, {THread} _{A_ALARMSSUPPRESSED}_ attribute.", + "{resDutSuccess} and that bit 0 is set to 1, in the received value."), + TestStep( + 9, "If the _{F_AUD}_ {featIsSupported}, {THcommand} _{C_SUPPRESSALARM}_ command with AlarmsToSuppress field set to 0b10.", "{stSuccess}."), + TestStep(10, "If the _{F_AUD}_ {featIsSupported}, {THread} _{A_ALARMSSUPPRESSED}_ attribute.", + "{resDutSuccess} and that bit 1 is set to 1, in the received value."), + TestStep(11, "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}."), ] return steps diff --git a/src/python_testing/test_plan_support.py b/src/python_testing/test_plan_support.py new file mode 100644 index 00000000000000..ec1b8f57dedf45 --- /dev/null +++ b/src/python_testing/test_plan_support.py @@ -0,0 +1,46 @@ +# +# Copyright (c) 2024 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 typing + + +def th_read_attr(name: str): + return f"TH reads from the DUT the _{name}_ attribute" + + +dut_reply = "Verify that the DUT response contains" + + +def dut_reply_attr(name: str): + return f"{dut_reply} the _{name}_ attribute" + + +def dut_reply_value(typename: str, min: typing.Union[int, str, None], max: stepnum: typing.Union[int, str, None]): + value_range = '' + if min is not None: + if max is not None: + value_range = f". Value has to be within a range of {min} and {max}" + else: + value_range = f". Value has to be at least {min}" + return f"{dut_reply} a {typename} value{value_range}" + + +if_attr_supported = "If the attribute is supported on the cluster" + +com_dut_th = "Commission DUT to TH (can be skipped if done in a preceding test)" + +store_value_as = "Store the value as"