Skip to content

Commit 6063e23

Browse files
Check fabric-sync application with ECOINFO tests on CI (#36733)
* Build fabric-sync for testing * Test TC_ECOINFO test with new fabric-sync-app on CI * Restyled by isort --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 5bd336f commit 6063e23

File tree

2 files changed

+63
-14
lines changed

2 files changed

+63
-14
lines changed

src/python_testing/TC_ECOINFO_2_1.py

+30-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,25 @@
3131
# --commissioning-method on-network
3232
# --discriminator 1234
3333
# --passcode 20202021
34-
# --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin
34+
# --string-arg th_server_app_path:${ALL_CLUSTERS_APP}
35+
# --string-arg dut_fsa_stdin_pipe:dut-fsa-stdin
36+
# --trace-to json:${TRACE_TEST_JSON}.json
37+
# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
38+
# factory-reset: true
39+
# quiet: true
40+
# run2:
41+
# app: ${FABRIC_SYNC_APP}
42+
# app-args: --discriminator=1234
43+
# app-stdin-pipe: dut-fsa-stdin
44+
# script-args: >
45+
# --PICS src/app/tests/suites/certification/ci-pics-values
46+
# --storage-path admin_storage.json
47+
# --commissioning-method on-network
48+
# --discriminator 1234
49+
# --passcode 20202021
50+
# --bool-arg unified_fabric_sync_app:true
51+
# --string-arg th_server_app_path:${ALL_CLUSTERS_APP}
52+
# --string-arg dut_fsa_stdin_pipe:dut-fsa-stdin
3553
# --trace-to json:${TRACE_TEST_JSON}.json
3654
# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
3755
# factory-reset: true
@@ -48,7 +66,8 @@
4866
from chip.clusters.Types import NullValue
4967
from chip.interaction_model import Status
5068
from chip.testing.apps import AppServerSubprocess
51-
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches
69+
from chip.testing.matter_testing import (MatterBaseTest, SetupParameters, TestStep, async_test_body, default_matter_test_main,
70+
type_matches)
5271
from chip.tlv import uint
5372
from mobly import asserts
5473

@@ -92,22 +111,26 @@ async def _setup_ci_prerequisites(self):
92111
logging.info("Temporary storage directory: %s", self.storage.name)
93112

94113
self.th_server_port = 5544
95-
self.th_server_discriminator = random.randint(0, 4095)
96-
self.th_server_passcode = 20202021
114+
self.th_server_setup_params = SetupParameters(
115+
discriminator=random.randint(0, 4095),
116+
passcode=20202021)
97117

98118
# Start the server app.
99119
self.th_server = AppServerSubprocess(
100120
th_server_app,
101121
storage_dir=self.storage.name,
102122
port=self.th_server_port,
103-
discriminator=self.th_server_discriminator,
104-
passcode=self.th_server_passcode)
123+
discriminator=self.th_server_setup_params.discriminator,
124+
passcode=self.th_server_setup_params.passcode)
105125
self.th_server.start(
106126
expected_output="Server initialization complete",
107127
timeout=30)
108128

109129
# Add some server to the DUT_FSA's Aggregator/Bridge.
110-
self.dut_fsa_stdin.write(f"pairing onnetwork 2 {self.th_server_passcode}\n")
130+
if self.user_params.get("unified_fabric_sync_app"):
131+
self.dut_fsa_stdin.write(f"app pair-device 2 {self.th_server_setup_params.qr_code}\n")
132+
else:
133+
self.dut_fsa_stdin.write(f"pairing onnetwork 2 {self.th_server_setup_params.passcode}\n")
111134
self.dut_fsa_stdin.flush()
112135
# Wait for the commissioning to complete.
113136
await asyncio.sleep(5)

src/python_testing/TC_ECOINFO_2_2.py

+33-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,25 @@
3131
# --commissioning-method on-network
3232
# --discriminator 1234
3333
# --passcode 20202021
34-
# --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin
34+
# --string-arg th_server_app_path:${ALL_CLUSTERS_APP}
35+
# --string-arg dut_fsa_stdin_pipe:dut-fsa-stdin
36+
# --trace-to json:${TRACE_TEST_JSON}.json
37+
# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
38+
# factory-reset: true
39+
# quiet: true
40+
# run2:
41+
# app: ${FABRIC_SYNC_APP}
42+
# app-args: --discriminator=1234
43+
# app-stdin-pipe: dut-fsa-stdin
44+
# script-args: >
45+
# --PICS src/app/tests/suites/certification/ci-pics-values
46+
# --storage-path admin_storage.json
47+
# --commissioning-method on-network
48+
# --discriminator 1234
49+
# --passcode 20202021
50+
# --bool-arg unified_fabric_sync_app:true
51+
# --string-arg th_server_app_path:${ALL_CLUSTERS_APP}
52+
# --string-arg dut_fsa_stdin_pipe:dut-fsa-stdin
3553
# --trace-to json:${TRACE_TEST_JSON}.json
3654
# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
3755
# factory-reset: true
@@ -47,7 +65,7 @@
4765
import chip.clusters as Clusters
4866
from chip.interaction_model import Status
4967
from chip.testing.apps import AppServerSubprocess
50-
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
68+
from chip.testing.matter_testing import MatterBaseTest, SetupParameters, TestStep, async_test_body, default_matter_test_main
5169
from mobly import asserts
5270

5371
_DEVICE_TYPE_AGGREGATOR = 0x000E
@@ -91,16 +109,18 @@ def _setup_ci_prerequisites(self):
91109
logging.info("Temporary storage directory: %s", self.storage.name)
92110

93111
self.th_server_port = 5544
94-
self.th_server_discriminator = random.randint(0, 4095)
112+
self.th_server_setup_params = SetupParameters(
113+
discriminator=random.randint(0, 4095),
114+
passcode=20202021)
95115
self.th_server_passcode = 20202021
96116

97117
# Start the server app.
98118
self.th_server = AppServerSubprocess(
99119
th_server_app,
100120
storage_dir=self.storage.name,
101121
port=self.th_server_port,
102-
discriminator=self.th_server_discriminator,
103-
passcode=self.th_server_passcode)
122+
discriminator=self.th_server_setup_params.discriminator,
123+
passcode=self.th_server_setup_params.passcode)
104124
self.th_server.start(
105125
expected_output="Server initialization complete",
106126
timeout=30)
@@ -161,7 +181,10 @@ async def test_TC_ECOINFO_2_2(self):
161181
self.wait_for_user_input("Add a bridged device using method indicated by the manufacturer")
162182
else:
163183
# Add some server to the DUT_FSA's Aggregator/Bridge.
164-
self.dut_fsa_stdin.write(f"pairing onnetwork 2 {self.th_server_passcode}\n")
184+
if self.user_params.get("unified_fabric_sync_app"):
185+
self.dut_fsa_stdin.write(f"app pair-device 2 {self.th_server_setup_params.qr_code}\n")
186+
else:
187+
self.dut_fsa_stdin.write(f"pairing onnetwork 2 {self.th_server_setup_params.passcode}\n")
165188
self.dut_fsa_stdin.flush()
166189
# Wait for the commissioning to complete.
167190
await asyncio.sleep(5)
@@ -200,7 +223,10 @@ async def test_TC_ECOINFO_2_2(self):
200223
self.wait_for_user_input("Removed bridged device added in step 2a using method indicated by the manufacturer")
201224
else:
202225
# Remove previously added server from the DUT_FSA's Aggregator/Bridge.
203-
self.dut_fsa_stdin.write("pairing unpair 2\n")
226+
if self.user_params.get("unified_fabric_sync_app"):
227+
self.dut_fsa_stdin.write("app remove-device 2\n")
228+
else:
229+
self.dut_fsa_stdin.write("pairing unpair 2\n")
204230
self.dut_fsa_stdin.flush()
205231
# Wait for the command to complete.
206232
await asyncio.sleep(2)

0 commit comments

Comments
 (0)