Skip to content

Commit 6d6400a

Browse files
Fix post-certification tests (project-chip#38931)
* change Hooks.test_start method signature * introduce connect_over_pase function * use connect_over_pase function in tests * Restyled by isort * remove connnect_over_pase function * fix empty list errors in tests * get_DSL_data function * implement cache * Restyled by isort * Revert "Restyled by isort" This reverts commit 573d124. * Revert "implement cache" This reverts commit 1fa8434. * Revert "get_DSL_data function" This reverts commit 5732de1. * add python tests to sys.path --------- Co-authored-by: Restyled.io <[email protected]>
1 parent 2a2937a commit 6d6400a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/python_testing/TC_DA_1_2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ async def test_TC_DA_1_2(self):
190190

191191
do_test_over_pase = self.user_params.get("use_pase_only", False)
192192
if do_test_over_pase:
193-
self.connect_over_pase(self.default_controller)
193+
setupCode = self.matter_test_config.qr_code_content or self.matter_test_config.manual_code
194+
await self.default_controller.FindOrEstablishPASESession(setupCode[0], self.dut_node_id)
194195

195196
# Commissioning - done
196197
self.step(0)

src/python_testing/post_certification_tests/production_device_checks.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
os.path.join(DEFAULT_CHIP_ROOT, 'credentials')))
7878
import fetch_paa_certs_from_dcl
7979

80+
sys.path.append(os.path.abspath(os.path.join(DEFAULT_CHIP_ROOT, 'src', 'python_testing')))
81+
8082

8183
@dataclass
8284
class Failure:
@@ -96,7 +98,7 @@ def start(self, count: int):
9698
def stop(self, duration: int):
9799
pass
98100

99-
def test_start(self, filename: str, name: str, count: int):
101+
def test_start(self, filename: str, name: str, count: int, steps: list[str] = []):
100102
self.current_test = name
101103
pass
102104

@@ -127,7 +129,8 @@ def get_failures(self) -> list[str]:
127129
class TestEventTriggersCheck(MatterBaseTest, BasicCompositionTests):
128130
@async_test_body
129131
async def test_TestEventTriggersCheck(self):
130-
self.connect_over_pase(self.default_controller)
132+
setupCode = self.matter_test_config.qr_code_content or self.matter_test_config.manual_code
133+
await self.default_controller.FindOrEstablishPASESession(setupCode[0], self.dut_node_id)
131134
gd = Clusters.GeneralDiagnostics
132135
ret = await self.read_single_attribute_check_success(cluster=gd, attribute=gd.Attributes.TestEventTriggersEnabled)
133136
asserts.assert_equal(ret, 0, "TestEventTriggers are still on")
@@ -136,7 +139,8 @@ async def test_TestEventTriggersCheck(self):
136139
class DclCheck(MatterBaseTest, BasicCompositionTests):
137140
@async_test_body
138141
async def setup_class(self):
139-
self.connect_over_pase(self.default_controller)
142+
setupCode = self.matter_test_config.qr_code_content or self.matter_test_config.manual_code
143+
await self.default_controller.FindOrEstablishPASESession(setupCode[0], self.dut_node_id)
140144
bi = Clusters.BasicInformation
141145
self.vid = await self.read_single_attribute_check_success(cluster=bi, attribute=bi.Attributes.VendorID)
142146
self.pid = await self.read_single_attribute_check_success(cluster=bi, attribute=bi.Attributes.ProductID)

0 commit comments

Comments
 (0)