@@ -357,6 +357,8 @@ def _testHMIHandling(self, i_test):
357
357
self ._testTFMR_Errors (BMC_CONST .TFMR_SPURR_PARITY_ERROR )
358
358
elif l_test == BMC_CONST .HMI_TOD_TOPOLOGY_FAILOVER :
359
359
self ._test_tod_topology_failover ()
360
+ elif l_test == BMC_CONST .OPAL_TI :
361
+ self ._test_opal_ti ()
360
362
else :
361
363
raise Exception ("Please provide valid test case" )
362
364
l_con .run_command ("dmesg -C" )
@@ -514,6 +516,32 @@ def _test_tod_topology_failover(self):
514
516
515
517
return
516
518
519
+ def ppc_bit (self , bit ):
520
+ l_val = 0x8000000000000000 >> bit
521
+ return l_val
522
+
523
+ def _test_opal_ti (self ):
524
+ '''
525
+ This function is used to test OPAL TI functionality.
526
+ '''
527
+ lsprop_output = self .cv_HOST .host_run_command ("lsprop /proc/device-tree/ibm,sw-checkstop-fir | tail -n 1" )
528
+ saddr , bit = str (lsprop_output [0 ]).split ()
529
+ scom_addr = "0x%s" % saddr
530
+ bit = int (bit , 16 )
531
+
532
+ l_error = "0x%016x" % self .ppc_bit (bit )
533
+
534
+ log .debug ("lsprop = %s = %d" % (scom_addr , bit ))
535
+ console = self .cv_SYSTEM .console
536
+
537
+ for l_pair in self .l_dic :
538
+ l_chip = l_pair [0 ]
539
+ l_cmd = "PATH=/usr/local/sbin:$PATH putscom -c %s %s %s" % (l_chip , scom_addr , l_error )
540
+ console .pty .sendline (l_cmd )
541
+ self .handle_OpalTI ()
542
+
543
+ return
544
+
517
545
def _test_hyp_resource_err (self ):
518
546
'''
519
547
This function is used to test HMI: Hypervisor resource error
@@ -684,6 +712,14 @@ def runTest(self):
684
712
else :
685
713
self .skipTest ("OPAL TI not supported on this system." )
686
714
715
+ class OpalTI (OpTestHMIHandling ):
716
+ def runTest (self ):
717
+ rc = self .is_node_present ("/proc/device-tree/ibm,sw-checkstop-fir" )
718
+ if rc == 1 :
719
+ self ._testHMIHandling (BMC_CONST .OPAL_TI )
720
+ else :
721
+ self .skipTest ("OPAL TI not supported on this system." )
722
+
687
723
class HypervisorResourceError (OpTestHMIHandling ):
688
724
def runTest (self ):
689
725
self ._testHMIHandling (BMC_CONST .HMI_HYPERVISOR_RESOURCE_ERROR )
@@ -698,6 +734,7 @@ def unrecoverable_suite():
698
734
s .addTest (MalfunctionAlert ())
699
735
s .addTest (HypervisorResourceError ())
700
736
s .addTest (TodTopologyFailoverPanic ())
737
+ s .addTest (OpalTI ())
701
738
s .addTest (TodTopologyFailoverOpalTI ())
702
739
s .addTest (ClearGard ())
703
740
return s
0 commit comments