Skip to content

Commit e772b69

Browse files
authored
Update TC_MCORE_FS_1_3 to align with the Test Spec (project-chip#35270)
* Update TC_MCORE_FS_1_3 to align with the test spec * Instead of th_server_app_path use th_server_no_uid_app_path
1 parent a68b7fc commit e772b69

File tree

1 file changed

+19
-41
lines changed

1 file changed

+19
-41
lines changed

src/python_testing/TC_MCORE_FS_1_3.py

+19-41
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717

18-
# This test requires a TH_SERVER application that returns UnsupportedAttribute when reading UniqueID from BasicInformation Cluster. Please specify with --string-arg th_server_app_path:<path_to_app>
18+
# This test requires a TH_SERVER application that returns UnsupportedAttribute when reading UniqueID from BasicInformation Cluster. Please specify with --string-arg th_server_no_uid_app_path:<path_to_app>
1919

2020
import logging
2121
import os
@@ -36,14 +36,10 @@ class TC_MCORE_FS_1_3(MatterBaseTest):
3636
@async_test_body
3737
async def setup_class(self):
3838
super().setup_class()
39-
self.device_for_th_eco_nodeid = 1111
40-
self.device_for_th_eco_kvs = None
41-
self.device_for_th_eco_port = 5543
42-
self.app_process_for_th_eco = None
43-
44-
self.device_for_dut_eco_nodeid = 1112
45-
self.device_for_dut_eco_kvs = None
46-
self.device_for_dut_eco_port = 5544
39+
40+
self.th_server_nodeid = 1111
41+
self.th_server_kvs = None
42+
self.th_server_port = 5543
4743
self.app_process_for_dut_eco = None
4844

4945
# Create a second controller on a new fabric to communicate to the server
@@ -57,20 +53,14 @@ def teardown_class(self):
5753
logging.warning("Stopping app with SIGTERM")
5854
self.app_process_for_dut_eco.send_signal(signal.SIGTERM.value)
5955
self.app_process_for_dut_eco.wait()
60-
if self.app_process_for_th_eco is not None:
61-
logging.warning("Stopping app with SIGTERM")
62-
self.app_process_for_th_eco.send_signal(signal.SIGTERM.value)
63-
self.app_process_for_th_eco.wait()
6456

65-
os.remove(self.device_for_dut_eco_kvs)
66-
if self.device_for_th_eco_kvs is not None:
67-
os.remove(self.device_for_th_eco_kvs)
57+
os.remove(self.th_server_kvs)
6858
super().teardown_class()
6959

7060
async def create_device_and_commission_to_th_fabric(self, kvs, port, node_id_for_th, device_info):
71-
app = self.user_params.get("th_server_app_path", None)
61+
app = self.user_params.get("th_server_no_uid_app_path", None)
7262
if not app:
73-
asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:<path_to_app>')
63+
asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_no_uid_app_path:<path_to_app>')
7464

7565
if not os.path.exists(app):
7666
asserts.fail(f'The path {app} does not exist')
@@ -95,33 +85,33 @@ async def create_device_and_commission_to_th_fabric(self, kvs, port, node_id_for
9585
logging.info("Commissioning device for DUT ecosystem onto TH for managing")
9686

9787
def steps_TC_MCORE_FS_1_3(self) -> list[TestStep]:
98-
steps = [TestStep(1, "DUT_FSA commissions TH_SED_DUT to DUT_FSAs fabric and generates a UniqueID", is_commissioning=True),
99-
TestStep(2, "TH_FSA commissions TH_SED_TH onto TH_FSAs fabric and generates a UniqueID."),
100-
TestStep(3, "Follow manufacturer provided instructions to enable DUT_FSA to synchronize TH_SED_TH onto DUT_FSAs fabric."),
101-
TestStep(4, "DUT_FSA synchronizes TH_SED_TH onto DUT_FSAs fabric and copies the UniqueID presented by TH_FSAs Bridged Device Basic Information Cluster.")]
88+
steps = [TestStep(1, "TH commissions TH_SERVER to TH’s fabric.", is_commissioning=True),
89+
TestStep(2, "DUT_FSA commissions TH_SERVER to DUT_FSA’s fabric and generates a UniqueID.")]
10290
return steps
10391

10492
@async_test_body
10593
async def test_TC_MCORE_FS_1_3(self):
10694
self.is_ci = self.check_pics('PICS_SDK_CI_ONLY')
10795
self.print_step(0, "Commissioning DUT to TH, already done")
96+
10897
self.step(1)
109-
# These steps are not explicitly in step 1, but they help identify the dynamically added endpoint in step 1.
11098
root_node_endpoint = 0
11199
root_part_list = await self.read_single_attribute_check_success(cluster=Clusters.Descriptor, attribute=Clusters.Descriptor.Attributes.PartsList, endpoint=root_node_endpoint)
112100
set_of_endpoints_before_adding_device = set(root_part_list)
101+
logging.info(f"Set of endpoints before adding the device: {set_of_endpoints_before_adding_device}")
113102

114103
kvs = f'kvs_{str(uuid.uuid4())}'
115-
device_info = "for DUT ecosystem"
116-
await self.create_device_and_commission_to_th_fabric(kvs, self.device_for_dut_eco_port, self.device_for_dut_eco_nodeid, device_info)
104+
device_info = "for TH ecosystem"
105+
await self.create_device_and_commission_to_th_fabric(kvs, self.th_server_port, self.th_server_nodeid, device_info)
117106

118-
self.device_for_dut_eco_kvs = kvs
119-
read_result = await self.TH_server_controller.ReadAttribute(self.device_for_dut_eco_nodeid, [(root_node_endpoint, Clusters.BasicInformation.Attributes.UniqueID)])
107+
self.th_server_kvs = kvs
108+
read_result = await self.TH_server_controller.ReadAttribute(self.th_server_nodeid, [(root_node_endpoint, Clusters.BasicInformation.Attributes.UniqueID)])
120109
result = read_result[root_node_endpoint][Clusters.BasicInformation][Clusters.BasicInformation.Attributes.UniqueID]
121110
asserts.assert_true(type_matches(result, Clusters.Attribute.ValueDecodeFailure), "We were expecting a value decode failure")
122111
asserts.assert_equal(result.Reason.status, Status.UnsupportedAttribute, "Incorrect error returned from reading UniqueID")
123112

124-
params = await self.openCommissioningWindow(dev_ctrl=self.TH_server_controller, node_id=self.device_for_dut_eco_nodeid)
113+
self.step(2)
114+
params = await self.openCommissioningWindow(dev_ctrl=self.TH_server_controller, node_id=self.th_server_nodeid)
125115

126116
self.wait_for_user_input(
127117
prompt_msg=f"Using the DUT vendor's provided interface, commission the device using the following parameters:\n"
@@ -134,6 +124,7 @@ async def test_TC_MCORE_FS_1_3(self):
134124

135125
root_part_list = await self.read_single_attribute_check_success(cluster=Clusters.Descriptor, attribute=Clusters.Descriptor.Attributes.PartsList, endpoint=root_node_endpoint)
136126
set_of_endpoints_after_adding_device = set(root_part_list)
127+
logging.info(f"Set of endpoints after adding the device: {set_of_endpoints_after_adding_device}")
137128

138129
asserts.assert_true(set_of_endpoints_after_adding_device.issuperset(
139130
set_of_endpoints_before_adding_device), "Expected only new endpoints to be added")
@@ -145,19 +136,6 @@ async def test_TC_MCORE_FS_1_3(self):
145136
asserts.assert_true(type_matches(th_sed_dut_unique_id, str), "UniqueID should be a string")
146137
asserts.assert_true(th_sed_dut_unique_id, "UniqueID should not be an empty string")
147138

148-
self.step(2)
149-
kvs = f'kvs_{str(uuid.uuid4())}'
150-
device_info = "for TH_FSA ecosystem"
151-
await self.create_device_and_commission_to_th_fabric(kvs, self.device_for_th_eco_port, self.device_for_th_eco_nodeid, device_info)
152-
self.device_for_th_eco_kvs = kvs
153-
# TODO(https://github.com/CHIP-Specifications/chip-test-plans/issues/4375) During setup we need to create the TH_FSA device
154-
# where we would commission device created in create_device_and_commission_to_th_fabric to be commissioned into TH_FSA.
155-
156-
# TODO(https://github.com/CHIP-Specifications/chip-test-plans/issues/4375) Because we cannot create a TH_FSA and there is
157-
# no way to mock it the following 2 test steps are skipped for now.
158-
self.skip_step(3)
159-
self.skip_step(4)
160-
161139

162140
if __name__ == "__main__":
163141
default_matter_test_main()

0 commit comments

Comments
 (0)