From c3ebe38f8d51cede5cb9246c80bb616f909ba826 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Fri, 12 Apr 2024 11:59:59 -0700 Subject: [PATCH] Fixes #32429 Added PICS guard to steps in TC_EEM_2_1 (#32464) (#32511) * Fixes #32429 Added PICS guard to steps in TC_EEM_2_1 * Changed to use a fixed string for the PICS EEM.S * Corrected top level script PICS feature names (removed bracketed human helpfulness) * Corrected description in EEVSE 2.5 and added PICS condition for StartDiagnostics command support * Added PICS guard to TC_EPM_2_2.py for ActivePower and Voltage attribute readings Co-authored-by: jamesharrow <93921463+jamesharrow@users.noreply.github.com> Co-authored-by: Andrei Litvin --- src/python_testing/TC_EEM_2_1.py | 25 +++++++++++++++---------- src/python_testing/TC_EEM_2_2.py | 2 +- src/python_testing/TC_EEM_2_3.py | 2 +- src/python_testing/TC_EEM_2_4.py | 2 +- src/python_testing/TC_EEM_2_5.py | 2 +- src/python_testing/TC_EEVSE_2_4.py | 2 +- src/python_testing/TC_EEVSE_2_5.py | 6 +++--- src/python_testing/TC_EPM_2_2.py | 20 +++++++++++++------- 8 files changed, 36 insertions(+), 25 deletions(-) diff --git a/src/python_testing/TC_EEM_2_1.py b/src/python_testing/TC_EEM_2_1.py index 909380401e49d6..27246b26c272a2 100644 --- a/src/python_testing/TC_EEM_2_1.py +++ b/src/python_testing/TC_EEM_2_1.py @@ -62,24 +62,29 @@ async def test_TC_EEM_2_1(self): "Accuracy measurementType must be ElectricalEnergy") self.step("3") - cumulativeEnergyImported = await self.read_eem_attribute_expect_success("CumulativeEnergyImported") - logger.info(f"Rx'd CumulativeEnergyImported: {cumulativeEnergyImported}") + if self.pics_guard(self.check_pics("EEM.S.A0001")): + cumulativeEnergyImported = await self.read_eem_attribute_expect_success("CumulativeEnergyImported") + logger.info(f"Rx'd CumulativeEnergyImported: {cumulativeEnergyImported}") self.step("4") - cumulativeEnergyExported = await self.read_eem_attribute_expect_success("CumulativeEnergyExported") - logger.info(f"Rx'd CumulativeEnergyExported: {cumulativeEnergyExported}") + if self.pics_guard(self.check_pics("EEM.S.A0002")): + cumulativeEnergyExported = await self.read_eem_attribute_expect_success("CumulativeEnergyExported") + logger.info(f"Rx'd CumulativeEnergyExported: {cumulativeEnergyExported}") self.step("5") - periodicEnergyImported = await self.read_eem_attribute_expect_success("PeriodicEnergyImported") - logger.info(f"Rx'd PeriodicEnergyImported: {periodicEnergyImported}") + if self.pics_guard(self.check_pics("EEM.S.A0003")): + periodicEnergyImported = await self.read_eem_attribute_expect_success("PeriodicEnergyImported") + logger.info(f"Rx'd PeriodicEnergyImported: {periodicEnergyImported}") self.step("6") - periodicEnergyExported = await self.read_eem_attribute_expect_success("PeriodicEnergyExported") - logger.info(f"Rx'd PeriodicEnergyExported: {periodicEnergyExported}") + if self.pics_guard(self.check_pics("EEM.S.A0004")): + periodicEnergyExported = await self.read_eem_attribute_expect_success("PeriodicEnergyExported") + logger.info(f"Rx'd PeriodicEnergyExported: {periodicEnergyExported}") self.step("7") - cumulativeEnergyReset = await self.read_eem_attribute_expect_success("CumulativeEnergyReset") - logger.info(f"Rx'd CumulativeEnergyReset: {cumulativeEnergyReset}") + if self.pics_guard(self.check_pics("EEM.S.A0005")): + cumulativeEnergyReset = await self.read_eem_attribute_expect_success("CumulativeEnergyReset") + logger.info(f"Rx'd CumulativeEnergyReset: {cumulativeEnergyReset}") if __name__ == "__main__": diff --git a/src/python_testing/TC_EEM_2_2.py b/src/python_testing/TC_EEM_2_2.py index 58e651de9425eb..3f3cb5b67cad8b 100644 --- a/src/python_testing/TC_EEM_2_2.py +++ b/src/python_testing/TC_EEM_2_2.py @@ -30,7 +30,7 @@ def desc_TC_EEM_2_2(self) -> str: def pics_TC_EEM_2_2(self): """ This function returns a list of PICS for this test case that must be True for the test to be run""" - return ["EEM.S", "EEM.S.F02(CUME)", "EEM.S.F00(IMPE)"] + return ["EEM.S", "EEM.S.F02", "EEM.S.F00"] def steps_TC_EEM_2_2(self) -> list[TestStep]: steps = [ diff --git a/src/python_testing/TC_EEM_2_3.py b/src/python_testing/TC_EEM_2_3.py index 1183d9591bcd5e..4691043502dfee 100644 --- a/src/python_testing/TC_EEM_2_3.py +++ b/src/python_testing/TC_EEM_2_3.py @@ -30,7 +30,7 @@ def desc_TC_EEM_2_3(self) -> str: def pics_TC_EEM_2_3(self): """ This function returns a list of PICS for this test case that must be True for the test to be run""" - return ["EEM.S", "EEM.S.F02(CUME)", "EEM.S.F01(EXPE)"] + return ["EEM.S", "EEM.S.F02", "EEM.S.F01"] def steps_TC_EEM_2_3(self) -> list[TestStep]: steps = [ diff --git a/src/python_testing/TC_EEM_2_4.py b/src/python_testing/TC_EEM_2_4.py index b219e3c4e770a5..3b8dd346d2a36c 100644 --- a/src/python_testing/TC_EEM_2_4.py +++ b/src/python_testing/TC_EEM_2_4.py @@ -30,7 +30,7 @@ def desc_TC_EEM_2_4(self) -> str: def pics_TC_EEM_2_4(self): """ This function returns a list of PICS for this test case that must be True for the test to be run""" - return ["EEM.S", "EEM.S.F03(PERE)", "EEM.S.F00(IMPE)"] + return ["EEM.S", "EEM.S.F03", "EEM.S.F00"] def steps_TC_EEM_2_4(self) -> list[TestStep]: steps = [ diff --git a/src/python_testing/TC_EEM_2_5.py b/src/python_testing/TC_EEM_2_5.py index 945a97f89da8aa..871fb8e5536743 100644 --- a/src/python_testing/TC_EEM_2_5.py +++ b/src/python_testing/TC_EEM_2_5.py @@ -30,7 +30,7 @@ def desc_TC_EEM_2_5(self) -> str: def pics_TC_EEM_2_5(self): """ This function returns a list of PICS for this test case that must be True for the test to be run""" - return ["EEM.S", "EEM.S.F03(PERE)", "EEM.S.F01(EXPE)"] + return ["EEM.S", "EEM.S.F03", "EEM.S.F01"] def steps_TC_EEM_2_5(self) -> list[TestStep]: steps = [ diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index 9ccad2fdb692db..959932da1fb6cb 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -30,7 +30,7 @@ class TC_EEVSE_2_4(MatterBaseTest, EEVSEBaseTestHelper): def desc_TC_EEVSE_2_4(self) -> str: """Returns a description of this test""" - return "5.1.XXX. [TC-EEVSE-2.4] Fault test functionality with DUT as Server" + return "5.1.5. [TC-EEVSE-2.4] Fault test functionality with DUT as Server" def pics_TC_EEVSE_2_4(self): """ This function returns a list of PICS for this test case that must be True for the test to be run""" diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 00150f263c7576..7ab6efddc40366 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -30,12 +30,12 @@ class TC_EEVSE_2_5(MatterBaseTest, EEVSEBaseTestHelper): def desc_TC_EEVSE_2_5(self) -> str: """Returns a description of this test""" - return "5.1.XXX. [TC-EEVSE-2.4] Fault test functionality with DUT as Server" + return "5.1.6. [TC-EEVSE-2.5] Optional diagnostics functionality with DUT as Server" def pics_TC_EEVSE_2_5(self): """ This function returns a list of PICS for this test case that must be True for the test to be run""" - # In this case - there is no feature flags needed to run this test case - return ["EEVSE.S"] + # In this case - we need the EVSE to support the StartDiagnostics command + return ["EEVSE.S", "EEVSE.S.C04.Rsp"] def steps_TC_EEVSE_2_5(self) -> list[TestStep]: steps = [ diff --git a/src/python_testing/TC_EPM_2_2.py b/src/python_testing/TC_EPM_2_2.py index eb6f6081f6d690..756f62f626a0b2 100644 --- a/src/python_testing/TC_EPM_2_2.py +++ b/src/python_testing/TC_EPM_2_2.py @@ -71,31 +71,37 @@ async def test_TC_EPM_2_2(self): time.sleep(3) self.step("4a") + # Active power is Mandatory active_power = await self.check_epm_attribute_in_range("ActivePower", 980000, 1020000) # 1kW +/- 20W self.step("4b") - active_current = await self.check_epm_attribute_in_range("ActiveCurrent", 3848, 4848) # 4.348 A +/- 500mA + if self.pics_guard(self.check_pics("EPM.S.A0005")): + active_current = await self.check_epm_attribute_in_range("ActiveCurrent", 3848, 4848) # 4.348 A +/- 500mA self.step("4c") - voltage = await self.check_epm_attribute_in_range("Voltage", 229000, 231000) # 230V +/- 1V + if self.pics_guard(self.check_pics("EPM.S.A0004")): + voltage = await self.check_epm_attribute_in_range("Voltage", 229000, 231000) # 230V +/- 1V self.step("5") # After 3 seconds... time.sleep(3) self.step("5a") + # Active power is Mandatory active_power2 = await self.check_epm_attribute_in_range("ActivePower", 980000, 1020000) # 1kW +/- 20W asserts.assert_not_equal(active_power, active_power2, f"Expected ActivePower readings to have changed {active_power}, {active_power2}") self.step("5b") - active_current2 = await self.check_epm_attribute_in_range("ActiveCurrent", 3848, 4848) # 4.348 A +/- 500mA - asserts.assert_not_equal(active_current, active_current2, - f"Expected ActiveCurrent readings to have changed {active_current}, {active_current2}") + if self.pics_guard(self.check_pics("EPM.S.A0005")): + active_current2 = await self.check_epm_attribute_in_range("ActiveCurrent", 3848, 4848) # 4.348 A +/- 500mA + asserts.assert_not_equal(active_current, active_current2, + f"Expected ActiveCurrent readings to have changed {active_current}, {active_current2}") self.step("5c") - voltage2 = await self.check_epm_attribute_in_range("Voltage", 229000, 231000) # 230V +/- 1V - asserts.assert_not_equal(voltage, voltage2, f"Expected Voltage readings to have changed {voltage}, {voltage2}") + if self.pics_guard(self.check_pics("EPM.S.A0004")): + voltage2 = await self.check_epm_attribute_in_range("Voltage", 229000, 231000) # 230V +/- 1V + asserts.assert_not_equal(voltage, voltage2, f"Expected Voltage readings to have changed {voltage}, {voltage2}") self.step("6") await self.send_test_event_trigger_stop_fake_readings()