Skip to content

Commit 5987061

Browse files
duyen-tranpull[bot]
authored andcommitted
[RVCOPSTATE-2.3] Add a check for PICS (#28588)
* check for countdowntime pics * clean up * address comments * address comments * address comments * Revert "address comments" This reverts commit dbdfa94. * add check for RVCOPSTATE.S.M.ST_RUNNING * remove the check for paused and running pics
1 parent 46ec7a0 commit 5987061

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/python_testing/TC_RVCOPSTATE_2_3.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ async def test_TC_RVCOPSTATE_2_3(self):
5555

5656
self.endpoint = self.matter_test_config.global_test_params['PIXIT_ENDPOINT']
5757

58-
asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0002"), "RVCOPSTATE.S.A0002 must be supported")
5958
asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0003"), "RVCOPSTATE.S.A0003 must be supported")
6059
asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0004"), "RVCOPSTATE.S.A0004 must be supported")
6160
asserts.assert_true(self.check_pics("RVCOPSTATE.S.C00.Rsp"), "RVCOPSTATE.S.C00.Rsp must be supported")
@@ -93,25 +92,26 @@ async def test_TC_RVCOPSTATE_2_3(self):
9392
asserts.assert_equal(operational_state, Clusters.OperationalState.Enums.OperationalStateEnum.kPaused,
9493
"OperationalState(%s) should be Paused(0x02)" % operational_state)
9594

96-
self.print_step(6, "Read CountdownTime attribute")
97-
initial_countdown_time = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
98-
attribute=attributes.CountdownTime)
99-
logging.info("CountdownTime: %s" % (initial_countdown_time))
100-
if initial_countdown_time is not NullValue:
101-
in_range = (1 <= initial_countdown_time <= 259200)
102-
asserts.assert_true(initial_countdown_time is NullValue or in_range,
103-
"invalid CountdownTime(%s). Must be in between 1 and 259200, or null" % initial_countdown_time)
104-
105-
self.print_step(7, "Waiting for 5 seconds")
106-
time.sleep(5)
107-
108-
self.print_step(8, "Read CountdownTime attribute")
109-
countdown_time = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CountdownTime)
110-
logging.info("CountdownTime: %s" % (countdown_time))
111-
asserts.assert_true(countdown_time != 0 or countdown_time == NullValue,
112-
"invalid CountdownTime(%s). Must be a non zero integer, or null" % countdown_time)
113-
asserts.assert_equal(countdown_time, initial_countdown_time,
114-
"CountdownTime(%s) does not equal to the intial CountdownTime (%s)" % (countdown_time, initial_countdown_time))
95+
if self.check_pics("RVCOPSTATE.S.A0002"):
96+
self.print_step(6, "Read CountdownTime attribute")
97+
initial_countdown_time = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
98+
attribute=attributes.CountdownTime)
99+
logging.info("CountdownTime: %s" % (initial_countdown_time))
100+
if initial_countdown_time is not NullValue:
101+
in_range = (1 <= initial_countdown_time <= 259200)
102+
asserts.assert_true(initial_countdown_time is NullValue or in_range,
103+
"invalid CountdownTime(%s). Must be in between 1 and 259200, or null" % initial_countdown_time)
104+
105+
self.print_step(7, "Waiting for 5 seconds")
106+
time.sleep(5)
107+
108+
self.print_step(8, "Read CountdownTime attribute")
109+
countdown_time = await self.read_mod_attribute_expect_success(endpoint=self.endpoint, attribute=attributes.CountdownTime)
110+
logging.info("CountdownTime: %s" % (countdown_time))
111+
asserts.assert_true(countdown_time != 0 or countdown_time == NullValue,
112+
"invalid CountdownTime(%s). Must be a non zero integer, or null" % countdown_time)
113+
asserts.assert_equal(countdown_time, initial_countdown_time,
114+
"CountdownTime(%s) does not equal to the intial CountdownTime (%s)" % (countdown_time, initial_countdown_time))
115115

116116
self.print_step(9, "Send Pause command")
117117
ret = await self.send_pause_cmd()

0 commit comments

Comments
 (0)