From 1f368a24e94b024b78fb786d9c093d6f7987ed71 Mon Sep 17 00:00:00 2001 From: Jeff Feasel Date: Wed, 29 May 2024 16:21:35 +0000 Subject: [PATCH 1/7] Updated TestStep strings --- src/python_testing/TC_ACE_1_3.py | 130 +++++++++++++++------------ src/python_testing/TC_ACL_2_2.py | 6 +- src/python_testing/TC_BOOLCFG_2_1.py | 20 ++--- src/python_testing/TC_BOOLCFG_3_1.py | 26 +++--- src/python_testing/TC_BOOLCFG_4_1.py | 14 +-- src/python_testing/TC_BOOLCFG_4_2.py | 33 +++---- src/python_testing/TC_BOOLCFG_4_3.py | 64 +++++++------ src/python_testing/TC_BOOLCFG_4_4.py | 43 +++++---- src/python_testing/TC_BOOLCFG_5_1.py | 31 ++++--- src/python_testing/TC_BOOLCFG_5_2.py | 29 +++--- 10 files changed, 217 insertions(+), 179 deletions(-) diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index ec34b50bf1a9e5..1d9cb8a9ff0d3e 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -51,64 +51,78 @@ 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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,\n value 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\n it back to the default State.\n Value 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..a41d8f47fe0e6f 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -26,9 +26,9 @@ 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..a62f298eebb880 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -34,16 +34,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, "{comDutTH}.", "", is_commissioning=True), + TestStep(2, "{THread} _AttributeList_ attribute.", "{DUTreply} the _AttributeList_ attribute."), + TestStep(3, "{ifAttrIsSupported}, {THread} _{A_SUPPORTEDSENSITIVITYLEVELS}_ attribute. {storeValueAs} numberOfSupportedLevels.", "{DUTreply} an uint8 value. {valrange} 2 and 10."), + TestStep(4, "{ifAttrIsSupported}, {THread} _{A_CURRENTSENSITIVITYLEVEL}_ attribute.", "{DUTreply} an uint8 value. {valrange} 0 and the value of numberOfSupportedLevels."), + TestStep(5, "{ifAttrIsSupported}, {THread} _{A_DEFAULTSENSITIVITYLEVEL}_ attribute.", "{DUTreply} an uint8 value. {valrange} 0 and the value of numberOfSupportedLevels."), + TestStep(6, "{ifAttrIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 3."), + TestStep(7, "{ifAttrIsSupported}, {THread} _{A_ALARMSSUPPRESSED}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 3."), + TestStep(8, "{ifAttrIsSupported}, {THread} _{A_ALARMSENABLED}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 3."), + TestStep(9, "{ifAttrIsSupported}, {THread} _{A_ALARMSSUPPORTED}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 3."), + TestStep(10, "{ifAttrIsSupported}, {THread} _{A_SENSORFAULT}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 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..402c5aca60cad6 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -34,19 +34,19 @@ 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..5cc4aa27ff05d3 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -32,13 +32,13 @@ 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..75a449d9373411 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -36,21 +36,24 @@ 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..41b5a435a5e93f 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -36,33 +36,43 @@ 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..8a32aa2c837721 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -36,25 +36,30 @@ 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.", ""), ] return steps diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index 90868fd8e6316c..00ff9705fa3d95 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -36,20 +36,23 @@ 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..027e0de707bb04 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -36,19 +36,22 @@ 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 From 928fe765b10a4f8ce221dcbb3b492e59c6f3c991 Mon Sep 17 00:00:00 2001 From: Jeff Feasel Date: Wed, 29 May 2024 13:47:53 -0400 Subject: [PATCH 2/7] Removed unneeded whitespace from the description strings. --- src/python_testing/TC_ACE_1_3.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 1d9cb8a9ff0d3e..456cfc1450fba7 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -53,76 +53,76 @@ def steps_TC_ACE_1_3(self) -> list[TestStep]: steps = [ 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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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,\n value 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(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\n it back to the default State.\n Value 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"), + 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 From 4373a69258c2bc425bbcc6d3e0d25a8f42c8f3ea Mon Sep 17 00:00:00 2001 From: Jeff Feasel Date: Wed, 29 May 2024 18:16:38 +0000 Subject: [PATCH 3/7] autopep8 --- src/python_testing/TC_ACE_1_3.py | 42 +++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 456cfc1450fba7..050cf8e519eb5c 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -53,72 +53,86 @@ def steps_TC_ACE_1_3(self) -> list[TestStep]: steps = [ 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( + 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( + 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( + 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( + 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( + 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( + 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( + 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( + 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( + 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( + 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( + 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( + 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( + 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( + 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)"), From a4405f1dde31b393fd0f86cc977b2280c292c51f Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 29 May 2024 18:17:01 +0000 Subject: [PATCH 4/7] Restyled by autopep8 --- src/python_testing/TC_ACE_1_3.py | 6 ++++-- src/python_testing/TC_ACL_2_2.py | 6 ++++-- src/python_testing/TC_BOOLCFG_2_1.py | 24 ++++++++++++++-------- src/python_testing/TC_BOOLCFG_3_1.py | 6 ++++-- src/python_testing/TC_BOOLCFG_4_1.py | 3 ++- src/python_testing/TC_BOOLCFG_4_2.py | 12 +++++++---- src/python_testing/TC_BOOLCFG_4_3.py | 30 ++++++++++++++++++---------- src/python_testing/TC_BOOLCFG_4_4.py | 18 +++++++++++------ src/python_testing/TC_BOOLCFG_5_1.py | 15 +++++++++----- src/python_testing/TC_BOOLCFG_5_2.py | 15 +++++++++----- 10 files changed, 90 insertions(+), 45 deletions(-) diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 050cf8e519eb5c..db2ff1c844d833 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -51,7 +51,8 @@ def desc_TC_ACE_1_3(self) -> str: def steps_TC_ACE_1_3(self) -> list[TestStep]: steps = [ - TestStep(1, "Precondition: TH0 commissions DUT using admin node ID `N0`", "DUT is commissioned on TH0 fabric", is_commissioning=True), + 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"), @@ -136,7 +137,8 @@ def steps_TC_ACE_1_3(self) -> list[TestStep]: 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"), + 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 a41d8f47fe0e6f..bf50501754b073 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -27,8 +27,10 @@ def desc_TC_ACL_2_2(self) -> str: def steps_TC_ACL_2_2(self) -> list[TestStep]: steps = [ 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)"), + 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 a62f298eebb880..7ab1a3996109ea 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -36,14 +36,22 @@ def steps_TC_BOOLCFG_2_1(self) -> list[TestStep]: steps = [ TestStep(1, "{comDutTH}.", "", is_commissioning=True), TestStep(2, "{THread} _AttributeList_ attribute.", "{DUTreply} the _AttributeList_ attribute."), - TestStep(3, "{ifAttrIsSupported}, {THread} _{A_SUPPORTEDSENSITIVITYLEVELS}_ attribute. {storeValueAs} numberOfSupportedLevels.", "{DUTreply} an uint8 value. {valrange} 2 and 10."), - TestStep(4, "{ifAttrIsSupported}, {THread} _{A_CURRENTSENSITIVITYLEVEL}_ attribute.", "{DUTreply} an uint8 value. {valrange} 0 and the value of numberOfSupportedLevels."), - TestStep(5, "{ifAttrIsSupported}, {THread} _{A_DEFAULTSENSITIVITYLEVEL}_ attribute.", "{DUTreply} an uint8 value. {valrange} 0 and the value of numberOfSupportedLevels."), - TestStep(6, "{ifAttrIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 3."), - TestStep(7, "{ifAttrIsSupported}, {THread} _{A_ALARMSSUPPRESSED}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 3."), - TestStep(8, "{ifAttrIsSupported}, {THread} _{A_ALARMSENABLED}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 3."), - TestStep(9, "{ifAttrIsSupported}, {THread} _{A_ALARMSSUPPORTED}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 3."), - TestStep(10, "{ifAttrIsSupported}, {THread} _{A_SENSORFAULT}_ attribute.", "{DUTreply} an map8 value. {valrange} 0 and 1."), + TestStep(3, "{ifAttrIsSupported}, {THread} _{A_SUPPORTEDSENSITIVITYLEVELS}_ attribute. {storeValueAs} numberOfSupportedLevels.", + "{DUTreply} an uint8 value. {valrange} 2 and 10."), + TestStep(4, "{ifAttrIsSupported}, {THread} _{A_CURRENTSENSITIVITYLEVEL}_ attribute.", + "{DUTreply} an uint8 value. {valrange} 0 and the value of numberOfSupportedLevels."), + TestStep(5, "{ifAttrIsSupported}, {THread} _{A_DEFAULTSENSITIVITYLEVEL}_ attribute.", + "{DUTreply} an uint8 value. {valrange} 0 and the value of numberOfSupportedLevels."), + TestStep(6, "{ifAttrIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", + "{DUTreply} an map8 value. {valrange} 0 and 3."), + TestStep(7, "{ifAttrIsSupported}, {THread} _{A_ALARMSSUPPRESSED}_ attribute.", + "{DUTreply} an map8 value. {valrange} 0 and 3."), + TestStep(8, "{ifAttrIsSupported}, {THread} _{A_ALARMSENABLED}_ attribute.", + "{DUTreply} an map8 value. {valrange} 0 and 3."), + TestStep(9, "{ifAttrIsSupported}, {THread} _{A_ALARMSSUPPORTED}_ attribute.", + "{DUTreply} an map8 value. {valrange} 0 and 3."), + TestStep(10, "{ifAttrIsSupported}, {THread} _{A_SENSORFAULT}_ attribute.", + "{DUTreply} an map8 value. {valrange} 0 and 1."), ] return steps diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index 402c5aca60cad6..c9c3bca9bda1c2 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -41,9 +41,11 @@ def steps_TC_BOOLCFG_3_1(self) -> list[TestStep]: 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( + 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( + 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}."), diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index 5cc4aa27ff05d3..f8a60d13570658 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -34,7 +34,8 @@ def steps_TC_BOOLCFG_4_1(self) -> list[TestStep]: steps = [ 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(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."), diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index 75a449d9373411..09fa4ea3c1a515 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -41,19 +41,23 @@ def steps_TC_BOOLCFG_4_2(self) -> list[TestStep]: 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( + "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(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."), + 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 41b5a435a5e93f..963e424e1f8b0b 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -45,33 +45,43 @@ def steps_TC_BOOLCFG_4_3(self) -> list[TestStep]: 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}."), + 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."), + 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(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( + 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(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}."), + 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."), + 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(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( + 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(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 8a32aa2c837721..787420703d67a2 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -46,19 +46,25 @@ def steps_TC_BOOLCFG_4_4(self) -> list[TestStep]: # 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( + "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."), + 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."), + 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( + "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.", ""), ] return steps diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index 00ff9705fa3d95..1ffe95c344186a 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -45,13 +45,18 @@ def steps_TC_BOOLCFG_5_1(self) -> list[TestStep]: # 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( + "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( + "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( + "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 027e0de707bb04..5b8ecf20e80757 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -45,12 +45,17 @@ def steps_TC_BOOLCFG_5_2(self) -> list[TestStep]: # 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( + "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( + 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 From ea619cf737b981765d21b5ed724f3455dbdc66b9 Mon Sep 17 00:00:00 2001 From: Jeff Feasel Date: Thu, 30 May 2024 15:21:24 +0000 Subject: [PATCH 5/7] Added macros to TC_BOOLCFG_2_1 --- src/python_testing/TC_BOOLCFG_2_1.py | 29 +++++++--------- src/python_testing/test_plan_support.py | 44 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 18 deletions(-) create mode 100644 src/python_testing/test_plan_support.py diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 7ab1a3996109ea..f00aae81ecd56a 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) class TC_BOOLCFG_2_1(MatterBaseTest): @@ -34,24 +35,16 @@ def desc_TC_BOOLCFG_2_1(self) -> str: def steps_TC_BOOLCFG_2_1(self) -> list[TestStep]: steps = [ - TestStep(1, "{comDutTH}.", "", is_commissioning=True), - TestStep(2, "{THread} _AttributeList_ attribute.", "{DUTreply} the _AttributeList_ attribute."), - TestStep(3, "{ifAttrIsSupported}, {THread} _{A_SUPPORTEDSENSITIVITYLEVELS}_ attribute. {storeValueAs} numberOfSupportedLevels.", - "{DUTreply} an uint8 value. {valrange} 2 and 10."), - TestStep(4, "{ifAttrIsSupported}, {THread} _{A_CURRENTSENSITIVITYLEVEL}_ attribute.", - "{DUTreply} an uint8 value. {valrange} 0 and the value of numberOfSupportedLevels."), - TestStep(5, "{ifAttrIsSupported}, {THread} _{A_DEFAULTSENSITIVITYLEVEL}_ attribute.", - "{DUTreply} an uint8 value. {valrange} 0 and the value of numberOfSupportedLevels."), - TestStep(6, "{ifAttrIsSupported}, {THread} _{A_ALARMSACTIVE}_ attribute.", - "{DUTreply} an map8 value. {valrange} 0 and 3."), - TestStep(7, "{ifAttrIsSupported}, {THread} _{A_ALARMSSUPPRESSED}_ attribute.", - "{DUTreply} an map8 value. {valrange} 0 and 3."), - TestStep(8, "{ifAttrIsSupported}, {THread} _{A_ALARMSENABLED}_ attribute.", - "{DUTreply} an map8 value. {valrange} 0 and 3."), - TestStep(9, "{ifAttrIsSupported}, {THread} _{A_ALARMSSUPPORTED}_ attribute.", - "{DUTreply} an map8 value. {valrange} 0 and 3."), - TestStep(10, "{ifAttrIsSupported}, {THread} _{A_SENSORFAULT}_ attribute.", - "{DUTreply} an map8 value. {valrange} 0 and 1."), + 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')}. {storeValueAs} 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/test_plan_support.py b/src/python_testing/test_plan_support.py new file mode 100644 index 00000000000000..14d9542a6a08f3 --- /dev/null +++ b/src/python_testing/test_plan_support.py @@ -0,0 +1,44 @@ +# +# 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)" From f251be2951df7d6e856aa1f26c17c1ccaeac60d0 Mon Sep 17 00:00:00 2001 From: Jeff Feasel Date: Thu, 30 May 2024 15:28:22 +0000 Subject: [PATCH 6/7] Added one more macro --- src/python_testing/TC_BOOLCFG_2_1.py | 4 ++-- src/python_testing/test_plan_support.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index f00aae81ecd56a..0c5e3613cfdd8b 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -22,7 +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) +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): @@ -37,7 +37,7 @@ def steps_TC_BOOLCFG_2_1(self) -> list[TestStep]: steps = [ 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')}. {storeValueAs} numberOfSupportedLevels.", f"{dut_reply_value('uint8', 2, 10)}."), + 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)}."), diff --git a/src/python_testing/test_plan_support.py b/src/python_testing/test_plan_support.py index 14d9542a6a08f3..ec1b8f57dedf45 100644 --- a/src/python_testing/test_plan_support.py +++ b/src/python_testing/test_plan_support.py @@ -42,3 +42,5 @@ def dut_reply_value(typename: str, min: typing.Union[int, str, None], max: stepn 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" From ab8f93b80b8bb19ab8c50ddea097f03b7074b1ef Mon Sep 17 00:00:00 2001 From: Jeff Feasel Date: Thu, 30 May 2024 15:43:07 +0000 Subject: [PATCH 7/7] TC_BOOLCFG_4_4 specification was updated --- src/python_testing/TC_BOOLCFG_4_4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index 787420703d67a2..289c7d1a8cc73d 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -65,7 +65,7 @@ def steps_TC_BOOLCFG_4_4(self) -> list[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.", ""), + 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