@@ -89,6 +89,21 @@ def ipmi_monitor_sol_ipl(self, console, timeout):
8989 self .assertTrue (ipl_status , "HMI Core checkstop: IPL not started/finished" )
9090 return
9191
92+ def verify_proc_recovery (self , l_res ):
93+ if any ("Processor Recovery done" in line for line in l_res ) and \
94+ any ("Harmless Hypervisor Maintenance interrupt [Recovered]" in line for line in l_res ):
95+ print "Processor recovery done"
96+ return
97+ else :
98+ raise Exception ("HMI handling failed to log message: for proc_recv_done" )
99+
100+ def verify_timer_facility_recovery (self , l_res ):
101+ if any ("Timer facility experienced an error" in line for line in l_res ) and \
102+ any ("Severe Hypervisor Maintenance interrupt [Recovered]" in line for line in l_res ):
103+ print "Timer facility experienced an error and got recovered"
104+ return
105+ else :
106+ raise Exception ("HMI handling failed to log message" )
92107
93108 def init_test (self ):
94109 self .cv_SYSTEM .goto_state (OpSystemState .OS )
@@ -253,28 +268,22 @@ def _test_proc_recv_done(self):
253268 console = self .cv_SYSTEM .sys_get_ipmi_console ()
254269 console .run_command ("dmesg -C" )
255270 try :
256- l_res = console .run_command (l_cmd )
271+ l_res = console .run_command (l_cmd , timeout = 120 )
257272 except CommandFailed as cf :
258- if cf .exitcode == 5 :
273+ if cf .exitcode == 1 :
259274 pass
260275 else :
261- raise cf
262- else :
263- if any ("Kernel panic - not syncing" in line for line in l_res ):
264- raise Exception ("Processor recovery failed: Kernel got panic" )
265- elif any ("Petitboot" in line for line in l_res ):
266- raise Exception ("System reached petitboot:Processor recovery failed" )
267- elif any ("ISTEP" in line for line in l_res ):
268- raise Exception ("System started booting: Processor recovery failed" )
269- else :
270- raise Exception ("Failed to inject thread hang recoverable error" )
271-
276+ if any ("Kernel panic - not syncing" in line for line in l_res ):
277+ raise Exception ("Processor recovery failed: Kernel got panic" )
278+ elif any ("Petitboot" in line for line in l_res ):
279+ raise Exception ("System reached petitboot:Processor recovery failed" )
280+ elif any ("ISTEP" in line for line in l_res ):
281+ raise Exception ("System started booting: Processor recovery failed" )
282+ else :
283+ raise Exception ("Failed to inject thread hang recoverable error %s" , str (cf ))
284+ time .sleep (0.2 )
272285 l_res = console .run_command ("dmesg" )
273- if any ("Processor Recovery done" in line for line in l_res ) and \
274- any ("Harmless Hypervisor Maintenance interrupt [Recovered]" in line for line in l_res ):
275- print "Processor recovery done"
276- else :
277- raise Exception ("HMI handling failed to log message: for proc_recv_done" )
286+ self .verify_proc_recovery (l_res )
278287 return
279288
280289 ##
@@ -290,28 +299,22 @@ def _test_proc_recv_error_masked(self):
290299 console = self .cv_SYSTEM .sys_get_ipmi_console ()
291300 console .run_command ("dmesg -C" )
292301 try :
293- l_res = console .run_command (l_cmd )
302+ l_res = console .run_command (l_cmd , timeout = 120 )
294303 except CommandFailed as cf :
295304 if cf .exitcode == 1 :
296305 pass
297306 else :
298- raise cf
299- else :
300- if any ("Kernel panic - not syncing" in line for line in l_res ):
301- raise Exception ("Processor recovery failed: Kernel got panic" )
302- elif any ("Petitboot" in line for line in l_res ):
303- raise Exception ("System reached petitboot:Processor recovery failed" )
304- elif any ("ISTEP" in line for line in l_res ):
305- raise Exception ("System started booting: Processor recovery failed" )
306- else :
307- raise Exception ("Failed to inject thread hang recoverable error" )
308-
307+ if any ("Kernel panic - not syncing" in line for line in l_res ):
308+ raise Exception ("Processor recovery failed: Kernel got panic" )
309+ elif any ("Petitboot" in line for line in l_res ):
310+ raise Exception ("System reached petitboot:Processor recovery failed" )
311+ elif any ("ISTEP" in line for line in l_res ):
312+ raise Exception ("System started booting: Processor recovery failed" )
313+ else :
314+ raise Exception ("Failed to inject thread hang recoverable error %s" , str (cf ))
315+ time .sleep (0.2 )
309316 l_res = console .run_command ("dmesg" )
310- if any ("Processor Recovery done" in line for line in l_res ) and \
311- any ("Harmless Hypervisor Maintenance interrupt [Recovered]" in line for line in l_res ):
312- print "Processor recovery done"
313- else :
314- raise Exception ("HMI handling failed to log message" )
317+ self .verify_proc_recovery (l_res )
315318 return
316319
317320 ##
@@ -376,30 +379,23 @@ def _testTFMR_Errors(self, i_error):
376379 console = self .cv_SYSTEM .sys_get_ipmi_console ()
377380 console .run_command ("dmesg -C" )
378381 try :
379- l_res = console .run_command (l_cmd )
382+ l_res = console .run_command (l_cmd , timeout = 120 )
380383 except CommandFailed as cf :
381384 if cf .exitcode == 1 :
382385 pass
383386 else :
384- raise cf
385- else :
386- if any ("Kernel panic - not syncing" in line for line in l_res ):
387- l_msg = "TFMR error injection: Kernel got panic"
388- elif any ("Petitboot" in line for line in l_res ):
389- l_msg = "System reached petitboot:TFMR error injection recovery failed"
390- elif any ("ISTEP" in line for line in l_res ):
391- l_msg = "System started booting: TFMR error injection recovery failed"
392- else :
393- raise Exception ("Failed to inject TFMR error %s " % l_error )
387+ if any ("Kernel panic - not syncing" in line for line in l_res ):
388+ l_msg = "TFMR error injection: Kernel got panic"
389+ elif any ("Petitboot" in line for line in l_res ):
390+ l_msg = "System reached petitboot:TFMR error injection recovery failed"
391+ elif any ("ISTEP" in line for line in l_res ):
392+ l_msg = "System started booting: TFMR error injection recovery failed"
393+ else :
394+ raise Exception ("Failed to inject TFMR error %s " % str (cf ))
394395
395396 time .sleep (0.2 )
396397 l_res = console .run_command ("dmesg" )
397- if any ("Timer facility experienced an error" in line for line in l_res ) and \
398- any ("Severe Hypervisor Maintenance interrupt [Recovered]" in line for line in l_res ):
399- print "Timer facility experienced an error and got recovered"
400- else :
401- raise Exception ("HMI handling failed to log message" )
402-
398+ self .verify_timer_facility_recovery (l_res )
403399 return
404400
405401 ##
@@ -425,31 +421,24 @@ def _test_tod_errors(self, i_error):
425421 # But getscom to TOD error reg there is no access
426422 # TOD Error reg has only WO access and there is no read access
427423 try :
428- l_res = console .run_command (l_cmd )
424+ l_res = console .run_command (l_cmd , timeout = 120 )
429425 except CommandFailed as cf :
430426 if cf .exitcode == 1 :
431427 pass
432428 else :
433- raise cf
434- else :
435- if any ("Kernel panic - not syncing" in line for line in l_res ):
436- print "TOD ERROR Injection-kernel got panic"
437- elif any ("login:" in line for line in l_res ):
438- print "System booted to host OS without any kernel panic message"
439- elif any ("Petitboot" in line for line in l_res ):
440- print "System reached petitboot without any kernel panic message"
441- elif any ("ISTEP" in line for line in l_res ):
442- print "System started booting without any kernel panic message"
443- else :
444- raise Exception ("TOD: PSS Hamming distance error injection failed" )
445-
429+ if any ("Kernel panic - not syncing" in line for line in l_res ):
430+ print "TOD ERROR Injection-kernel got panic"
431+ elif any ("login:" in line for line in l_res ):
432+ print "System booted to host OS without any kernel panic message"
433+ elif any ("Petitboot" in line for line in l_res ):
434+ print "System reached petitboot without any kernel panic message"
435+ elif any ("ISTEP" in line for line in l_res ):
436+ print "System started booting without any kernel panic message"
437+ else :
438+ raise Exception ("TOD: PSS Hamming distance error injection failed %s" , str (c ))
439+ time .sleep (0.2 )
446440 l_res = console .run_command ("dmesg" )
447- if any ("Timer facility experienced an error" in line for line in l_res ) and \
448- any ("Severe Hypervisor Maintenance interrupt [Recovered]" in line for line in l_res ):
449- print "Timer facility experienced an error and got recovered"
450- else :
451- raise Exception ("HMI handling failed to log message" )
452-
441+ self .verify_timer_facility_recovery (l_res )
453442 return
454443
455444 ##
0 commit comments