Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/python_testing/TC_OPSTATE_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
# run1:
# app: ${ALL_CLUSTERS_APP}
# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --app-pipe /tmp/opstate_2_5_fifo
# app-ready-pattern: "APP STATUS: Starting event loop"
# script-args: >
# --endpoint 1
# --int-arg PIXIT.WAITTIME.REBOOT:5
# --storage-path admin_storage.json
# --commissioning-method on-network
# --discriminator 1234
Expand All @@ -48,6 +48,10 @@


class TC_OPSTATE_2_5(MatterBaseTest, TC_OPSTATE_BASE):
# This test reboots the DUT (step 15). Disable the background wildcard subscription
# so reads after the reboot are not cross-checked against a now-stale subscription cache.
disable_wildcard_subscription = True

def __init__(self, *args):
super().__init__(*args)

Expand Down
1 change: 0 additions & 1 deletion src/python_testing/TC_OPSTATE_2_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --app-pipe /tmp/opstate_2_6_fifo
# script-args: >
# --endpoint 1
# --int-arg PIXIT.WAITTIME.REBOOT:5
# --storage-path admin_storage.json
# --commissioning-method on-network
# --discriminator 1234
Expand Down
6 changes: 5 additions & 1 deletion src/python_testing/TC_OVENOPSTATE_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
# run1:
# app: ${ALL_CLUSTERS_APP}
# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --app-pipe /tmp/ovenopstate_2_5_fifo
# app-ready-pattern: "APP STATUS: Starting event loop"
# script-args: >
# --endpoint 1
# --int-arg PIXIT.WAITTIME.REBOOT:5
# --storage-path admin_storage.json
# --commissioning-method on-network
# --discriminator 1234
Expand All @@ -48,6 +48,10 @@


class TC_OVENOPSTATE_2_5(MatterBaseTest, TC_OPSTATE_BASE):
# This test reboots the DUT (step 15). Disable the background wildcard subscription
# so reads after the reboot are not cross-checked against a now-stale subscription cache.
disable_wildcard_subscription = True

def __init__(self, *args):
super().__init__(*args)

Expand Down
1 change: 0 additions & 1 deletion src/python_testing/TC_OVENOPSTATE_2_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --app-pipe /tmp/ovenopstate_2_6_fifo
# script-args: >
# --endpoint 1
# --int-arg PIXIT.WAITTIME.REBOOT:5
# --storage-path admin_storage.json
# --commissioning-method on-network
# --discriminator 1234
Expand Down
33 changes: 10 additions & 23 deletions src/python_testing/TC_OpstateCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def STEPS_TC_OPSTATE_BASE_2_5(self) -> list[TestStep]:
TestStep(13, "TH waits for OperationCompletion event"),
TestStep(14, "TH reads from the DUT the OperationalState attribute"),
TestStep(15, "Restart DUT"),
TestStep(16, "TH waits for {PIXIT.WAITTIME.REBOOT}"),
TestStep(16, "TH re-establishes a subscription to the OperationCompletion event after the reboot"),
TestStep(17, "TH sends Start command to the DUT"),
TestStep(18, "TH reads from the DUT the OperationalState attribute"),
TestStep(19, "TH sends Pause command to the DUT"),
Expand All @@ -1007,15 +1007,6 @@ async def TEST_TC_OPSTATE_BASE_2_5(self, endpoint=1):

self.init_test()

asserts.assert_true('PIXIT.WAITTIME.REBOOT' in self.matter_test_config.global_test_params,
"PIXIT.WAITTIME.REBOOT must be included on the command line in "
"the --int-arg flag as PIXIT.WAITTIME.REBOOT:<wait time>")

wait_time_reboot = self.matter_test_config.global_test_params['PIXIT.WAITTIME.REBOOT']

if wait_time_reboot == 0:
asserts.fail("PIXIT.WAITTIME.REBOOT shall be higher than 0.")

# STEP 1: Commission DUT to TH (can be skipped if done in a preceding test)
self.step(1)

Expand Down Expand Up @@ -1126,21 +1117,17 @@ async def TEST_TC_OPSTATE_BASE_2_5(self, endpoint=1):

# STEP 15: Restart DUT
self.step(15)
# In CI environment, the STOP command (step 8) already resets the variables. Only ask for
# reboot outside CI environment.
if not self.is_ci:
self.wait_for_user_input(prompt_msg="Restart DUT. Press Enter when ready.\n")
# Expire the session and re-establish the subscription
self.default_controller.ExpireSessions(self.dut_node_id)
# Subscribe to Events and when they are received push them to a queue for checking later
events_callback = EventSpecificChangeCallback(events.OperationCompletion)
await events_callback.start(self.default_controller,
self.dut_node_id,
endpoint)
# Reboot the DUT. This handles both CI/development (via the test runner restart flag)
# and manual testing (via user prompt), and expires existing sessions so controllers
# can reconnect after the reboot.
await self.request_device_reboot()

# STEP 16: TH waits for {PIXIT.WAITTIME.REBOOT}
# STEP 16: Re-establish the subscription to the OperationCompletion event after the reboot
self.step(16)
await asyncio.sleep(wait_time_reboot)
events_callback = EventSpecificChangeCallback(events.OperationCompletion)
await events_callback.start(self.default_controller,
self.dut_node_id,
endpoint)

# STEP 17: TH sends Start command to the DUT
self.step(17)
Expand Down
Loading