@@ -111,14 +111,16 @@ def init_test(self):
111
111
asserts .fail ("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set" )
112
112
self .app_pipe = self .app_pipe + str (app_pid )
113
113
114
- def send_raw_manual_or_pipe_command (self , command : dict ):
114
+ def send_raw_manual_or_pipe_command (self , command : dict , msg : str ):
115
115
if self .is_ci :
116
116
self .write_to_app_pipe (command )
117
117
time .sleep (0.1 )
118
118
else :
119
- self .wait_for_user_input (prompt_msg = "Press Enter when ready.\n " )
119
+ prompt = msg if msg is not None else "Press Enter when ready."
120
+ prompt += '\n '
121
+ self .wait_for_user_input (prompt_msg = prompt )
120
122
121
- def send_manual_or_pipe_command (self , device : str , name : str , operation : str , param : Any = None ):
123
+ def send_manual_or_pipe_command (self , device : str , name : str , operation : str , param : Any = None , msg = None ):
122
124
command = {
123
125
"Name" : name ,
124
126
"Device" : device ,
@@ -128,7 +130,7 @@ def send_manual_or_pipe_command(self, device: str, name: str, operation: str, pa
128
130
if param is not None :
129
131
command ["Param" ] = param
130
132
131
- self .send_raw_manual_or_pipe_command (command )
133
+ self .send_raw_manual_or_pipe_command (command , msg )
132
134
133
135
async def send_cmd (self , endpoint , cmd , timedRequestTimeoutMs = None ):
134
136
logging .info (f"##### Command { cmd } " )
@@ -1046,11 +1048,13 @@ async def TEST_TC_OPSTATE_BASE_2_5(self, endpoint=1):
1046
1048
self .send_manual_or_pipe_command (name = "OperationalStateChange" ,
1047
1049
device = self .device ,
1048
1050
operation = "OnFault" ,
1049
- param = cluster .Enums .ErrorStateEnum .kNoError )
1051
+ param = cluster .Enums .ErrorStateEnum .kNoError ,
1052
+ msg = "Ensure the DUT is not in an error state." )
1050
1053
1051
1054
self .send_manual_or_pipe_command (name = "OperationalStateChange" ,
1052
1055
device = self .device ,
1053
- operation = "Stop" )
1056
+ operation = "Stop" ,
1057
+ msg = "Put the DUT in a state where it can receive a start command" )
1054
1058
1055
1059
# STEP 4: TH sends Start command to the DUT
1056
1060
self .step (4 )
@@ -1116,7 +1120,14 @@ async def TEST_TC_OPSTATE_BASE_2_5(self, endpoint=1):
1116
1120
# reboot outside CI environment.
1117
1121
if not self .is_ci :
1118
1122
self .wait_for_user_input (prompt_msg = "Restart DUT. Press Enter when ready.\n " )
1123
+ # Expire the session and re-establish the subscription
1119
1124
self .default_controller .ExpireSessions (self .dut_node_id )
1125
+ if self .check_pics (f"{ self .test_info .pics_code } .S.E01" ):
1126
+ # Subscribe to Events and when they are sent push them to a queue for checking later
1127
+ events_callback = EventSpecificChangeCallback (events .OperationCompletion )
1128
+ await events_callback .start (self .default_controller ,
1129
+ self .dut_node_id ,
1130
+ endpoint )
1120
1131
1121
1132
# STEP 12: TH waits for {PIXIT.WAITTIME.REBOOT}
1122
1133
self .step (12 )
@@ -1259,11 +1270,12 @@ async def TEST_TC_OPSTATE_BASE_2_6(self, endpoint=1):
1259
1270
sub_handler = ClusterAttributeChangeAccumulator (cluster )
1260
1271
await sub_handler .start (self .default_controller , self .dut_node_id , endpoint )
1261
1272
1273
+ self .step (3 )
1262
1274
if self .pics_guard (self .check_pics (f"{ self .test_info .pics_code } .S.M.ST_RUNNING" )):
1263
- self .step (3 )
1264
1275
self .send_manual_or_pipe_command (name = "OperationalStateChange" ,
1265
1276
device = self .device ,
1266
- operation = "Start" )
1277
+ operation = "Start" ,
1278
+ msg = "Put the DUT into the running state" )
1267
1279
time .sleep (1 )
1268
1280
await self .read_and_expect_value (endpoint = endpoint ,
1269
1281
attribute = attributes .OperationalState ,
@@ -1272,8 +1284,6 @@ async def TEST_TC_OPSTATE_BASE_2_6(self, endpoint=1):
1272
1284
if countdownTime is not NullValue :
1273
1285
count = sub_handler .attribute_report_counts [attributes .CountdownTime ]
1274
1286
asserts .assert_greater (count , 0 , "Did not receive any reports for CountdownTime" )
1275
- else :
1276
- self .skip_step (3 )
1277
1287
1278
1288
sub_handler .reset ()
1279
1289
self .step (4 )
@@ -1311,11 +1321,12 @@ async def TEST_TC_OPSTATE_BASE_2_6(self, endpoint=1):
1311
1321
self .skip_step (7 )
1312
1322
1313
1323
sub_handler .reset ()
1324
+ self .step (8 )
1314
1325
if self .pics_guard (self .check_pics (f"{ self .test_info .pics_code } .S.M.ST_RUNNING" )):
1315
- self .step (8 )
1316
1326
self .send_manual_or_pipe_command (name = "OperationalStateChange" ,
1317
1327
device = self .device ,
1318
- operation = "Start" )
1328
+ operation = "Start" ,
1329
+ msg = "Put DUT in running state" )
1319
1330
time .sleep (1 )
1320
1331
await self .read_and_expect_value (endpoint = endpoint ,
1321
1332
attribute = attributes .OperationalState ,
@@ -1339,7 +1350,8 @@ async def TEST_TC_OPSTATE_BASE_2_6(self, endpoint=1):
1339
1350
self .step (11 )
1340
1351
self .send_manual_or_pipe_command (name = "OperationalStateChange" ,
1341
1352
device = self .device ,
1342
- operation = "Pause" )
1353
+ operation = "Pause" ,
1354
+ msg = "Put DUT in paused state" )
1343
1355
time .sleep (1 )
1344
1356
count = sub_handler .attribute_report_counts [attributes .CountdownTime ]
1345
1357
asserts .assert_greater (count , 0 , "Did not receive any reports for CountdownTime" )
0 commit comments