2525# Different dumps for fsp platforms
2626# fipsdump
2727# system dump
28+ # host_dump_boottime --> Trigger dump when kernel boots(either Petitboot or OS kernel)
29+ # host_dump_runtime --> Trigger dump when system is in OS or already booted to OS
30+ # nmi_dump --> Trigger system dump by sending NMI interrupts to processors
31+ #
2832
2933import time
3034import subprocess
@@ -57,7 +61,7 @@ def tearDown(self):
5761 def trigger_dump (self ):
5862 if self .test == "nmi_dump" :
5963 self .cv_IPMI .ipmi_power_diag ()
60- elif self . test == "host_dump" :
64+ elif "host_dump" in self . test :
6165 self .cv_FSP .trigger_system_dump ()
6266 else :
6367 raise Exception ("Unknown test type" )
@@ -138,15 +142,20 @@ def runTest(self):
138142 self .skipTest ("FSP Platform OPAL specific dump tests" )
139143 self .cv_HOST .host_check_command ("opal-dump-parse" )
140144 self .cv_HOST .host_run_command ("rm -rf /var/log/dump/SYSDUMP*" )
145+ self .cv_HOST .host_run_command ("rm -rf /var/log/dump/Opal-log*" )
146+ self .cv_HOST .host_run_command ("rm -rf /var/log/dump/HostBoot-Runtime-log*" )
147+ self .cv_HOST .host_run_command ("rm -rf /var/log/dump/printk*" )
141148 self .cv_FSP .fsp_get_console ()
142149 if not self .cv_FSP .mount_exists ():
143150 raise OpTestError ("Please mount NFS and retry the test" )
144151
145152 self .set_up ()
146153 print self .cv_FSP .fsp_run_command ("smgr mfgState" )
154+ self .cv_FSP .enable_system_dump ()
147155 self .cv_FSP .clear_fsp_errors ()
148- self .cv_FSP .power_off_sys ()
149- self .cv_FSP .power_on_sys ()
156+ if "host_dump_boottime" in self .test :
157+ self .cv_FSP .power_off_sys ()
158+ self .cv_FSP .power_on_sys ()
150159 self .util .PingFunc (self .cv_HOST .ip , BMC_CONST .PING_RETRY_POWERCYCLE )
151160 self .trigger_dump ()
152161 self .cv_FSP .wait_for_systemdump_to_finish ()
@@ -164,6 +173,14 @@ def runTest(self):
164173 self .assertIn ("Opal" , '\n ' .join (res ), "sysdump test failed in dumping Opal-log section" )
165174 self .assertIn ("HostBoot-Runtime-log" , '\n ' .join (res ), "sysdump test failed in dumping HBRT section" )
166175 self .assertIn ("printk" , '\n ' .join (res ), "sysdump test failed in dumping printk section" )
176+ self .cv_HOST .host_run_command ("cd /var/log/dump/" )
177+ self .cv_HOST .host_run_command ("opal-dump-parse -s 1 /var/log/dump/SYSDUMP*" )
178+ self .cv_HOST .host_run_command ("cat Opal-log*" )
179+ self .cv_HOST .host_run_command ("opal-dump-parse -s 2 /var/log/dump/SYSDUMP*" )
180+ self .cv_HOST .host_run_command ("cat HostBoot-Runtime-log*" )
181+ self .cv_HOST .host_run_command ("opal-dump-parse -s 128 /var/log/dump/SYSDUMP*" )
182+ self .cv_HOST .host_run_command ("cat printk*" )
183+
167184
168185class FIPS_DUMP (OpTestDumps , unittest .TestCase ):
169186
@@ -201,10 +218,16 @@ def runTest(self):
201218 dumpname , size = self .fipsdump_initiate_from_host ()
202219 self .verify_fipsdump (dumpname , size )
203220
204- class HOST_DUMP (SYSTEM_DUMP ):
221+ class HOST_DUMP_BOOTTIME (SYSTEM_DUMP ):
222+
223+ def set_up (self ):
224+ self .test = "host_dump_boottime"
225+
226+ class HOST_DUMP_RUNTIME (SYSTEM_DUMP ):
205227
206228 def set_up (self ):
207- self .test = "host_dump"
229+ self .test = "host_dump_runtime"
230+
208231
209232class NMI_DIAG_DUMP (SYSTEM_DUMP ):
210233
@@ -214,6 +237,7 @@ def set_up(self):
214237def suite ():
215238 s = unittest .TestSuite ()
216239 s .addTest (FIPS_DUMP ())
217- s .addTest (HOST_DUMP ())
240+ s .addTest (HOST_DUMP_RUNTIME ())
218241 s .addTest (NMI_DIAG_DUMP ())
242+ s .addTest (HOST_DUMP_BOOTTIME ())
219243 return s
0 commit comments