Skip to content

Commit d9999f4

Browse files
authored
Update TC_TSTAT_2_2.py for v1.4.1 compatibility (#37528)
* test: Update TC_TSTAT_2_2.py for v1.4.1 compatibility Make two compatibility changes for v1.4.1 build: 1. Change import path from 'chip.testing.matter_testing' to 'matter_testing_support' to fix import resolution 2. Reformat CI Test Arguments header block to use legacy parser format (single-line arguments instead of nested YAML structure) Old path: chip.testing.matter_testing New path: matter_testing_support Parser compatibility: - Flattened nested YAML structure in CI Test Arguments - Changed 'factory-reset' to 'factoryreset' for parser support - Maintained all original test parameters and values Testing: - Verified successful build on v1.4.1 - Validated CI Test Arguments parsing * backport: Add get_endpoint() to MatterBaseTest for TC_TSTAT_2_2.py Add get_endpoint() function to MatterBaseTest class to support the backported TC_TSTAT_2_2.py thermostat test script. This function was originally added to MatterBaseTest in a newer branch and is required for the test script to function properly.
1 parent 7d67dc9 commit d9999f4

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

src/python_testing/TC_TSTAT_2_2.py

+7-15
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,19 @@
1818
# for details about the block below.
1919
#
2020
# === BEGIN CI TEST ARGUMENTS ===
21-
# test-runner-runs:
22-
# run1:
23-
# app: ${ALL_CLUSTERS_APP}
24-
# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json
25-
# script-args: >
26-
# --storage-path admin_storage.json
27-
# --commissioning-method on-network
28-
# --discriminator 1234
29-
# --passcode 20202021
30-
# --endpoint 1
31-
# --trace-to json:${TRACE_TEST_JSON}.json
32-
# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
33-
# factory-reset: true
34-
# quiet: true
21+
# test-runner-runs: run1
22+
# test-runner-run/run1/app: ${ALL_CLUSTERS_APP}
23+
# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json
24+
# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
25+
# test-runner-run/run1/factoryreset: True
26+
# test-runner-run/run1/quiet: True
3527
# === END CI TEST ARGUMENTS ===
3628

3729
import logging
3830

3931
import chip.clusters as Clusters
4032
from chip.interaction_model import Status
41-
from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
33+
from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
4234
from mobly import asserts
4335

4436
logger = logging.getLogger(__name__)

src/python_testing/matter_testing_support.py

+3
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,9 @@ def certificate_authority_manager(self) -> chip.CertificateAuthority.Certificate
12011201
def dut_node_id(self) -> int:
12021202
return self.matter_test_config.dut_node_ids[0]
12031203

1204+
def get_endpoint(self, default: Optional[int] = 0) -> int:
1205+
return self.matter_test_config.endpoint if self.matter_test_config.endpoint is not None else default
1206+
12041207
def setup_class(self):
12051208
super().setup_class()
12061209

0 commit comments

Comments
 (0)