Skip to content

Commit 598fc94

Browse files
committed
Update all tests
1 parent d6cf3e1 commit 598fc94

File tree

6 files changed

+41
-19
lines changed

6 files changed

+41
-19
lines changed

src/python_testing/TC_CCTRL_2_1.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
import chip.clusters as Clusters
19-
from matter_testing_support import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_for_each_matching_endpoint
19+
from matter_testing_support import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches
2020
from mobly import asserts
2121

2222

@@ -27,7 +27,7 @@ def steps_TC_CCTRL_2_1(self) -> list[TestStep]:
2727
TestStep(2, "Validate SupportedDeviceCategories is set accordingly based on MCORE.FS")]
2828
return steps
2929

30-
@run_for_each_matching_endpoint(has_cluster(Clusters.CommissionerControl))
30+
@run_if_endpoint_matches(has_cluster(Clusters.CommissionerControl))
3131
async def test_TC_CCTRL_2_1(self):
3232
self.step(1)
3333
is_fabric_sync_pics_enabled = self.check_pics("MCORE.FS")

src/python_testing/TC_CCTRL_2_2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from chip import ChipDeviceCtrl
3636
from chip.interaction_model import InteractionModelError, Status
3737
from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster,
38-
run_for_each_matching_endpoint)
38+
run_if_endpoint_matches)
3939
from mobly import asserts
4040

4141

@@ -117,7 +117,7 @@ def steps_TC_CCTRL_2_2(self) -> list[TestStep]:
117117

118118
return steps
119119

120-
@run_for_each_matching_endpoint(has_cluster(Clusters.CommissionerControl))
120+
@run_if_endpoint_matches(has_cluster(Clusters.CommissionerControl))
121121
async def test_TC_CCTRL_2_2(self):
122122
self.is_ci = self.check_pics('PICS_SDK_CI_ONLY')
123123

src/python_testing/TC_CC_2_2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import chip.clusters as Clusters
3434
from chip.clusters import ClusterObjects as ClusterObjects
3535
from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main,
36-
has_cluster, run_for_each_matching_endpoint)
36+
has_cluster, run_if_endpoint_matches)
3737
from mobly import asserts
3838
from test_plan_support import commission_if_required, if_feature_supported, read_attribute, verify_success
3939

@@ -107,7 +107,7 @@ def entry_count_verification() -> str:
107107
"The third entry in _reportedRemainingTimeValuesList_ is equal to 0")
108108
]
109109

110-
@run_for_each_matching_endpoint(has_cluster(Clusters.ColorControl))
110+
@run_if_endpoint_matches(has_cluster(Clusters.ColorControl))
111111
async def test_TC_CC_2_2(self):
112112
gather_time = 20
113113

src/python_testing/TC_LVL_2_3.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import chip.clusters as Clusters
3434
import test_plan_support
3535
from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main,
36-
has_cluster, run_for_each_matching_endpoint)
36+
has_cluster, run_if_endpoint_matches)
3737
from mobly import asserts
3838

3939

@@ -84,7 +84,7 @@ def steps_TC_LVL_2_3(self) -> list[TestStep]:
8484
"The third entry in reportedRemainingTimeValuesList is equal to 0")
8585
]
8686

87-
@run_for_each_matching_endpoint(has_cluster(Clusters.LevelControl))
87+
@run_if_endpoint_matches(has_cluster(Clusters.LevelControl))
8888
async def test_TC_LVL_2_3(self):
8989
# Commissioning - already done
9090
self.step(1)

src/python_testing/TC_SWTCH.py

+30-8
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,35 @@
1818
# for details about the block below.
1919
#
2020
# === BEGIN CI TEST ARGUMENTS ===
21-
# test-runner-runs: run1
21+
# test-runner-runs: run1 run2 run3 run4
22+
#
2223
# test-runner-run/run1/app: ${ALL_CLUSTERS_APP}
2324
# test-runner-run/run1/factoryreset: True
2425
# test-runner-run/run1/quiet: True
2526
# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json
26-
# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values
27+
# test-runner-run/run1/script-args: --endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values
28+
#
29+
# test-runner-run/run2/app: ${ALL_CLUSTERS_APP}
30+
# test-runner-run/run2/factoryreset: True
31+
# test-runner-run/run2/quiet: True
32+
# test-runner-run/run2/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json
33+
# test-runner-run/run2/script-args: --endpoint 2 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values
34+
#
35+
# test-runner-run/run3/app: ${ALL_CLUSTERS_APP}
36+
# test-runner-run/run3/factoryreset: True
37+
# test-runner-run/run3/quiet: True
38+
# test-runner-run/run3/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json
39+
# test-runner-run/run3/script-args: --endpoint 3 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values
40+
#
41+
# test-runner-run/run4/app: ${ALL_CLUSTERS_APP}
42+
# test-runner-run/run4/factoryreset: True
43+
# test-runner-run/run4/quiet: True
44+
# test-runner-run/run4/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json
45+
# test-runner-run/run4/script-args: --endpoint 4 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values
46+
#
2747
# === END CI TEST ARGUMENTS ===
48+
#
49+
# These tests run on every endpoint regardless of whether a switch is present because they are set up to auto-select.
2850

2951
import json
3052
import logging
@@ -40,7 +62,7 @@
4062
from chip.tlv import uint
4163
from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep,
4264
await_sequence_of_reports, default_matter_test_main, has_feature,
43-
run_for_each_matching_endpoint)
65+
run_if_endpoint_matches)
4466
from mobly import asserts
4567

4668
logger = logging.getLogger(__name__)
@@ -261,7 +283,7 @@ def steps_TC_SWTCH_2_2(self):
261283
TestStep(10, "TH reads the CurrentPosition attribute from the DUT", "Verify that the value is 0"),
262284
]
263285

264-
@run_for_each_matching_endpoint(has_feature(Clusters.Switch, Clusters.Switch.Bitmaps.Feature.kLatchingSwitch))
286+
@run_if_endpoint_matches(has_feature(Clusters.Switch, Clusters.Switch.Bitmaps.Feature.kLatchingSwitch))
265287
async def test_TC_SWTCH_2_2(self):
266288
post_prompt_settle_delay_seconds = 10.0
267289

@@ -347,7 +369,7 @@ def steps_TC_SWTCH_2_3(self):
347369
TestStep(9, "TH reads the CurrentPosition attribute from the DUT", "Verify that the value is 0"),
348370
]
349371

350-
@run_for_each_matching_endpoint(has_feature(Clusters.Switch, Clusters.Switch.Bitmaps.Feature.kMomentarySwitch))
372+
@run_if_endpoint_matches(has_feature(Clusters.Switch, Clusters.Switch.Bitmaps.Feature.kMomentarySwitch))
351373
async def test_TC_SWTCH_2_3(self):
352374
# Commissioning - already done
353375
self.step(1)
@@ -426,7 +448,7 @@ def steps_TC_SWTCH_2_4(self):
426448
""")
427449
]
428450

429-
@run_for_each_matching_endpoint(has_feature(Clusters.Switch, Clusters.Switch.Bitmaps.Feature.kMomentarySwitch))
451+
@run_if_endpoint_matches(has_feature(Clusters.Switch, Clusters.Switch.Bitmaps.Feature.kMomentarySwitch))
430452
async def test_TC_SWTCH_2_4(self):
431453
switch_pressed_position = self._default_pressed_position
432454
post_prompt_settle_delay_seconds = 10.0
@@ -599,7 +621,7 @@ def should_run_SWTCH_2_5(wildcard, endpoint):
599621
asf = has_feature(Clusters.Switch, 0x20)
600622
return msm(wildcard, endpoint) and not asf(wildcard, endpoint)
601623

602-
@run_for_each_matching_endpoint(should_run_SWTCH_2_5)
624+
@run_if_endpoint_matches(should_run_SWTCH_2_5)
603625
async def test_TC_SWTCH_2_5(self):
604626
# Commissioning - already done
605627
self.step(1)
@@ -774,7 +796,7 @@ def should_run_SWTCH_2_6(wildcard, endpoint):
774796
asf = has_feature(Clusters.Switch, 0x20)
775797
return msm(wildcard, endpoint) and asf(wildcard, endpoint)
776798

777-
@run_for_each_matching_endpoint(should_run_SWTCH_2_6)
799+
@run_if_endpoint_matches(should_run_SWTCH_2_6)
778800
async def test_TC_SWTCH_2_6(self):
779801
# Commissioning - already done
780802
self.step(1)

src/python_testing/TC_TIMESYNC_2_1.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# test-runner-run/run1/factoryreset: True
2525
# test-runner-run/run1/quiet: True
2626
# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json
27-
# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
27+
# test-runner-run/run1/script-args: --endpoint 0 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
2828
# === END CI TEST ARGUMENTS ===
2929

3030
import ipaddress
@@ -33,7 +33,7 @@
3333
import chip.clusters as Clusters
3434
from chip.clusters.Types import NullValue
3535
from matter_testing_support import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster,
36-
run_for_each_matching_endpoint, utc_time_in_matter_epoch)
36+
run_if_endpoint_matches, utc_time_in_matter_epoch)
3737
from mobly import asserts
3838

3939

@@ -42,7 +42,7 @@ async def read_ts_attribute_expect_success(self, attribute):
4242
cluster = Clusters.Objects.TimeSynchronization
4343
return await self.read_single_attribute_check_success(endpoint=None, cluster=cluster, attribute=attribute)
4444

45-
@run_for_each_matching_endpoint(has_cluster(Clusters.TimeSynchronization) and has_attribute(Clusters.TimeSynchronization.Attributes.TimeSource))
45+
@run_if_endpoint_matches(has_cluster(Clusters.TimeSynchronization) and has_attribute(Clusters.TimeSynchronization.Attributes.TimeSource))
4646
async def test_TC_TIMESYNC_2_1(self):
4747
attributes = Clusters.TimeSynchronization.Attributes
4848
features = await self.read_ts_attribute_expect_success(attribute=attributes.FeatureMap)

0 commit comments

Comments
 (0)