Skip to content

Commit c3ebe38

Browse files
woody-applejamesharrowandy31415
authored
Fixes project-chip#32429 Added PICS guard to steps in TC_EEM_2_1 (project-chip#32464) (project-chip#32511)
* Fixes project-chip#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 <andy314@gmail.com>
1 parent aa682ce commit c3ebe38

8 files changed

+36
-25
lines changed

src/python_testing/TC_EEM_2_1.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,29 @@ async def test_TC_EEM_2_1(self):
6262
"Accuracy measurementType must be ElectricalEnergy")
6363

6464
self.step("3")
65-
cumulativeEnergyImported = await self.read_eem_attribute_expect_success("CumulativeEnergyImported")
66-
logger.info(f"Rx'd CumulativeEnergyImported: {cumulativeEnergyImported}")
65+
if self.pics_guard(self.check_pics("EEM.S.A0001")):
66+
cumulativeEnergyImported = await self.read_eem_attribute_expect_success("CumulativeEnergyImported")
67+
logger.info(f"Rx'd CumulativeEnergyImported: {cumulativeEnergyImported}")
6768

6869
self.step("4")
69-
cumulativeEnergyExported = await self.read_eem_attribute_expect_success("CumulativeEnergyExported")
70-
logger.info(f"Rx'd CumulativeEnergyExported: {cumulativeEnergyExported}")
70+
if self.pics_guard(self.check_pics("EEM.S.A0002")):
71+
cumulativeEnergyExported = await self.read_eem_attribute_expect_success("CumulativeEnergyExported")
72+
logger.info(f"Rx'd CumulativeEnergyExported: {cumulativeEnergyExported}")
7173

7274
self.step("5")
73-
periodicEnergyImported = await self.read_eem_attribute_expect_success("PeriodicEnergyImported")
74-
logger.info(f"Rx'd PeriodicEnergyImported: {periodicEnergyImported}")
75+
if self.pics_guard(self.check_pics("EEM.S.A0003")):
76+
periodicEnergyImported = await self.read_eem_attribute_expect_success("PeriodicEnergyImported")
77+
logger.info(f"Rx'd PeriodicEnergyImported: {periodicEnergyImported}")
7578

7679
self.step("6")
77-
periodicEnergyExported = await self.read_eem_attribute_expect_success("PeriodicEnergyExported")
78-
logger.info(f"Rx'd PeriodicEnergyExported: {periodicEnergyExported}")
80+
if self.pics_guard(self.check_pics("EEM.S.A0004")):
81+
periodicEnergyExported = await self.read_eem_attribute_expect_success("PeriodicEnergyExported")
82+
logger.info(f"Rx'd PeriodicEnergyExported: {periodicEnergyExported}")
7983

8084
self.step("7")
81-
cumulativeEnergyReset = await self.read_eem_attribute_expect_success("CumulativeEnergyReset")
82-
logger.info(f"Rx'd CumulativeEnergyReset: {cumulativeEnergyReset}")
85+
if self.pics_guard(self.check_pics("EEM.S.A0005")):
86+
cumulativeEnergyReset = await self.read_eem_attribute_expect_success("CumulativeEnergyReset")
87+
logger.info(f"Rx'd CumulativeEnergyReset: {cumulativeEnergyReset}")
8388

8489

8590
if __name__ == "__main__":

src/python_testing/TC_EEM_2_2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def desc_TC_EEM_2_2(self) -> str:
3030

3131
def pics_TC_EEM_2_2(self):
3232
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
33-
return ["EEM.S", "EEM.S.F02(CUME)", "EEM.S.F00(IMPE)"]
33+
return ["EEM.S", "EEM.S.F02", "EEM.S.F00"]
3434

3535
def steps_TC_EEM_2_2(self) -> list[TestStep]:
3636
steps = [

src/python_testing/TC_EEM_2_3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def desc_TC_EEM_2_3(self) -> str:
3030

3131
def pics_TC_EEM_2_3(self):
3232
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
33-
return ["EEM.S", "EEM.S.F02(CUME)", "EEM.S.F01(EXPE)"]
33+
return ["EEM.S", "EEM.S.F02", "EEM.S.F01"]
3434

3535
def steps_TC_EEM_2_3(self) -> list[TestStep]:
3636
steps = [

src/python_testing/TC_EEM_2_4.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def desc_TC_EEM_2_4(self) -> str:
3030

3131
def pics_TC_EEM_2_4(self):
3232
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
33-
return ["EEM.S", "EEM.S.F03(PERE)", "EEM.S.F00(IMPE)"]
33+
return ["EEM.S", "EEM.S.F03", "EEM.S.F00"]
3434

3535
def steps_TC_EEM_2_4(self) -> list[TestStep]:
3636
steps = [

src/python_testing/TC_EEM_2_5.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def desc_TC_EEM_2_5(self) -> str:
3030

3131
def pics_TC_EEM_2_5(self):
3232
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
33-
return ["EEM.S", "EEM.S.F03(PERE)", "EEM.S.F01(EXPE)"]
33+
return ["EEM.S", "EEM.S.F03", "EEM.S.F01"]
3434

3535
def steps_TC_EEM_2_5(self) -> list[TestStep]:
3636
steps = [

src/python_testing/TC_EEVSE_2_4.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class TC_EEVSE_2_4(MatterBaseTest, EEVSEBaseTestHelper):
3030

3131
def desc_TC_EEVSE_2_4(self) -> str:
3232
"""Returns a description of this test"""
33-
return "5.1.XXX. [TC-EEVSE-2.4] Fault test functionality with DUT as Server"
33+
return "5.1.5. [TC-EEVSE-2.4] Fault test functionality with DUT as Server"
3434

3535
def pics_TC_EEVSE_2_4(self):
3636
""" This function returns a list of PICS for this test case that must be True for the test to be run"""

src/python_testing/TC_EEVSE_2_5.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ class TC_EEVSE_2_5(MatterBaseTest, EEVSEBaseTestHelper):
3030

3131
def desc_TC_EEVSE_2_5(self) -> str:
3232
"""Returns a description of this test"""
33-
return "5.1.XXX. [TC-EEVSE-2.4] Fault test functionality with DUT as Server"
33+
return "5.1.6. [TC-EEVSE-2.5] Optional diagnostics functionality with DUT as Server"
3434

3535
def pics_TC_EEVSE_2_5(self):
3636
""" This function returns a list of PICS for this test case that must be True for the test to be run"""
37-
# In this case - there is no feature flags needed to run this test case
38-
return ["EEVSE.S"]
37+
# In this case - we need the EVSE to support the StartDiagnostics command
38+
return ["EEVSE.S", "EEVSE.S.C04.Rsp"]
3939

4040
def steps_TC_EEVSE_2_5(self) -> list[TestStep]:
4141
steps = [

src/python_testing/TC_EPM_2_2.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,37 @@ async def test_TC_EPM_2_2(self):
7171
time.sleep(3)
7272

7373
self.step("4a")
74+
# Active power is Mandatory
7475
active_power = await self.check_epm_attribute_in_range("ActivePower", 980000, 1020000) # 1kW +/- 20W
7576

7677
self.step("4b")
77-
active_current = await self.check_epm_attribute_in_range("ActiveCurrent", 3848, 4848) # 4.348 A +/- 500mA
78+
if self.pics_guard(self.check_pics("EPM.S.A0005")):
79+
active_current = await self.check_epm_attribute_in_range("ActiveCurrent", 3848, 4848) # 4.348 A +/- 500mA
7880

7981
self.step("4c")
80-
voltage = await self.check_epm_attribute_in_range("Voltage", 229000, 231000) # 230V +/- 1V
82+
if self.pics_guard(self.check_pics("EPM.S.A0004")):
83+
voltage = await self.check_epm_attribute_in_range("Voltage", 229000, 231000) # 230V +/- 1V
8184

8285
self.step("5")
8386
# After 3 seconds...
8487
time.sleep(3)
8588

8689
self.step("5a")
90+
# Active power is Mandatory
8791
active_power2 = await self.check_epm_attribute_in_range("ActivePower", 980000, 1020000) # 1kW +/- 20W
8892
asserts.assert_not_equal(active_power, active_power2,
8993
f"Expected ActivePower readings to have changed {active_power}, {active_power2}")
9094

9195
self.step("5b")
92-
active_current2 = await self.check_epm_attribute_in_range("ActiveCurrent", 3848, 4848) # 4.348 A +/- 500mA
93-
asserts.assert_not_equal(active_current, active_current2,
94-
f"Expected ActiveCurrent readings to have changed {active_current}, {active_current2}")
96+
if self.pics_guard(self.check_pics("EPM.S.A0005")):
97+
active_current2 = await self.check_epm_attribute_in_range("ActiveCurrent", 3848, 4848) # 4.348 A +/- 500mA
98+
asserts.assert_not_equal(active_current, active_current2,
99+
f"Expected ActiveCurrent readings to have changed {active_current}, {active_current2}")
95100

96101
self.step("5c")
97-
voltage2 = await self.check_epm_attribute_in_range("Voltage", 229000, 231000) # 230V +/- 1V
98-
asserts.assert_not_equal(voltage, voltage2, f"Expected Voltage readings to have changed {voltage}, {voltage2}")
102+
if self.pics_guard(self.check_pics("EPM.S.A0004")):
103+
voltage2 = await self.check_epm_attribute_in_range("Voltage", 229000, 231000) # 230V +/- 1V
104+
asserts.assert_not_equal(voltage, voltage2, f"Expected Voltage readings to have changed {voltage}, {voltage2}")
99105

100106
self.step("6")
101107
await self.send_test_event_trigger_stop_fake_readings()

0 commit comments

Comments
 (0)