Skip to content

Commit

Permalink
Fixes #32429 Added PICS guard to steps in TC_EEM_2_1 (#32464)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jamesharrow committed Mar 8, 2024
1 parent b5705ea commit e6e1c3a
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 25 deletions.
25 changes: 15 additions & 10 deletions src/python_testing/TC_EEM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_EEM_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_EEM_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_EEM_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_EEM_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_EEVSE_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
6 changes: 3 additions & 3 deletions src/python_testing/TC_EEVSE_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
20 changes: 13 additions & 7 deletions src/python_testing/TC_EPM_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e6e1c3a

Please sign in to comment.