Skip to content

Commit

Permalink
Add softlockup scenario for kdump/Fadump testing
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin P Bappalige <sachinpb@linux.vnet.ibm.com>
  • Loading branch information
Sachin P Bappalige committed Sep 20, 2023
1 parent 7e75b5a commit 5e26281
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions testcases/PowerNVDump.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ def kernel_crash(self, crash_type="echo_c"):
elif crash_type == "hmc":
self.cv_HMC.run_command("chsysstate -r lpar -m %s -n %s -o dumprestart" %
(self.system_name, self.lpar_name), timeout=300)
elif crash_type == "lock":
self.c.pty.sendline("insmod /tmp/kernel-module-bug-196448/softlockup.ko")
done = False
boot_type = BootType.NORMAL
rc = -1
Expand Down Expand Up @@ -1323,6 +1325,32 @@ def runTest(self):
if not obj.update_kernel_cmdline(self.distro, remove_args="fadump=nocma", reboot=True, reboot_cmd=True):
self.fail("KernelArgTest failed to update kernel args")

class KernelCrash_KdumpSoftlockup(PowerNVDump):

'''
This test verifies kdump/fadump after inserting softlockup kernel module.
'''

def runTest(self):
self.setup_test()
directory_path = "/tmp/kernel-module-bug-196448"
# Make sure /tmp/skiboot directory does not exist
self.c.run_command("cd /tmp; ls -1; rm -rf %s" % directory_path)

#clone this repo
r_cmd = "git clone git@github.ibm.com:sjain014/kernel-module-bug-196448.git /tmp/kernel-module-bug-196448"
self.c.run_command(r_cmd)
time.sleep(20)

#compile kernel modeules
self.c.run_command("cd /tmp/kernel-module-bug-196448; make")
time.sleep(30)

#Enable softlockup
self.c.run_command("sysctl -w kernel.softlockup_panic=1")

boot_type = self.kernel_crash(crash_type="lock")
self.verify_dump_file(boot_type)

def crash_suite():
s = unittest.TestSuite()
Expand Down Expand Up @@ -1354,5 +1382,6 @@ def crash_suite():
s.addTest(KernelCrash_DisableAll())
s.addTest(SkirootKernelCrash())
s.addTest(OPALCrash_MPIPL())
s.addTest(KernelCrash_KdumpSoftlockup())

return s

0 comments on commit 5e26281

Please sign in to comment.