Skip to content

Commit

Permalink
In TC-ICDM-3.4 make sure that a new session will be used after DUT re…
Browse files Browse the repository at this point in the history
…boots (#35092)

* after DUT reboots make sure that a new session will be used
fixes #34985

* updated comment to reflect closing the session than expiring it

* re-establish session only when not in CI
  • Loading branch information
fessehaeve authored Aug 20, 2024
1 parent 7b7fe91 commit 88b6644
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/python_testing/TC_ICDM_3_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
import time

import chip.clusters as Clusters
from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main
from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body,
default_matter_test_main)
from mobly import asserts

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -110,6 +111,16 @@ async def test_TC_ICDM_3_4(self):
time.sleep(wait_time_reboot)

self.step(3)
if not is_ci:
# since device has rebooted, force establishing a new CASE session by closing it
self.config = MatterTestConfig()
self.stack = MatterStackState(self.config)
devCtrl = self.stack.certificate_authorities[0].adminList[0].NewController(
nodeId=self.config.controller_node_id,
paaTrustStorePath=str(self.config.paa_trust_store_path),
catTags=self.config.controller_cat_tags
)
devCtrl.CloseSession(self.dut_node_id)
icdCounter2 = await self._read_icdm_attribute_expect_success(attribute=attributes.ICDCounter)
asserts.assert_greater_equal(icdCounter2, icdCounter1,
"ICDCounter have reboot is not greater or equal to the ICDCounter read before the reboot.")
Expand Down

0 comments on commit 88b6644

Please sign in to comment.