@@ -444,6 +444,8 @@ def _testHMIHandling(self, i_test):
444
444
self ._testTFMR_Errors (BMC_CONST .TFMR_SPURR_PARITY_ERROR )
445
445
elif l_test == BMC_CONST .HMI_TOD_TOPOLOGY_FAILOVER :
446
446
self ._test_tod_topology_failover ()
447
+ elif l_test == BMC_CONST .OPAL_TI :
448
+ self ._test_opal_ti ()
447
449
else :
448
450
raise Exception ("Please provide valid test case" )
449
451
l_con .run_command ("dmesg -C" )
@@ -601,6 +603,32 @@ def _test_tod_topology_failover(self):
601
603
602
604
return
603
605
606
+ def ppc_bit (self , bit ):
607
+ l_val = 0x8000000000000000 >> bit
608
+ return l_val
609
+
610
+ def _test_opal_ti (self ):
611
+ '''
612
+ This function is used to test OPAL TI functionality.
613
+ '''
614
+ lsprop_output = self .cv_HOST .host_run_command ("lsprop /proc/device-tree/ibm,sw-checkstop-fir | tail -n 1" )
615
+ saddr , bit = str (lsprop_output [0 ]).split ()
616
+ scom_addr = "0x%s" % saddr
617
+ bit = int (bit , 16 )
618
+
619
+ l_error = "0x%016x" % self .ppc_bit (bit )
620
+
621
+ log .debug ("lsprop = %s = %d" % (scom_addr , bit ))
622
+ console = self .cv_SYSTEM .console
623
+
624
+ for l_pair in self .l_dic :
625
+ l_chip = l_pair [0 ]
626
+ l_cmd = "PATH=/usr/local/sbin:$PATH putscom -c %s %s %s" % (l_chip , scom_addr , l_error )
627
+ console .pty .sendline (l_cmd )
628
+ self .handle_OpalTI ()
629
+
630
+ return
631
+
604
632
def _test_hyp_resource_err (self ):
605
633
'''
606
634
This function is used to test HMI: Hypervisor resource error
@@ -771,6 +799,14 @@ def runTest(self):
771
799
else :
772
800
self .skipTest ("OPAL TI not supported on this system." )
773
801
802
+ class OpalTI (OpTestHMIHandling ):
803
+ def runTest (self ):
804
+ rc = self .is_node_present ("/proc/device-tree/ibm,sw-checkstop-fir" )
805
+ if rc == 1 :
806
+ self ._testHMIHandling (BMC_CONST .OPAL_TI )
807
+ else :
808
+ self .skipTest ("OPAL TI not supported on this system." )
809
+
774
810
class HypervisorResourceError (OpTestHMIHandling ):
775
811
def runTest (self ):
776
812
self ._testHMIHandling (BMC_CONST .HMI_HYPERVISOR_RESOURCE_ERROR )
@@ -785,6 +821,7 @@ def unrecoverable_suite():
785
821
s .addTest (MalfunctionAlert ())
786
822
s .addTest (HypervisorResourceError ())
787
823
s .addTest (TodTopologyFailoverPanic ())
824
+ s .addTest (OpalTI ())
788
825
s .addTest (TodTopologyFailoverOpalTI ())
789
826
s .addTest (ClearGard ())
790
827
return s
0 commit comments