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 <[email protected]>
  • Loading branch information
Sachin P Bappalige committed Sep 20, 2023
1 parent 7e75b5a commit 671bdce
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions testcases/PowerNVDump.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import time
import re
import tempfile
import shutil

import OpTestConfiguration
import OpTestLogger
Expand Down Expand Up @@ -370,6 +371,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 +1326,39 @@ 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.
# Linux-Debugging url needs to be given in ~/.op-test-framework.conf.
# Ex: url=http://liquidtelecom.dl.sourceforge.net/project/ebizzy/ebizzy/0.3/ebizzy-0.3.tar.gz


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 [email protected]: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)

#Insert kernel module for softlockup
#self.c.pty.sendline("insmod /tmp/kernel-module-bug-196448/softlockup.ko")
#time.sleep(500)
#self.verify_dump_file()


def crash_suite():
s = unittest.TestSuite()
Expand Down Expand Up @@ -1354,5 +1390,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 671bdce

Please sign in to comment.