Skip to content

Commit c42c83e

Browse files
authored
[FabricSync] Add MCORE_FS_1_2 and MCORE_FS_1_5 to CI (project-chip#35716)
* [FabricSync] Add MCORE_FS_1_2 and MCORE_FS_1_5 to CI Fixes project-chip#35481 * Remove exception
1 parent c9daf0c commit c42c83e

File tree

3 files changed

+54
-9
lines changed

3 files changed

+54
-9
lines changed

src/python_testing/TC_MCORE_FS_1_2.py

+26-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@
1515
# limitations under the License.
1616
#
1717

18-
# TODO: add to CI. See https://github.com/project-chip/connectedhomeip/issues/34676
18+
# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments
1919
# for details about the block below.
2020
#
21-
21+
# === BEGIN CI TEST ARGUMENTS ===
22+
# test-runner-runs: run1
23+
# test-runner-run/run1/app: examples/fabric-admin/scripts/fabric-sync-app.py
24+
# test-runner-run/run1/app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234
25+
# test-runner-run/run1/factoryreset: true
26+
# test-runner-run/run1/script-args: --PICS src/app/tests/suites/certification/ci-pics-values --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
27+
# test-runner-run/run1/script-start-delay: 5
28+
# test-runner-run/run1/quiet: false
29+
# === END CI TEST ARGUMENTS ===
30+
31+
import asyncio
2232
import hashlib
2333
import logging
2434
import os
@@ -78,7 +88,13 @@ async def setup_class(self):
7888
self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__)
7989
logging.info("Temporary storage directory: %s", self.storage.name)
8090

91+
# Get the named pipe path for the DUT_FSA app input from the user params.
92+
dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None)
93+
if dut_fsa_stdin_pipe is not None:
94+
self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w")
95+
8196
self.th_server_port = th_server_port
97+
# These are default testing values.
8298
self.th_server_setup_params = _SetupParameters(
8399
setup_qr_code="MT:-24J0AFN00KA0648G00",
84100
manual_code=34970112332,
@@ -160,7 +176,14 @@ async def test_TC_MCORE_FS_1_2(self):
160176
asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list")
161177

162178
self.step(2)
163-
self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params)
179+
if not self.is_ci:
180+
self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params)
181+
else:
182+
self.dut_fsa_stdin.write(
183+
f"pairing onnetwork 2 {self.th_server_setup_params.passcode}\n")
184+
self.dut_fsa_stdin.flush()
185+
# Wait for the commissioning to complete.
186+
await asyncio.sleep(5)
164187

165188
self.step(3)
166189
report_waiting_timeout_delay_sec = 30

src/python_testing/TC_MCORE_FS_1_5.py

+28-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,20 @@
1515
# limitations under the License.
1616
#
1717

18-
# TODO: add to CI. See https://github.com/project-chip/connectedhomeip/issues/34676
19-
18+
# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments
19+
# for details about the block below.
20+
#
21+
# === BEGIN CI TEST ARGUMENTS ===
22+
# test-runner-runs: run1
23+
# test-runner-run/run1/app: examples/fabric-admin/scripts/fabric-sync-app.py
24+
# test-runner-run/run1/app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234
25+
# test-runner-run/run1/factoryreset: true
26+
# test-runner-run/run1/script-args: --PICS src/app/tests/suites/certification/ci-pics-values --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
27+
# test-runner-run/run1/script-start-delay: 5
28+
# test-runner-run/run1/quiet: false
29+
# === END CI TEST ARGUMENTS ===
30+
31+
import asyncio
2032
import hashlib
2133
import logging
2234
import os
@@ -77,8 +89,13 @@ async def setup_class(self):
7789
self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__)
7890
logging.info("Temporary storage directory: %s", self.storage.name)
7991

92+
# Get the named pipe path for the DUT_FSA app input from the user params.
93+
dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None)
94+
if dut_fsa_stdin_pipe is not None:
95+
self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w")
96+
8097
self.th_server_port = th_server_port
81-
# These are default testing values
98+
# These are default testing values.
8299
self.th_server_setup_params = _SetupParameters(
83100
setup_qr_code="MT:-24J0AFN00KA0648G00",
84101
manual_code=34970112332,
@@ -166,7 +183,14 @@ async def test_TC_MCORE_FS_1_5(self):
166183
asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list")
167184

168185
self.step(2)
169-
self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params)
186+
if not self.is_ci:
187+
self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params)
188+
else:
189+
self.dut_fsa_stdin.write(
190+
f"pairing onnetwork 2 {self.th_server_setup_params.passcode}\n")
191+
self.dut_fsa_stdin.flush()
192+
# Wait for the commissioning to complete.
193+
await asyncio.sleep(5)
170194

171195
self.step(3)
172196
report_waiting_timeout_delay_sec = 30

src/python_testing/execute_python_tests.py

-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ def main(search_directory, env_file):
6969
"TC_OpstateCommon.py", # Shared code for TC_OPSTATE, not a standalone test
7070
"TC_pics_checker.py", # Currently isn't enabled because we don't have any examples with conformant PICS
7171
"TC_TMP_2_1.py", # src/python_testing/test_testing/test_TC_TMP_2_1.py is the Unit test of this test
72-
"TC_MCORE_FS_1_2.py", # This test requires a TH_SERVER application, hence not ready run with CI
73-
"TC_MCORE_FS_1_5.py", # This test requires a TH_SERVER application, hence not ready run with CI
7472
"TC_OCC_3_1.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change
7573
"TC_OCC_3_2.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change
7674
"TC_BRBINFO_4_1.py", # This test requires a TH_ICD_SERVER application, hence not ready run with CI

0 commit comments

Comments
 (0)