Skip to content

Commit 75bf625

Browse files
committed
Don't hard-code the fabric index when removing the secondary fabric
1 parent 010ad94 commit 75bf625

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/python_testing/TC_TSTAT_4_2.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ async def test_TC_TSTAT_4_2(self):
261261
nodeId=self.dut_node_id, setupPinCode=params.setupPinCode,
262262
filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=1234)
263263

264+
secondary_fabric_index = await self.read_single_attribute_check_success(dev_ctrl=secondary_controller, endpoint=0, cluster=Clusters.Objects.OperationalCredentials, attribute=Clusters.OperationalCredentials.Attributes.CurrentFabricIndex)
265+
264266
current_presets = []
265267
presetTypes = []
266268
presetScenarioCounts = {}
@@ -643,7 +645,7 @@ async def test_TC_TSTAT_4_2(self):
643645
await self.send_atomic_request_begin_command(dev_ctrl=secondary_controller)
644646

645647
# Primary controller removes the second fabric
646-
await self.send_single_cmd(Clusters.OperationalCredentials.Commands.RemoveFabric(fabricIndex=2), endpoint=0)
648+
await self.send_single_cmd(Clusters.OperationalCredentials.Commands.RemoveFabric(fabricIndex=secondary_fabric_index), endpoint=0)
647649

648650
# Send the AtomicRequest begin command from primary controller, which should succeed, as the secondary controller's atomic write state has been cleared
649651
status = await self.send_atomic_request_begin_command()

0 commit comments

Comments
 (0)