Skip to content

Commit

Permalink
[FabricSync] Add MCORE_FS_1_2 and MCORE_FS_1_5 to CI (#35716)
Browse files Browse the repository at this point in the history
* [FabricSync] Add MCORE_FS_1_2 and MCORE_FS_1_5 to CI

Fixes #35481

* Remove exception
  • Loading branch information
arkq authored Sep 25, 2024
1 parent c9daf0c commit c42c83e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 9 deletions.
29 changes: 26 additions & 3 deletions src/python_testing/TC_MCORE_FS_1_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@
# limitations under the License.
#

# TODO: add to CI. See https://github.com/project-chip/connectedhomeip/issues/34676
# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments
# for details about the block below.
#

# === BEGIN CI TEST ARGUMENTS ===
# test-runner-runs: run1
# test-runner-run/run1/app: examples/fabric-admin/scripts/fabric-sync-app.py
# test-runner-run/run1/app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234
# test-runner-run/run1/factoryreset: true
# 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
# test-runner-run/run1/script-start-delay: 5
# test-runner-run/run1/quiet: false
# === END CI TEST ARGUMENTS ===

import asyncio
import hashlib
import logging
import os
Expand Down Expand Up @@ -78,7 +88,13 @@ async def setup_class(self):
self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__)
logging.info("Temporary storage directory: %s", self.storage.name)

# Get the named pipe path for the DUT_FSA app input from the user params.
dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None)
if dut_fsa_stdin_pipe is not None:
self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w")

self.th_server_port = th_server_port
# These are default testing values.
self.th_server_setup_params = _SetupParameters(
setup_qr_code="MT:-24J0AFN00KA0648G00",
manual_code=34970112332,
Expand Down Expand Up @@ -160,7 +176,14 @@ async def test_TC_MCORE_FS_1_2(self):
asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list")

self.step(2)
self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params)
if not self.is_ci:
self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params)
else:
self.dut_fsa_stdin.write(
f"pairing onnetwork 2 {self.th_server_setup_params.passcode}\n")
self.dut_fsa_stdin.flush()
# Wait for the commissioning to complete.
await asyncio.sleep(5)

self.step(3)
report_waiting_timeout_delay_sec = 30
Expand Down
32 changes: 28 additions & 4 deletions src/python_testing/TC_MCORE_FS_1_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,20 @@
# limitations under the License.
#

# TODO: add to CI. See https://github.com/project-chip/connectedhomeip/issues/34676

# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments
# for details about the block below.
#
# === BEGIN CI TEST ARGUMENTS ===
# test-runner-runs: run1
# test-runner-run/run1/app: examples/fabric-admin/scripts/fabric-sync-app.py
# test-runner-run/run1/app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234
# test-runner-run/run1/factoryreset: true
# 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
# test-runner-run/run1/script-start-delay: 5
# test-runner-run/run1/quiet: false
# === END CI TEST ARGUMENTS ===

import asyncio
import hashlib
import logging
import os
Expand Down Expand Up @@ -77,8 +89,13 @@ async def setup_class(self):
self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__)
logging.info("Temporary storage directory: %s", self.storage.name)

# Get the named pipe path for the DUT_FSA app input from the user params.
dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None)
if dut_fsa_stdin_pipe is not None:
self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w")

self.th_server_port = th_server_port
# These are default testing values
# These are default testing values.
self.th_server_setup_params = _SetupParameters(
setup_qr_code="MT:-24J0AFN00KA0648G00",
manual_code=34970112332,
Expand Down Expand Up @@ -166,7 +183,14 @@ async def test_TC_MCORE_FS_1_5(self):
asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list")

self.step(2)
self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params)
if not self.is_ci:
self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params)
else:
self.dut_fsa_stdin.write(
f"pairing onnetwork 2 {self.th_server_setup_params.passcode}\n")
self.dut_fsa_stdin.flush()
# Wait for the commissioning to complete.
await asyncio.sleep(5)

self.step(3)
report_waiting_timeout_delay_sec = 30
Expand Down
2 changes: 0 additions & 2 deletions src/python_testing/execute_python_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ def main(search_directory, env_file):
"TC_OpstateCommon.py", # Shared code for TC_OPSTATE, not a standalone test
"TC_pics_checker.py", # Currently isn't enabled because we don't have any examples with conformant PICS
"TC_TMP_2_1.py", # src/python_testing/test_testing/test_TC_TMP_2_1.py is the Unit test of this test
"TC_MCORE_FS_1_2.py", # This test requires a TH_SERVER application, hence not ready run with CI
"TC_MCORE_FS_1_5.py", # This test requires a TH_SERVER application, hence not ready run with CI
"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
"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
"TC_BRBINFO_4_1.py", # This test requires a TH_ICD_SERVER application, hence not ready run with CI
Expand Down

0 comments on commit c42c83e

Please sign in to comment.